shoosh
shoosh

Reputation: 78934

SIG33 when debugging native Android

I'm using Android Studio to debug a NativeActivity app written in C++
In my C++ code the first thing I do in android_main() is wait 10 seconds for the debugger to attach. In the 'Debug' window I see:

Now Launching Native Debug Session

and then after a few seconds

Debugger attached to process 28458

and then right after it attaches, the debugger is stopped with a signal:

Signal: 33 (signal SIG33)

I press 'Resume Program' and then I get the same signal again and again for 7-8 times. After that, the program continues as expected, debugger attached and I am able to stop it at breakpoints.

What's the meaning of that SIG33? how can I prevent it?

Upvotes: 13

Views: 3099

Answers (3)

Top-Master
Top-Master

Reputation: 8751

Those can be ignored and/or silenced using below GDB command-line:

handle SIG33 nostop noprint

Upvotes: 2

Aniruth
Aniruth

Reputation: 155

SIG33 is used to signal about "threading libraries" by LLDB.

Excerpt from LLDB source:

AddSignal (33, "SIG33", false, false, false, "threading library internal signal 2");

But I don't seem to understand the reason why your code is getting this. May be due to some minor dependency issues.

Upvotes: 1

programmerjake
programmerjake

Reputation: 1824

Signal 33 is used internally by bionic for the backtrace facilities.

See comment in __libc_current_sigrtmin.cpp.

// POSIX timers use __SIGRTMIN + 0.
// libbacktrace uses __SIGRTMIN + 1.
// libcore uses __SIGRTMIN + 2.

See definition of __SIGRTMIN for generic, arm, x86, and mips.

#define __SIGRTMIN 32

I think that SIG33 is caused by gdb and gdb is not correctly ignoring it.

Upvotes: 6

Related Questions