If the thread receives a signal concurrently with PTRACE_ATTACH,
we can get notification about the signal before notification about stop.
In such case we need to forward the signal to the thread, otherwise
the signal will be missed (as we do PTRACE_DETACH with arg=0) and
any logic relying on signals will break. After forwarding we need to
continue to wait for stopping, because the thread is not stopped yet.
We do ignore delivery of SIGSTOP, because we want to make stop-the-world
as invisible as possible.
Details
- Reviewers
earthdok
Diff Detail
Event Timeline
lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | ||
---|---|---|
114 | We do actually want to stop the threads, though. I think you misunderstood this part:
This is "usual practice" for when you want the threads to keep running. | |
119 | passing uptr* in place of int* | |
125 | indent | |
130 | How about this part:
and
| |
test/tsan/signal_segv_handler.cc | ||
36 | don't need this anymore |
lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | ||
---|---|---|
114 | Why do you think that my code does not stop threads? |
lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | ||
---|---|---|
125 | ... and what if the wrapped argument does not fit onto line if you align it to the first arg?... |
lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | ||
---|---|---|
125 |
Then you wrap at the opening bracket and indent with 4 spaces. It's pretty clear: http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Function_Calls
Basically you can choose between foobar(a, b) and foobar( a, b) or foobar( a, b) But nowhere does it mention the middle ground of foobar(a, b) |
We do actually want to stop the threads, though.
I think you misunderstood this part:
This is "usual practice" for when you want the threads to keep running.