Skip to content

Conversation

@srh
Copy link
Contributor

@srh srh commented Apr 17, 2022

One thing to note: it's not always working. E.g. it doesn't work if we have a SIGSEGV but it does if we have guarantee(false). It probably has something to do with signal handling.

We also encountered the confusing situation in crash_or_trap where raise(SIGTRAP) didn't abort the process. Maybe it is now swallowed up by MacOS. So now the crash_or_trap macro is the same as crash -- it calls abort() after the BREAKPOINT line.

If you're running a debugger on some system and want to do something crazy like step forward, well, then, you can adjust the macro accordingly.

I assume the reason for this MacOS change is somehow related to how we block signals on non-main threads in thread_pool.cc. Maybe we just ignore SIGTRAP now on MacOS. It didn't trap when running in lldb either.

(I tested a simple executable that calls raise(SIGTRAP) in a separate thread and that did interrupt the whole process. I am not going to investigate further.)

@srh srh merged commit 0d73bdb into rethinkdb:v2.4.x Apr 17, 2022
@srh srh deleted the srh/pthread_stack_locations branch April 17, 2022 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant