Description of problem: Running the frysk testsuite seems to produce ghost versions of TestRunner. Version-Release number of selected component (if applicable): [mwielaar@outgrabe ~]$ uname -a Linux outgrabe.boston.redhat.com 2.6.17-1.2519.4.9.el5 #1 SMP Wed Aug 23 11:17:45 EDT 2006 i686 i686 i386 GNU/Linux [mwielaar@outgrabe ~]$ rpm -qv frysk frysk-0.0.1.2006.07.25.rh1-4.fc6 This is also reproducable with frysk CVS with TestRunner as described in the external bug reference. How reproducible: Always. Steps to Reproduce: 1. $ /usr/libexec/frysk/funit frysk.sys.TestCallPtrace Actual results: [mwielaar@outgrabe frysk-obj]$ /usr/libexec/frysk/funit frysk.sys.TestCallPtrace Running testChildContinue(frysk.sys.TestCallPtrace) ...PASS Running testAttach(frysk.sys.TestCallPtrace) ...PASS Time: 0.036 OK (2 tests) [mwielaar@outgrabe frysk-obj]$ DETACHED PROCESS: EXITING FAIL junit.framework.AssertionFailedError Time: 5.045 There was 1 failure: 1) testAttach(frysk.sys.TestCallPtrace)junit.framework.AssertionFailedError at frysk.sys.TestCallPtrace.testAttach(funit) at frysk.junit.Runner.<init>(funit) at funit.main(funit) FAILURES!!! Tests run: 2, Failures: 1, Errors: 0 Expected results: Running testChildContinue(frysk.sys.TestCallPtrace) ...PASS Running testAttach(frysk.sys.TestCallPtrace) ...PASS Time: 0.036 OK (2 tests) Additional info: Note that it takes a little while before the "ghost" funit shows up. Afterwards ps x will show one or more <defunct> funit processes.
Downstream bug: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=203902
Mike, This code has a few problems: /* Create a dummy process to attach to */ jint frysk::sys::TestLib::forkIt () { jint pid; if ((pid = fork()) < 0) { perror("Error: could not fork child process"); exit(1); } else if (pid == 0) { /* Child */ sleep(5); printf("DETACHED PROCESS: EXITING\n"); } return pid; } - if ((pid = fork ())...) assignment in if() violates GNU coding standards, and is accepted as just making the code harder to read - the printf, shouldn't - tests shouldn't use printf - the perror shouldn't - have a look at other cni/ files, they throw an error - the child doesn't exit, instead returning - which is why there's a shadow fork (reason one :-) - the code using this can't be killing off the child during tearDown - the shadow fork reason two? Perhaps restructure this to use a switch: pid = fork (); switch (pid) { case -1: throw exceptioni; case 0: sleep (...); exit (0); default: return pid;
Already reported as bug #3121 *** This bug has been marked as a duplicate of 3121 ***