NetBSD Problem Report #52721
From www@NetBSD.org Sat Nov 11 07:57:49 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 23BA17A17C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 11 Nov 2017 07:57:49 +0000 (UTC)
Message-Id: <20171111075748.5001A7A208@mollari.NetBSD.org>
Date: Sat, 11 Nov 2017 07:57:48 +0000 (UTC)
From: eddie@cottongim.org
Reply-To: eddie@cottongim.org
To: gnats-bugs@NetBSD.org
Subject: ddb errors on ps command
X-Send-Pr-Version: www-1.0
>Number: 52721
>Category: port-sparc
>Synopsis: ddb errors on ps command
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-sparc-maintainer
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Nov 11 08:00:01 +0000 2017
>Closed-Date: Tue Jun 19 01:03:17 +0000 2018
>Last-Modified: Tue Jun 19 01:03:17 +0000 2018
>Originator: Eddie Cottongim
>Release: 7.1
>Organization:
>Environment:
NetBSD ss20 7.1 NetBSD 7.1 (GENERIC.201703111743Z) sparc
>Description:
The ddb "ps" command prints exceptions once the user tries to "q" quit, and it is not possible to exit this error loop.
The following is printed perhaps two dozen times:
Faulted in DDB, continuing...
trap type 0x7 pc=0xf000ab94 npc=f000abac pst=0x40400fc4<S,PS>
kernel: alignment fault trap
The addresses are the same in every printout.
Once in this state, "q" and space prints a "page" of these errors, and Enter prints just one.
It would appear that ps is printing one error every time it tries to print a process line.
This is a two processor machine, but I was running the generic, single processor kernel while producing this report. The behavior was the same when running a custom SMP kernel.
>How-To-Repeat:
Enter ddb (STOP+A on this SPARCStation 20)
Type ps
Type "q"
Errors printed, typing q, space, or return prints more errors.
No key seems to be able to exit this loop.
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->port-sparc-maintainer
Responsible-Changed-By: maya@NetBSD.org
Responsible-Changed-When: Fri, 24 Nov 2017 06:34:31 +0000
Responsible-Changed-Why:
This is probably a sparc problem. also reproduced on -current as of 2017-11-23
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-sparc/52721: ddb errors on ps command
Date: Fri, 24 Nov 2017 17:22:56 +0000
Judging by the 7.1 release GENERIC kernel and using objdump -d /netbsd
to find the faulting instruction, this is in longjmp, so the following
would be a reasonable backtrace:
longjmp: cmp %o2, %sp ! %sp must not decrease (this is f000abac, sparc/locore.s:6303)
db_error: longjmp(db_recover)
db_more:
if (quit_output) {
db_error(0);
/*NOTREACHED*/
State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Fri, 24 Nov 2017 19:58:06 +0000
State-Changed-Why:
mlelstv suggested the following change:
Index: sparc/locore.s
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/locore.s,v
retrieving revision 1.268
diff -u -r1.268 locore.s
--- sparc/locore.s 4 Nov 2012 00:32:47 -0000 1.268
+++ sparc/locore.s 24 Nov 2017 19:50:06 -0000
@@ -6288,8 +6288,9 @@
cmp %fp, %g7 ! compare against desired frame
bl,a 1b ! if below,
restore ! pop frame and loop
+ ld [%g1+0], %o2
be,a 2f ! if there,
- ldd [%g1+0], %o2 ! fetch return %sp and pc, and get out
+ ld [%g1+4], %o3 ! fetch return %sp and pc, and get out
Llongjmpbotch:
! otherwise, went too far; bomb out
for convenience, I've uploaded a -current kernel with it here: https://ftp.netbsd.org/pub/NetBSD/misc/maya/PR52721
md5: b997ab3ecc523fc7baccfe7003d7945f
Please test if it works.
From: Eddie Cottongim <jcotton@intergate.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: port-sparc/52721 (ddb errors on ps command)
Date: Fri, 24 Nov 2017 20:51:02 -0500
I tried the supplied kernel build on SPARCStation-20 hardware, on both
the "ps" and "dmesg" commands where it was faulting, and it now operates
correctly. Also audited the fix and it seems reasonable; ldd requires a
doubleword aligned address, which apparently was not the case most of
the time.
maya@NetBSD.org wrote:
> Synopsis: ddb errors on ps command
>
> State-Changed-From-To: open->feedback
> State-Changed-By: maya@NetBSD.org
> State-Changed-When: Fri, 24 Nov 2017 19:58:06 +0000
> State-Changed-Why:
> mlelstv suggested the following change:
> Index: sparc/locore.s
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/sparc/sparc/locore.s,v
> retrieving revision 1.268
> diff -u -r1.268 locore.s
> --- sparc/locore.s 4 Nov 2012 00:32:47 -0000 1.268
> +++ sparc/locore.s 24 Nov 2017 19:50:06 -0000
> @@ -6288,8 +6288,9 @@
> cmp %fp, %g7 ! compare against desired frame
> bl,a 1b ! if below,
> restore ! pop frame and loop
> + ld [%g1+0], %o2
> be,a 2f ! if there,
> - ldd [%g1+0], %o2 ! fetch return %sp and pc, and get out
> + ld [%g1+4], %o3 ! fetch return %sp and pc, and get out
>
> Llongjmpbotch:
> ! otherwise, went too far; bomb out
>
>
>
> for convenience, I've uploaded a -current kernel with it here: https://ftp.netbsd.org/pub/NetBSD/misc/maya/PR52721
> md5: b997ab3ecc523fc7baccfe7003d7945f
>
> Please test if it works.
>
>
>
>
>
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52721 CVS commit: src/sys/arch/sparc/sparc
Date: Sat, 25 Nov 2017 04:11:37 +0000
Module Name: src
Committed By: maya
Date: Sat Nov 25 04:11:37 UTC 2017
Modified Files:
src/sys/arch/sparc/sparc: locore.s
Log Message:
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/arch/sparc/sparc/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: feedback->needs-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 25 Nov 2017 04:46:15 +0000
State-Changed-Why:
pullup-8 #392, but also should be applied to -7 and further back
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52721 CVS commit: [netbsd-8] src/sys/arch/sparc/sparc
Date: Mon, 27 Nov 2017 10:31:33 +0000
Module Name: src
Committed By: martin
Date: Mon Nov 27 10:31:33 UTC 2017
Modified Files:
src/sys/arch/sparc/sparc [netbsd-8]: locore.s
Log Message:
Pull up following revision(s) (requested by maya in ticket #392):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.30.1 src/sys/arch/sparc/sparc/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52721 CVS commit: [netbsd-7-0] src/sys/arch/sparc/sparc
Date: Wed, 3 Jan 2018 20:06:02 +0000
Module Name: src
Committed By: snj
Date: Wed Jan 3 20:06:02 UTC 2018
Modified Files:
src/sys/arch/sparc/sparc [netbsd-7-0]: locore.s
Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.16.1 src/sys/arch/sparc/sparc/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52721 CVS commit: [netbsd-7-1] src/sys/arch/sparc/sparc
Date: Wed, 3 Jan 2018 20:06:04 +0000
Module Name: src
Committed By: snj
Date: Wed Jan 3 20:06:04 UTC 2018
Modified Files:
src/sys/arch/sparc/sparc [netbsd-7-1]: locore.s
Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.24.1 src/sys/arch/sparc/sparc/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52721 CVS commit: [netbsd-7] src/sys/arch/sparc/sparc
Date: Wed, 3 Jan 2018 20:06:06 +0000
Module Name: src
Committed By: snj
Date: Wed Jan 3 20:06:06 UTC 2018
Modified Files:
src/sys/arch/sparc/sparc [netbsd-7]: locore.s
Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.12.1 src/sys/arch/sparc/sparc/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52721 CVS commit: [netbsd-6] src/sys/arch/sparc/sparc
Date: Sat, 3 Mar 2018 20:47:24 +0000
Module Name: src
Committed By: snj
Date: Sat Mar 3 20:47:24 UTC 2018
Modified Files:
src/sys/arch/sparc/sparc [netbsd-6]: locore.s
Log Message:
Pull up following revision(s) (requested by maya in ticket #1513):
sys/arch/sparc/sparc/locore.s: 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.
To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.265.8.1 src/sys/arch/sparc/sparc/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: needs-pullups->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 01:03:17 +0000
State-Changed-Why:
Pullups complete, thanks for the report!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.