Message132672
> 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). |
|
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 | |
|