Run an Executable from adb shell yield a "Trap" message

163 views
Skip to first unread message

Chris Stratton

unread,
Jul 21, 2012, 7:57:57 AM7/21/12
to andro...@googlegroups.com
Android apps are libraries loaded into a dvm process, not executables launched by themselves.

It is possible to make an executable, but discouraged. Additionally you have limited access to android APIs and it is difficult for the user to start the program.

Which are you trying to do? Your build approach will need to match the goal.

Chris Stratton

unread,
Jul 22, 2012, 4:47:25 PM7/22/12
to android-ndk
On Jul 22, 3:00 am, Kathy L <ktl...@gmail.com> wrote:
> I'm getting the test results as illustrated instead that
> "trap" message.  I still have no idea what it's trying to tell me.  I know
> for sure it didn't even get to the main().

If it didn't get to main, it's probably failing in a library
initializer.

Can you simplify by commenting out most of the tests, link against
fewer things, or add debug output in your library initializers?

But I'm not yet entirely convinced that you have compiled a valid
executable. Maybe you should use your build approach to create a
program that links nothing custom, and generates debug output when it
does get to main.

Scott Sibley

unread,
Jul 22, 2012, 7:21:23 PM7/22/12
to andro...@googlegroups.com
One thing that "trap" error may be is a memory trap. Here's some info.

http://www.rt-embedded.com/blog/archives/resolving-alignment-traps/
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>
Reply all
Reply to author
Forward
0 new messages