Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8132373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:20:02+00:00 2026-06-06T09:20:02+00:00

I am trying to debug a multi-threaded Android app on a 2.3.6 device using

  • 0

I am trying to debug a multi-threaded Android app on a 2.3.6 device using NDK r6b. I’ve also tried using NDK r8 with the same result. Whenever I hit my breakpoint, the app crashes. I seem to be getting into a case that is described in the NDK r5b docs in the “Thread support” section:

What this means in practical terms are:

- If you are on Android 2.3, or a prior platform release which has had the
  platform bugfix back-ported to it, you will be able to debug native
  threads automatically.

- If you are not, you will only be able to debug the main thread
  (as in previous NDK releases). You will also see the following message
  when launching ndk-gdb (just before the gdb prompt):

     Thread debugging is unsupported on this Android platform!

  If you place a breakpoint on a function executed on a non-main thread, the
  program will exit with the following message in GDB:

        Program terminated with signal SIGTRAP, Trace/breakpoint trap.
        The program no longer exists.

I get the exact error mentioned. I believe I am getting into this case because I see Thread debugging is unsupported on this Android platform! when I run ndk-gdb. As I mentioned, I am on a Gingerbread device and I have <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9"/> in the manifest so I should NOT be getting into this case.

Here is more detail about the steps I follow to get to the crash:

  1. Start my app using Debug from Eclipse
  2. Hit a breakpoint that I’ve set after System.loadLibrary where my native lib gets loaded
  3. In my project directory, run ndk-gdb –force –verbose –start
  4. gdb starts successfully and is attached
  5. set a breakpoint in gdb, continue in Eclipse, then continue in gdb
  6. crash!

See below for an edited console dump.

I’d appreciate any feedback on why this could be happening!

$ ndk-gdb --force --verbose --start
Android NDK installation path: /Users/tony/Documents/android-ndk-r8
Using default adb command: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.29
Using ADB flags: 
Using auto-detected project path: .
Found package name: com.mycompany.myapp
ABIs targetted by application: armeabi
Device API Level: 10
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi
Using gdb setup init: ./libs/armeabi/gdb.setup
Using toolchain prefix: /Users/tony/Documents/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-
Using app out directory: ./obj/local/armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.appMobi.applab/lib/gdbserver
Found data directory: '/data/data/com.mycompany.myapp'
Found first launchable activity: .MainActivity
Launching activity: com.mycompany.myapp/.MainActivity
## COMMAND: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb shell am start -n com.mycompany.myapp/.MainActivity
Starting: Intent { cmp=com.mycompany.myapp/.MainActivity }
Warning: Activity not started, intent has been delivered to currently running top-most instance.
## COMMAND: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb shell sleep 2
Found running PID: 7341
Launched gdbserver succesfully.
Setup network redirection
## COMMAND: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb forward tcp:5039 localfilesystem:/data/data/com.mycompany.myapp/debug-socket
## COMMAND: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb shell run-as com.appMobi.applab lib/gdbserver +debug-socket --attach 7341
## COMMAND: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb pull /system/bin/app_process ./obj/local/armeabi/app_process
Attached; pid = 7341
Listening on sockaddr socket debug-socket
184 KB/s (5720 bytes in 0.030s)
Pulled app_process from device/emulator.
## COMMAND: /Users/tony/Documents/android-sdk-mac_86/platform-tools/adb pull /system/lib/libc.so ./obj/local/armeabi/libc.so
4347 KB/s (273940 bytes in 0.061s)
Pulled libc.so from device/emulator.
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin --target=arm-elf-linux".
(no debugging symbols found)
Error while mapping shared library sections:

...shared library mapping errors ommitted...

Thread debugging is unsupported on this Android platform!
Thread debugging is unsupported on this Android platform!
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
warning: shared library handler failed to enable breakpoint
0xafd0c5ac in epoll_wait () from /Developer/AppMobiAndroid/AppLab/obj/local/armeabi/libc.so
Thread debugging is unsupported on this Android platform!
(gdb) break dcanvas.cpp:544
Breakpoint 1 at 0x81833c8a: file /Developer/AppMobiAndroid/AppLab/jni/dcanvas.cpp, line 544.
(gdb) c
Continuing.

Child terminated with signal = 5 

Program terminated with signal SIGTRAP, Trace/breakpoint trap.
The program no longer exists.
(gdb) 
Child terminated with signal = 0x5 (SIGTRAP)
GDBserver exiting
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:20:04+00:00Added an answer on June 6, 2026 at 9:20 am

    I am suspecting the reason that its crashing when hitting the breakpoint is down to the version of the bionic lib that comes with Android 2.3.6 version. More than likely, the library is not able to support threading or is broken.

    bionic lib is the core runtime library that provides native standard C code API’s for the Android platform. If you can think of glibc, you’re not far off the mark there.

    The best you can do instead is, to modify your native code and spam the logcat to see the paths taken during execution and do away with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to debug (using gdb) a multi-threaded program, which uses POSIX threads.
I'm trying to debug a deadlock in a multi-threaded Python application after it has
I was trying to debug a multi-threaded process on a Linux server running Slackware
While trying to debug why my multi threaded Java application is consuming large amount
I am trying to debug a few regular expressions using: perl -Mre=debug file.pl The
Trying to debug PHP using its default current-line-only error messages is horrible. How can
Im trying to debug the following code using System; public class Parent { string
I'm trying to debug a rest/json service that i build using Jersey and Amazon
I am trying to debug my Django project via Eclipse. The app works fine
I was trying to debug a c++ app, but I saw breakpoints show breakpoint

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.