Bug 4107

Summary: TestRunner is leaking file descriptors
Product: frysk Reporter: Mike Cvet <mcvet>
Component: generalAssignee: Unassigned <frysk-bugzilla>
Status: NEW ---    
Severity: normal CC: mcvet
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 2234, 4103    

Description Mike Cvet 2007-02-27 22:13:00 UTC
$ ./TestRunner -r 100 frysk.rt.TestStepping

Running testASMStepping(frysk.rt.TestStepping) ...
execvp: Too many open files
ERROR
  java.lang.NullPointerException

When cntl-Z'ing TestRunner during its execution, and taking a look through the 
output of lsof, there are thousands of open files belonging to TestRunner which 
hasn't properly quit after the test failure.
Comment 1 Rick Moseley 2007-02-27 22:26:42 UTC
The limit on my FC5/i686 box for the file descriptors for TestRunner is about
1042 and then it aborts.  When I run the command Mike shows I see a couple of
processes running: TestRunner and funit-rt-asmstepper.  Running the "lsof"
command while running those, funit-rt-asmstepper appears to never open any
files.  If I run the "lsof" command on TestRunner I see the file descriptors run
up pretty quickly until the test aborts when it reaches ~1042 fd's.

Now, the weird thing is, when the test aborts, TestRunner remains in the cpu
queue but it now has a *totally* PID.  Doing a "lsof" on that shows about 1042
fd's open.  Looking at /proc/TESTRUNNERPID/fd and doing a list I see lines and
lines of this:

lr-x------ 1 rmoseley rmoseley 64 Feb 27 16:06 110 ->
/home/rmoseley/frysk-cvs3/build/frysk-core/frysk/pkglibdir/funit-rt-asmstepper


It seems nearly all the fd's are pointing to the funit-rt-asmstepper executable.
 Why would the TestRunner be repeatedly opening a fd pointing to the executable?
Comment 2 Rick Moseley 2007-02-28 14:13:44 UTC
In the previous comment I meant to say "*totally different PID" instead of
"*totally PID".  That is, the TestRunner PID had changed from its original PID
when it was running funit-rt-asmstepper.  But, the new TestRunner inherited the
fd's of the original TestRunner.