Bug 4747 - frysk.rt.TestUpdatingDisplayValue java.lang.IllegalStateException: Already stepping
Summary: frysk.rt.TestUpdatingDisplayValue java.lang.IllegalStateException: Already st...
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 4847
  Show dependency treegraph
 
Reported: 2007-07-06 11:04 UTC by Mark Wielaard
Modified: 2007-08-15 11:06 UTC (History)
2 users (show)

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


Attachments
fhpd session showing the bug (797 bytes, text/plain)
2007-07-18 13:48 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2007-07-06 11:04:02 UTC
The following doesn't always happen, but it should never happen. The
"IllegalStateException: Already stepping" exception is thrown as an internal
sanity check that clearly failed in this case and that should never be triggered
 even in the worst situations.

$ ./TestRunner frysk.rt.TestUpdatingDisplayValue
Running testTaskStopped(frysk.rt.TestUpdatingDisplayValue) ...PASS
Running testValueChanged(frysk.rt.TestUpdatingDisplayValue) ...PASS
Running testFuncReturn(frysk.rt.TestUpdatingDisplayValue) ...PASS
Running testExceptionThrown(frysk.rt.TestUpdatingDisplayValue) ...UNRESOLVED
  http://sourceware.org/bugzilla/show_bug.cgi?id=4639
Running testLongjmp(frysk.rt.TestUpdatingDisplayValue) ...PASS
Running testTaskDead(frysk.rt.TestUpdatingDisplayValue) ...PASS
Running testDisabled(frysk.rt.TestUpdatingDisplayValue) ...ERROR
  java.lang.IllegalStateException: Already stepping
Running testEnabledExprUnavailable(frysk.rt.TestUpdatingDisplayValue) ...ERROR
  java.lang.IllegalStateException: Already stepping

Time: 0.446
There were 1 unresolved:
  http://sourceware.org/bugzilla/show_bug.cgi?id=4639
There were 2 errors:
1)
testDisabled(frysk.rt.TestUpdatingDisplayValue)java.lang.IllegalStateException:
Already stepping
   at frysk.proc.Breakpoint.prepareStep(TestRunner)
   at frysk.proc.live.LinuxTaskState$Running.sendContinue(TestRunner)
   at frysk.proc.live.LinuxTaskState$Running.handleStoppedEvent(TestRunner)
   at frysk.proc.live.LinuxTask.processStoppedEvent(TestRunner)
   at frysk.proc.live.LinuxWaitBuilder.stopped(TestRunner)
   at frysk.sys.Wait.wait(TestRunner)
   at frysk.sys.Wait.waitAll(TestRunner)
   at frysk.event.WaitEventLoop.block(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.rt.TestUpdatingDisplayValue.testDisabled(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
2)
testEnabledExprUnavailable(frysk.rt.TestUpdatingDisplayValue)java.lang.IllegalStateException:
Already stepping
   at frysk.proc.Breakpoint.prepareStep(TestRunner)
   at frysk.proc.live.LinuxTaskState$Running.sendContinue(TestRunner)
   at frysk.proc.live.LinuxTaskState$Running.handleStoppedEvent(TestRunner)
   at frysk.proc.live.LinuxTask.processStoppedEvent(TestRunner)
   at frysk.proc.live.LinuxWaitBuilder.stopped(TestRunner)
   at frysk.sys.Wait.wait(TestRunner)
   at frysk.sys.Wait.waitAll(TestRunner)
   at frysk.event.WaitEventLoop.block(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.rt.TestUpdatingDisplayValue.testEnabledExprUnavailable(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)

FAILURES!!!
Tests run: 8,  Failures: 0,  Errors: 2

Failed after run #0
Comment 1 Mark Wielaard 2007-07-16 11:15:35 UTC
I am unable to reproduce this, although I have seen it in the past happen.
Please add a note to this if you are seeing this happen.

On x86_64 (FC6) I can run ./TestRunner -r 1000 frysk.rt.TestUpdatingDisplayValue
and not get any failure at all.

If I do the same on x86 (F7) then I do after some runs I almost always get:

There were 4 failures:
1)
testFuncReturn(frysk.rt.TestUpdatingDisplayValue)junit.framework.AssertionFailedError:
Display is not available
   at frysk.rt.TestUpdatingDisplayValue.testFuncReturn(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
2)
testLongjmp(frysk.rt.TestUpdatingDisplayValue)junit.framework.AssertionFailedError:
Display is not available
   at frysk.rt.TestUpdatingDisplayValue.testLongjmp(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
3)
testTaskDead(frysk.rt.TestUpdatingDisplayValue)junit.framework.AssertionFailedError:
Display is not available
   at frysk.rt.TestUpdatingDisplayValue.testTaskDead(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
4)
testEnabledExprUnavailable(frysk.rt.TestUpdatingDisplayValue)junit.framework.AssertionFailedError:
Display is not available
   at frysk.rt.TestUpdatingDisplayValue.testEnabledExprUnavailable(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)

But never the original reported failure. Maybe this new failure is hiding the
original?
Comment 2 Mark Wielaard 2007-07-18 13:48:44 UTC
Created attachment 1919 [details]
fhpd session showing the bug
Comment 3 Mark Wielaard 2007-07-24 10:31:14 UTC
(In reply to comment #2)
> Created an attachment (id=1919)
> fhpd session showing the bug

The session was on a Fedora 7, x86 machine. Trying to reproduce it on Fedora
Core 6, x86_64 doesn't produce the bug.
Comment 4 Mark Wielaard 2007-07-24 10:56:59 UTC
(In reply to comment #1)
> I am unable to reproduce this, although I have seen it in the past happen.
> Please add a note to this if you are seeing this happen.
> 
> On x86_64 (FC6) I can run ./TestRunner -r 1000 frysk.rt.TestUpdatingDisplayValue
> and not get any failure at all.
> 
> If I do the same on x86 (F7) then I do after some runs I almost always get:
> 
> There were 4 failures:

Confirmed this is still an issue on x86 (F7), but not reproducable on x86_64
(FC6). Although it now isn't always 4 failures, most of the time it is just one
failure (but sometimes all of the above).
Comment 5 Mark Wielaard 2007-07-24 11:23:53 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Created an attachment (id=1919)
> > fhpd session showing the bug
> 
> The session was on a Fedora 7, x86 machine. Trying to reproduce it on Fedora
> Core 6, x86_64 doesn't produce the bug.

Also not reproducable on x86 F7 even though that machine was used for the demo
from which the attached session comes. sigh.
Comment 6 Mark Wielaard 2007-07-24 11:46:12 UTC
OK finally reproduced by:

$ frysk/bindir/fhpd frysk/pkglibdir/funit-rt-varchange
Attached to process 404
(fhpd) break @funit-rt-varchange.c@50
breakpoint 0
(fhpd) go
(fhpd) Breakpoint 0 @funit-rt-varchange.c@50

- Now externally from fhpd: $ kill 404

And back in fhpd do a go, which will result in:

(fhpd) Exception in thread "Thread-1" java.lang.IllegalStateException: Already
stepping
   at frysk.proc.Breakpoint.prepareStep(fhpd)
   at frysk.proc.live.LinuxTaskState$Running.sendContinue(fhpd)
   at frysk.proc.live.LinuxTaskState$Running.handleSignaledEvent(fhpd)
   at frysk.proc.live.LinuxTask.processSignaledEvent(fhpd)
   at frysk.proc.live.LinuxWaitBuilder.stopped(fhpd)
   at frysk.sys.Wait.wait(fhpd)
   at frysk.sys.Wait.waitAll(fhpd)
   at frysk.event.WaitEventLoop.block(fhpd)
   at frysk.event.EventLoop.runEventLoop(fhpd)
   at frysk.event.EventLoop.run(fhpd)
Comment 7 Andrew Cagney 2007-07-26 17:52:30 UTC
Given this assembler:

     LOAD_IMMED(REG0,0)
here:
     LOAD(REG0,REG0)

set a breakpoint at "here" and then try to step off it.  Should result in a
signaled notification with everything looking like it is still at "here".
Comment 8 Mark Wielaard 2007-08-10 11:22:29 UTC
New testcase added frysk.proc.TestTaskObserverCode.testCodeSignalInterrupt
Comment 9 Mark Wielaard 2007-08-15 11:06:51 UTC
Fixed by:

frysk-core/frysk/proc/ChangeLog
2007-08-15  Mark Wielaard  <mwielaard@redhat.com>
 
    * getSetupAddress (getSetupAddress): New method.
    (stepAbort): Likewise.
    * TestTaskObserverCode.java (testCodeSignalInterrupt): Enable test.
    (testInstallCodeDuringCode): Likewise.
    (Symbol): New static helper class.
    (getGlobalLabelAddress): New helper method.
    (breakTest): New test harness for funit-raise.
    (testBreakDivZero): New test based on breakTest.
    (testBreakIllegalAddress): Likewise.
    (testBreakIllegalInstruction): Likewise.
    (testBreakSignalTerminate): Likewise.
    (testBreakSignalIgnore): Likewise.
    (AttachedObserver.task): New field.
    (updateAttached): Set task field.
    (TerminatingObserver.task): New field.
    (TerminatingObserver.signal): Likewise.
    (TerminatingObserver.value): Likewise.
    (TerminatingObserver.updateTerminating): Set new fields.

frysk-core/frysk/proc/live/ChangeLog
2007-08-15  Mark Wielaard  <mwielaard@redhat.com>

    * LinuxTaskState.java (Stepping.handleTrappedpEvent): Always check
    steppingBreakpoint.
    (checkBreakpointStepping): New helper method.
    (handleSignaledEvent): Use checkBreakpointStepping before
    continuing.
    (handleStoppedEvent): Likewise.

frysk-core/frysk/pkglibdir/ChangeLog
2007-08-15  Mark Wielaard  <mwielaard@redhat.com>

    * funit-raise.S: New test.