Bug 3486

Summary: testCloneThenKillAttached(frysk.proc.TestProcTasksObserver)junit.framework.AssertionFailedError: event loop run explictly stopped (clone then kill 2)
Product: frysk Reporter: Andrew Cagney <cagney>
Component: generalAssignee: Andrew Cagney <cagney>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on: 3487, 4271    
Bug Blocks: 1582, 3385, 2654    

Description Andrew Cagney 2006-11-08 18:14:55 UTC
testCloneThenKillAttached(frysk.proc.TestProcTasksObserver)junit.framework.AssertionFailedError:
event loop run explictly stopped (clone then kill 2)
   at frysk.proc.TestLib.assertRunUntilStop(TestRunner)
   at frysk.proc.TestLib.assertRunUntilStop(TestRunner)
   at frysk.proc.TestProcTasksObserver.cloneThenKill(TestRunner)
   at frysk.proc.TestProcTasksObserver.testCloneThenKillAttached(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
Comment 1 Andrew Cagney 2006-11-26 21:27:14 UTC
This is a utrace bug, block on FC 6, not FC 5.
Comment 2 Andrew Cagney 2006-12-05 05:42:37 UTC
The non-main task's exited waitpid status gets lost.  In the below, the exiting
status is seen but nothing further.

1998.1999: received signal 7 (Bus error)
1998.1999: exit this thread
5-Dec-06 12:23:35 AM frysk.proc.LinuxHost$PollWaitOnSigChld execute
FINE: {frysk.proc.LinuxHost$PollWaitOnSigChld@1dcc60,sig=Sig_CHLD} execute

5-Dec-06 12:23:35 AM frysk.sys.Wait waitAllNoHang
FINE: frysk.sys.Wait pid 1999 status 0x6057f WIFSTOPPED/EXIT 5 (Trace/breakpoint
trap)

5-Dec-06 12:23:35 AM frysk.sys.Wait waitAllNoHang
FINE: frysk.sys.Wait pid 0 errno 0 (Success)

5-Dec-06 12:23:35 AM frysk.proc.LinuxHost$PollWaitOnSigChld$5 getTask
FINE: {TaskId,1999} exitEvent

5-Dec-06 12:23:35 AM frysk.proc.Host get
FINE: {frysk.proc.LinuxHost@13a0c0,state=running} get TaskId

5-Dec-06 12:23:35 AM frysk.proc.TaskState$Running handleTerminatingEvent
FINE: {frysk.proc.LinuxTask@20be70,pid=1998,tid=1999,state=running}
handleTerminatingEvent

5-Dec-06 12:23:35 AM frysk.proc.LinuxTask sendContinue
FINE: {frysk.proc.LinuxTask@20be70,pid=1998,tid=1999,state=running} sendContinue

5-Dec-06 12:23:35 AM frysk.proc.LinuxHost$PollWaitOnSigChld execute
FINE: {frysk.proc.LinuxHost$PollWaitOnSigChld@1dcc60,sig=Sig_CHLD} execute

5-Dec-06 12:23:35 AM frysk.sys.Wait waitAllNoHang
FINE: frysk.sys.Wait pid 0 errno 0 (Success)

5-Dec-06 12:23:40 AM frysk.event.EventLoop$2$Timeout execute
FINE:
{{frysk.event.EventLoop$2$Timeout@28ded8,timeMillis=1165296220425,periodMillis=0},expiredfalse}
execute

Comment 3 Andrew Cagney 2006-12-05 05:47:25 UTC
Downstream bug:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218410
Comment 4 Andrew Cagney 2006-12-05 05:54:27 UTC
*** Bug 3487 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Cagney 2007-02-08 22:50:51 UTC
Index: frysk-imports/tests/ChangeLog
2007-02-08  Andrew Cagney  <cagney@redhat.com>

	* frysk3486/waitpid-masked-sigchld.c: New file.
	* Makefile.am (systests_PASS_PROGRAM): Add
	frysk3486/waitpid-masked-sigchild.

This test shows how SIGCHLD remains pending after all waitpid events have been
cleared.  At least for 2.6.18-1.2257.fc5.
Comment 6 Andrew Cagney 2007-04-09 19:10:47 UTC
The event-loop has been rewritten to block in waitpid and hence avoid this problem.

Index: frysk-core/frysk/proc/ChangeLog
2007-04-09  Andrew Cagney  <cagney@redhat.com>

        * TestProcTasksObserver.java (testCloneThenKillAttached)
        (testDeleteAttached): Remove brokenIfUtraceXXX due to 3486.
        * Manager.java (usePoll): Set to false, enable WaitEventLoop.

Index: frysk-imports/frysk/sys/ChangeLog
2007-04-09  Andrew Cagney  <cagney@redhat.com>

        * cni/Wait.cxx (log): Add "logger" parameter, update calls.
        (waitForEvent): Delete.
        (waitAll): Use "log".  Replace loop calling waitForEvent with
        multiple waitpid calls.