NetBSD Problem Report #25515

Received: (qmail 1898 invoked by uid 605); 9 May 2004 17:25:45 -0000
Message-Id: <20040509172544.7AFEC11153@narn.netbsd.org>
Date: Sun,  9 May 2004 17:25:44 +0000 (UTC)
From: cagney@mac.com
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: cagney@mac.com
To: gnats-bugs@gnats.NetBSD.org
Subject: Can't single-step out of a signal trampoline
X-Send-Pr-Version: www-1.0

>Number:         25515
>Category:       port-powerpc
>Synopsis:       Can't single-step out of a signal trampoline
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-powerpc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 09 17:26:00 +0000 2004
>Closed-Date:    
>Last-Modified:  Fri Nov 20 10:25:44 +0000 2020
>Originator:     Andrew Cagney
>Release:        1.6.2
>Organization:
>Environment:
PPC
>Description:
(gdb) stepi
<signal handler called>
1: x/i $pc  0x7fffefe4: sc
(gdb) stepi

Program exited normally.
(gdb) KFAIL: gdb.base/sigstep.exp: stepi out of signal trampoline (program exited)

It is thought that the single-step request isn't propogated through the sigreturn syscall.

>How-To-Repeat:
See above

>Fix:

>Release-Note:
>Audit-Trail:

From: Andrew Cagney <cagney@mac.com>
To: gnats-bugs@NetBSD.org
Cc:  
Subject: Re: kern/25515
Date: Sun, 20 Jun 2004 21:36:31 -0400

 This is a multi-part message in MIME format.
 --------------080706050803020300010405
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit

 Environment: probably all

 --------------080706050803020300010405
 Content-Type: text/plain;
  name="diffs"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="diffs"

 Index: sig_machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/sig_machdep.c,v
 retrieving revision 1.5
 diff -p -u -r1.5 sig_machdep.c
 --- sig_machdep.c	28 May 2001 00:12:21 -0000	1.5
 +++ sig_machdep.c	21 Jun 2004 00:56:41 -0000
 @@ -132,6 +132,7 @@ sys___sigreturn14(p, v, retval)
  	struct sigcontext sc;
  	struct trapframe *tf;
  	int error;
 +	register_t sstep;

  	/*
  	 * The trampoline hands us the context.
 @@ -145,7 +146,10 @@ sys___sigreturn14(p, v, retval)
  	tf = trapframe(p);
  	if ((sc.sc_frame.srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC))
  		return (EINVAL);
 +	sstep = (tf->srr1 & PSL_SE);
  	*tf = sc.sc_frame;
 +	/* Propogate the single-step bit.  */
 +	tf->srr1 = (tf->srr1 & ~PSL_SE) | sstep;

  	/* Restore signal stack. */
  	if (sc.sc_onstack & SS_ONSTACK)
 Index: trap.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/trap.c,v
 retrieving revision 1.59
 diff -p -u -r1.59 trap.c
 --- trap.c	19 May 2002 06:35:45 -0000	1.59
 +++ trap.c	21 Jun 2004 00:56:41 -0000
 @@ -314,6 +314,13 @@ syscall_bad:
  				break;
  			}

 +			/* Single stepped the system-call, stop
 +			   immediatly.  */
 +			if (frame->srr1 & PSL_SE) {
 +			  frame->srr1 &= ~PSL_SE;
 +			  trapsignal(p, SIGTRAP, EXC_TRC);
 +			}
 +
  #ifdef	KTRACE
  			if (KTRPOINT(p, KTR_SYSRET))
  				ktrsysret(p, code, error, rval[0]);

 --------------080706050803020300010405--

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 13 Jul 2014 03:15:40 +0000
State-Changed-Why:
Is this still relevant?


Responsible-Changed-From-To: kern-bug-people->port-powerpc-maintainer
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Mon, 13 Oct 2014 20:09:03 +0000
Responsible-Changed-Why:
appears to have to do with PPC trap handling code


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 13 Oct 2014 20:09:03 +0000
State-Changed-Why:
Feedback mail bounced.
(this PR is now "stuck", so if anyone knows whether it's still relevant
or has any other info about it, please write in)


Responsible-Changed-From-To: port-powerpc-maintainer->kamil
Responsible-Changed-By: kamil@NetBSD.org
Responsible-Changed-When: Sat, 07 Oct 2017 14:50:12 +0200
Responsible-Changed-Why:
Take.


Responsible-Changed-From-To: kamil->port-powerpc-maintainer
Responsible-Changed-By: kamil@NetBSD.org
Responsible-Changed-When: Fri, 20 Nov 2020 11:25:44 +0100
Responsible-Changed-Why:
Reassign to port-powerpc-maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.