Reputation: 1
CLion SIGABRT I am using CLion 2024.1.6, lldb-1600.0.39.3. In debug mode, the program triggered SIGABRT. It is expected that breakpoints should be triggered here. I want to know what the problem is.
I tried setting handle SIGABRT using lldb -s true -n true -p true
and it still doesn't work
Upvotes: 0
Views: 44
Reputation: 27110
To be clear, SIGABRT isn't a breakpoint, that's a signal delivered by your program to itself, telling it to abort - generated because the failed assert ended up calling pthread_kill.
The assert macro can be disabled, see for instance:
How can I completely disable calls to assert()?
Many projects build with asserts "turned off" in release mode - so they are basically noop's, but turned on in debug mode. The idea being that when you are debugging (or running your app's test suite in debug mode) you want to catch any violations of the internal requirements your assert is expressing immediately, so you want an assert to stop the process.
SIGABRT is also a "non-maskable" signal, so though you can tell lldb whether or not to stop when the signal is delivered, it is going to terminate your app.
What you are describing is the correct behavior of the assert macro and the debugger. If you don't want assert to generate a SIGABRT, then you have to turn it off as described in the answer above. Otherwise it will generate this signal, which is intended to terminate your program's execution.
Upvotes: 0