From: Heiko C. <hei...@de...> - 2005-01-17 13:16:08
|
Hi all again, the following piece of code lets strace hang when traced with the follow-fork option. #include <signal.h> #include <wait.h> #include <sys/types.h> pid_t child; void al(int sig) { kill (child, SIGTERM); } int main (int argc, char **argv) { int pid, status; child = fork(); if (child == 0) pause(); else { signal (SIGALRM, al); alarm(5); wait(0); } } Reason for the hang is that strace sets the TCB_SUSPENDED flag in internal_wait and therefore the task's state doesnt change from TASK_TRACED. When finally the alarm signal gets delivered to the parent it will just have another signal pending but the kernel won't wake it up due to its state. And then things won't continue. A quick solution would be to not set the TCB_SUSPENDED flag in this case as well, but for sure it would break all the other cases where this flag would be needed. Roland, considering the changelog you fixed a lot of stuff already in internal_wait. Do you have any idea how to fix this one without breaking anything else? Thanks, Heiko |