[Lldb-commits] [PATCH] D120320: [lldb/driver] Fix SIGTSTP handling

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 23 07:34:16 PST 2022


labath marked 4 inline comments as done.
labath added a comment.

The behavior of the stop signals (SIGTTIN, SIGTTOU, SIGTSTP) is this:

- if the process has a signal handler, then the kernel picks an arbitrary thread (which does not have the signal blocked) to handle it. As far as the kernel is concerned, that's it. Everything else is up to the handler.
- if the process has no handler (and the signal is unblocked by at least one thread), then the _entire process_ goes to sleep

So, the answer to your question is: "thread which is running the signal handler" is "whichever is picked by the kernel". Its identity is not important. What's important is that the second signal gets delivered (not "handled", because at that point we have removed the handler) to the same thread, as that's the only one we're sure that will have it unblocked (although, in practice, all threads will probably have it unblocked).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120320/new/

https://reviews.llvm.org/D120320



More information about the lldb-commits mailing list