Bug 3080 - errors in JUnit tests in frysk-core (libelf problem?)
Summary: errors in JUnit tests in frysk-core (libelf problem?)
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Tim Moore
URL:
Keywords:
: 3081 (view as bug list)
Depends on:
Blocks: 1553
  Show dependency treegraph
 
Reported: 2006-08-17 10:04 UTC by Stepan Kasal
Modified: 2006-08-21 12:18 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
the change (360 bytes, patch)
2006-08-21 08:54 UTC, Stepan Kasal
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stepan Kasal 2006-08-17 10:04:52 UTC
There is a dozen of errors when running JUnit tests under frysk-core.  They all
look similar; here is a typical example:

8)
testCreateAttachedContinuedProc(frysk.proc.TestRun)java.lang.RuntimeException:
got TaskException
   at frysk.proc.LinuxHost.sendCreateAttachedProc(TestRunner)
   at frysk.proc.HostState$1.handleCreateAttachedProc(TestRunner)
   at frysk.proc.Host$2.execute(TestRunner)
   at frysk.event.EventLoop.runEventLoop(TestRunner)
   at frysk.event.EventLoop.runPolling(TestRunner)
   at frysk.proc.TestLib.assertRunUntilStop(TestRunner)
   at frysk.proc.TestLib.assertRunUntilStop(TestRunner)
   at frysk.proc.TestRun.testCreateAttachedContinuedProc(TestRunner)
   at frysk.junit.Runner.<init>(TestRunner)
   at TestRunner.main(TestRunner)
Caused by: frysk.proc.TaskFileException: Could not open /proc/17045/exe for reading
   at frysk.proc.IsaFactory.getIsa(TestRunner)
   at frysk.proc.IsaFactory.getIsa(TestRunner)
   at frysk.proc.LinuxTask.sendrecIsa(TestRunner)
   at frysk.proc.Task.getIsa(TestRunner)
   at frysk.proc.LinuxTask.setupMapsXXX(TestRunner)
   at frysk.proc.LinuxTask.<init>(TestRunner)
   at frysk.proc.LinuxHost.sendCreateAttachedProc(TestRunner)
   ...22 more
Caused by: lib.elf.ElfFileException: Could not open /proc/17045/exe for reading
   at lib.elf.Elf.elf_begin(TestRunner)
   at lib.elf.Elf.<init>(TestRunner)
   at frysk.proc.IsaFactory.getIsa(TestRunner)
   ...28 more
Comment 1 Mark Wielaard 2006-08-18 15:27:52 UTC
This is caused by:
http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/proc/LinuxHost.java.diff?cvsroot=frysk&r1=1.54&r2=1.55

        2006-08-16  Tim Moore  <timoore@redhat.com>
        
        [...]
        
        * LinuxHost.java (sendCreateAttachedProc,
        PollWaitOnSigChld.anonymous.cloneEvent,
        PollWaitOnSigChld.anonymous.forkEvent): Rethrow TaskException as
        RuntimeException instead of eating it.

Which I guess is a reasonable thing to do, but does break this testcase.

Tim, could you take a look?
Comment 2 Stepan Kasal 2006-08-21 08:54:00 UTC
Created attachment 1235 [details]
the change

This patch is the reversed version of the change which caused the bug.
I verified that applying it ``fixes'' (or covers?) the bug.

But I have no reason to belive that this is the way to go.
This is not a proposed patch, it is just an exhibit illustrating the Mark's
analysis.
Comment 3 Wu Zhou 2006-08-21 10:39:12 UTC
The symptom is the same as what I reported in 3081.

What is the final solution?  I noticed there is no exception handling afer
applying the above patch.
Comment 5 Stepan Kasal 2006-08-21 10:56:28 UTC
*** Bug 3081 has been marked as a duplicate of this bug. ***
Comment 6 Stepan Kasal 2006-08-21 12:18:28 UTC
I have verified that the bug is indeed fixed.  Thanks.