Bug 3600 - Manager.host.requestFindProc with refreshAll set to true, fails with an NPE on process not found
Summary: Manager.host.requestFindProc with refreshAll set to true, fails with an NPE o...
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Nurdin Premji
URL:
Keywords:
Depends on:
Blocks: 1582
  Show dependency treegraph
 
Reported: 2006-11-27 18:42 UTC by Phil Muldoon
Modified: 2006-12-01 21:16 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Muldoon 2006-11-27 18:42:59 UTC
In this implementation:

Manager.host.requestFindProc(true, new ProcId (pid), new Host.FindProc()

if pid is pointing to a non-existant process (ie 0) the requestFindProc fails with:

java.lang.NullPointerException
   at frysk.proc.LinuxHost.sendRefresh(TestRunner)
   at frysk.proc.HostState$1.handleRefresh(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.TestFindProc.testFindFailed(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)

However if the refreshAll flag is set to false, it passes.

In all cases, however, it should always call the callback:

public void procNotFound (ProcId procId, Exception e)

as defined in the interface contract
Comment 1 Andrew Cagney 2006-11-27 18:58:05 UTC
Is the threads? parameter even necessary?  Instead, always add threads?
Comment 2 Nurdin Premji 2006-11-27 20:19:52 UTC
2006-11-27
        frysk-core/frysk/proc/CL
        * TestFindProc.java (testFindAndRefreshFailed): Added, checks for bug 3600.
        * LinuxHost.java (sendRefresh): Changed to throw procNotFound earlier.
Fixes bug 3600.
        * TestLib (findProcUsingRefresh.procNotFound): Changed to throw a fail.
Comment 3 Nurdin Premji 2006-12-01 21:16:08 UTC
See comment 2