public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: Nurdin Premji <npremji@redhat.com>
Cc: frysk <frysk@sources.redhat.com>
Subject: Re: Stepping over signals, in state "detaching" did not handle handleStoppedEvent   SIGTRAP(5)
Date: Wed, 30 Apr 2008 03:06:00 -0000	[thread overview]
Message-ID: <4817A90D.2010209@redhat.com> (raw)
In-Reply-To: <481767EA.6050204@redhat.com>

I suspect that this:

         //    System.err.println("BreakPoint.addedTo");
-        ((Task) observable).requestDeleteInstructionObserver(this.steppingEngine.getSteppingObserver());
+        Task task = (Task) observable;
+        this.steppingEngine.requestRemoveSteppingObserver(task); 

is likely at least part of the problem - I see it's also pre-existing code.  Breakpoints shouldn't be rooting around in the stepping engine.  

+    
+    public void stepOverSignal(Task task) {
+	DebugInfoFrame frame = DebugInfoStackFactory
+	    .createDebugInfoStackTrace(task);
+	
+	long address = frame.getAddress();
+
+	fine.log(this, "Looking for address: 0x", Long.toHexString(address), "Line #: ", frame.getLine().getLine());
+	
+	TaskStepEngine tse = (TaskStepEngine) this.taskStateMap.get(task);
+	tse.setState(new StepOutState(task));
+	this.steppingObserver.notifyNotBlocked(tse);
+
+	int i = ((Integer) this.contextMap.get(task.getProc())).intValue();
+	this.contextMap.put(task.getProc(), new Integer(++i));

what I believe is happening is that this code:
+
+	this.breakpoint = new SteppingBreakpoint(this, address);

is removing the stepping-engine's observer before this:

+	this.breakpointMap.put(task, this.breakpoint);
+	task.requestAddCodeObserver(this.breakpoint, address);

has had a chance to install the breakpoint.

A better sequence is:

-> create breakpoint
-> request add breakpoint
-> request remove stepping observer


I believe Teresa was also looking at this.

Andrew

PS: Can the test-case be changed to assembler?  As C it is going to run into portability problems.


+    }



Nurdin Premji wrote:
> Here is current work on stepping over a signal, the race condition 
> involved is:
> inside frysk-core:
>
> ./TestRunner -debug frysk.stepping.SteppingEngine=FINE 
> frysk.stepping.TestStepping.testStepOverSignal
>
> There was 1 error:
> 1) 
> testStepOverSignal(frysk.stepping.TestStepping)java.lang.RuntimeException: 
> {frysk.proc.live.LinuxPtraceTask@327b6455,pid=29497,tid=29497,state=detaching} 
> in state "detaching" did not handle handleStoppedEvent SIGTRAP(5)
>   at frysk.proc.live.State.unhandled(TestRunner)
>   at 
> frysk.proc.live.LinuxPtraceTaskState$2.handleStoppedEvent(TestRunner)
>   at frysk.proc.live.LinuxPtraceTask.processStoppedEvent(TestRunner)
>   at frysk.proc.live.LinuxWaitBuilder.stopped(TestRunner)
>   at frysk.sys.Wait.wait(TestRunner)
>   at frysk.sys.Wait.wait(TestRunner)
>   at frysk.event.WaitEventLoop.block(TestRunner)
>   at frysk.event.EventLoop.runEventLoop(TestRunner)
>   at frysk.event.EventLoop.runPolling(TestRunner)
>   at frysk.testbed.TestLib.assertRunUntilStop(TestRunner)
>   at frysk.testbed.TestLib.assertRunUntilStop(TestRunner)
>   at frysk.stepping.TestStepping.testStepOverSignal(TestRunner)
>   at frysk.junit.Runner.runCases(TestRunner)
>   at frysk.junit.Runner.runTestCases(TestRunner)
>   at TestRunner.main(TestRunner)
>
>
> happens quite frequently but every once in a while get a pass

      reply	other threads:[~2008-04-29 23:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 23:02 Nurdin Premji
2008-04-30  3:06 ` Andrew Cagney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4817A90D.2010209@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sources.redhat.com \
    --cc=npremji@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).