From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26304 invoked by alias); 29 Apr 2008 23:02:11 -0000 Received: (qmail 26288 invoked by uid 22791); 29 Apr 2008 23:02:09 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 Apr 2008 23:01:52 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m3TN1oMe002585 for ; Tue, 29 Apr 2008 19:01:50 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3TN1oi7005133; Tue, 29 Apr 2008 19:01:50 -0400 Received: from localhost.localdomain (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3TN1n4D018777; Tue, 29 Apr 2008 19:01:50 -0400 Message-ID: <4817A90D.2010209@redhat.com> Date: Wed, 30 Apr 2008 03:06:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Nurdin Premji CC: frysk Subject: Re: Stepping over signals, in state "detaching" did not handle handleStoppedEvent SIGTRAP(5) References: <481767EA.6050204@redhat.com> In-Reply-To: <481767EA.6050204@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00067.txt.bz2 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