From: Raghuveer R <raghuveer@in...> - 2007-02-20 12:35:38
hangs when run under strace -f.
In the testcase, the parent sets an alarm for itself and forks; the
children do some renaming activity while the parent 'wait()'s. When the
alarm fires, the parent sends SIGTERM to its children. Everything ends
well in a normal run.
But when we run the strace tests, the testcase hangs. This is because,
the parent does not receive any signals (including SIGALRM) while doing
the wait() when run under strace -f (As per the man page). The parent
never returns form wait(), the handlers are not run, SIGTERM is never
sent to the children...
The culprit here is the wait() call the parent uses in order to wait for
SIGALRM. Please note that both children are running in infinite loops
and the only way for the parent to return from wait() is when the alarm
fires. If *not* running under strace -f, it returns form wait() when a
signal is sent to it, not otherwise.
The following patch replaces the wait() with pause() to resolve the
Signed-off-by: Raghuveer R (raghuveer@...)
--- testcases/kernel/syscalls/rename/rename14.c 2006-12-23 10:30:29.000000000 +0530
+++ testcases/kernel/syscalls/rename/rename14-new.c 2007-02-08 11:47:07.000000000 +0530
@@ -144,9 +144,9 @@ int main (argc, argv)
- /* Collect child processes. */
+ /* Wait for timeout */
- (void) wait(&status);