Message132672
| Author |
neologix |
| Recipients |
Arfrever, neologix, pitrou, vstinner |
| Date |
2011年03月31日.14:25:56 |
| SpamBayes Score |
2.1592193e-06 |
| Marked as misclassified |
No |
| Message-id |
<1301581557.75.0.913179913235.issue11727@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> There is something interesting in this output: the test uses a subprocess and we only have the traceback of the parent. It may be nice to have the trace of the child process. It might be possible by sending a signal to the child process (but how can we get the list of the child processes in a C signal handler?).
I don't think you can find that, but you could send a signal to the whole process group:
if (getpgrp() == getpid()) {
kill(-getpgrp(), <signal>);
}
The getpgrp() == getpid() makes sure that you'll only do that if the current process is the group leader (and it's async-safe). You'll probably want to block <signal> in the parent's handler first.
Note that it won't work if your child process calls setsid(), of course (start_new_session argument to Popen). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月31日 14:25:57 | neologix | set | recipients:
+ neologix, pitrou, vstinner, Arfrever |
| 2011年03月31日 14:25:57 | neologix | set | messageid: <1301581557.75.0.913179913235.issue11727@psf.upfronthosting.co.za> |
| 2011年03月31日 14:25:56 | neologix | link | issue11727 messages |
| 2011年03月31日 14:25:56 | neologix | create |
|