NetBSD Problem Report #57007

From ryo_on@yk.rim.or.jp  Mon Sep 12 19:33:42 2022
Return-Path: <ryo_on@yk.rim.or.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 4801F1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 12 Sep 2022 19:33:42 +0000 (UTC)
Message-Id: <4MRF9l11Ypz67s4@mail.SiriusCloud.jp>
Date: Tue, 13 Sep 2022 03:14:32 +0900
From: ryoon@NetBSD.org
Reply-To: ryoon@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very unstable
X-Send-Pr-Version: 3.95

>Number:         57007
>Category:       kern
>Synopsis:       NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very unstable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    knakahara
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 12 19:35:00 +0000 2022
>Closed-Date:    Wed Sep 14 01:31:34 +0000 2022
>Last-Modified:  Wed Sep 14 01:31:34 +0000 2022
>Originator:     Ryo ONODERA
>Release:        NetBSD 9.99.99
>Organization:
Ryo ONODERA // ryo@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
>Environment:


System: NetBSD brownie 9.99.99 NetBSD 9.99.99 (DTRACE8) #9: Mon Sep 12 12:30:43 JST 2022 ryoon@brownie:/usr/world/9.99/amd64/obj/sys/arch/amd64/compile/DTRACE8 amd64
Architecture: x86_64
Machine: amd64
>Description:
After this commit
https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
NetBSD/amd64 under HP Envy 13 ay1000 (AMD Ryzen 7 5800U) panics.
In some case, I cannot get kernel coredumps.
The backtraces from crash(8) are as follows.

$ crash -M netbsd.16.core -N netbsd.16
Crash version 9.99.99, image version 9.99.99.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: trap
Backtrace from time of crash is available.
crash> bt
__kernel_end() at 0
kern_reboot() at sys_reboot
vpanic() at vpanic+0x18d
panic() at vprintf
trap() at startlwp
--- trap (number 6) ---
copyin() at copyin+0x2f
ubc_uiomove() at ubc_uiomove+0x104
ffs_write() at ffs_write+0x265
VOP_WRITE() at VOP_WRITE+0xa6
vn_write() at vn_write+0x10e
dofilewrite() at dofilewrite+0x80
sys_write() at sys_write+0x49
syscall() at syscall+0x1fc
--- syscall (number 4) ---
syscall+0x1fc:
crash>

$ crash -M netbsd.0.core -N netbsd.0
Crash version 9.99.99, image version 9.99.99.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: fpudna from kernel, ip 0xffffffff806cd916, trapframe 0xffffd30423673c90
Backtrace from time of crash is available.
crash> bt
__kernel_end() at 0
kern_reboot() at sys_reboot
vpanic() at vpanic+0x18d
panic() at vprintf
fpudna() at fpu_set_default_cw
Xtrap07() at Xtrap07+0xb5
uvm_swap_io() at uvm_swap_io+0x4c3
swapcluster_flush() at swapcluster_flush+0x50
uvm_pageout() at uvm_pageout+0x391
crash>

And after this commit
https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
my situation becomes worse.
My environment suddenly stops and I cannot get kernel coredumps.

>How-To-Repeat:
Run NetBSD/amd64 9.99.99 on HP Envy 13 ay1000 laptop.

>Fix:
I have no idea.


>Release-Note:

>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Mon, 12 Sep 2022 22:03:11 +0200

 On Mon, Sep 12, 2022 at 07:35:00PM +0000, ryoon@NetBSD.org wrote:
 > [...]
 > After this commit
 > https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
 > [...]
 > And after this commit
 > https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html

 one of these links should be something else, I guess.
 Or maybe both of them, because this commit changes a code which is only
 used for XEN.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Ryo ONODERA <ryo@tetera.org>
To: Manuel Bouyer <bouyer@antioche.eu.org>, gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Tue, 13 Sep 2022 05:30:46 +0900

 Hi,

 Sorry for my mistake.

 Manuel Bouyer <bouyer@antioche.eu.org> writes:

 > On Mon, Sep 12, 2022 at 07:35:00PM +0000, ryoon@NetBSD.org wrote:
 >> [...]
 >> After this commit
 >> https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html

 The original problematic commit is here:
 https://mail-index.netbsd.org/source-changes/2022/09/07/msg140819.html


 >> [...]
 >> And after this commit
 >> https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
 >
 > one of these links should be something else, I guess.
 > Or maybe both of them, because this commit changes a code which is only
 > used for XEN.

 This might be my misunderstanding. So it may be unrelated to my problem.
 I am not using Xen for my laptop.

 > -- 
 > Manuel Bouyer <bouyer@antioche.eu.org>
 >      NetBSD: 26 ans d'experience feront toujours la difference
 > --

 -- 
 Ryo ONODERA // ryo@tetera.org
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

From: Kengo NAKAHARA <k-nakahara@iij.ad.jp>
To: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Tue, 13 Sep 2022 10:19:03 +0900

 Hi,

 Could you show me your kernel configuration?

 On 2022/09/13 4:35, ryoon@NetBSD.org wrote:
 >> Number:         57007
 >> Category:       kern
 >> Synopsis:       NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very unstable
 >> Confidential:   no
 >> Severity:       serious
 >> Priority:       medium
 >> Responsible:    kern-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Mon Sep 12 19:35:00 +0000 2022
 >> Originator:     Ryo ONODERA
 >> Release:        NetBSD 9.99.99
 >> Organization:
 > Ryo ONODERA // ryo@tetera.org
 > PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
 >> Environment:
 > 	
 > 	
 > System: NetBSD brownie 9.99.99 NetBSD 9.99.99 (DTRACE8) #9: Mon Sep 12 12:30:43 JST 2022 ryoon@brownie:/usr/world/9.99/amd64/obj/sys/arch/amd64/compile/DTRACE8 amd64
 > Architecture: x86_64
 > Machine: amd64
 >> Description:
 > After this commit
 > https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
 > NetBSD/amd64 under HP Envy 13 ay1000 (AMD Ryzen 7 5800U) panics.
 > In some case, I cannot get kernel coredumps.
 > The backtraces from crash(8) are as follows.
 > 
 > $ crash -M netbsd.16.core -N netbsd.16
 > Crash version 9.99.99, image version 9.99.99.
 > crash: _kvm_kvatop(0)
 > Kernel compiled without options LOCKDEBUG.
 > System panicked: trap
 > Backtrace from time of crash is available.
 > crash> bt
 > __kernel_end() at 0
 > kern_reboot() at sys_reboot
 > vpanic() at vpanic+0x18d
 > panic() at vprintf
 > trap() at startlwp
 > --- trap (number 6) ---
 > copyin() at copyin+0x2f
 > ubc_uiomove() at ubc_uiomove+0x104
 > ffs_write() at ffs_write+0x265
 > VOP_WRITE() at VOP_WRITE+0xa6
 > vn_write() at vn_write+0x10e
 > dofilewrite() at dofilewrite+0x80
 > sys_write() at sys_write+0x49
 > syscall() at syscall+0x1fc
 > --- syscall (number 4) ---
 > syscall+0x1fc:
 > crash>
 > 
 > $ crash -M netbsd.0.core -N netbsd.0
 > Crash version 9.99.99, image version 9.99.99.
 > crash: _kvm_kvatop(0)
 > Kernel compiled without options LOCKDEBUG.
 > System panicked: fpudna from kernel, ip 0xffffffff806cd916, trapframe 0xffffd30423673c90
 > Backtrace from time of crash is available.
 > crash> bt
 > __kernel_end() at 0
 > kern_reboot() at sys_reboot
 > vpanic() at vpanic+0x18d
 > panic() at vprintf
 > fpudna() at fpu_set_default_cw
 > Xtrap07() at Xtrap07+0xb5
 > uvm_swap_io() at uvm_swap_io+0x4c3
 > swapcluster_flush() at swapcluster_flush+0x50
 > uvm_pageout() at uvm_pageout+0x391
 > crash>
 > 
 > And after this commit
 > https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
 > my situation becomes worse.
 > My environment suddenly stops and I cannot get kernel coredumps.
 > 	
 >> How-To-Repeat:
 > Run NetBSD/amd64 9.99.99 on HP Envy 13 ay1000 laptop.
 > 	
 >> Fix:
 > I have no idea.
 > 	
 > 
 >> Unformatted:
 >   	
 >   	

 -- 
 //////////////////////////////////////////////////////////////////////
 Internet Initiative Japan Inc.

 Device Engineering Section,
 Product Division,
 Technology Unit

 Kengo NAKAHARA <k-nakahara@iij.ad.jp>


From: Kengo NAKAHARA <k-nakahara@iij.ad.jp>
To: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org, ryoon@NetBSD.org
Cc: 
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Tue, 13 Sep 2022 10:41:00 +0900

 Hi,

 Could you show me your kernel configuration (difference form GENERIC) ?


 On 2022/09/13 5:35, Ryo ONODERA wrote:
 > The following reply was made to PR kern/57007; it has been noted by GNATS.
 > 
 > From: Ryo ONODERA <ryo@tetera.org>
 > To: Manuel Bouyer <bouyer@antioche.eu.org>, gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 >   unstable
 > Date: Tue, 13 Sep 2022 05:30:46 +0900
 > 
 >   Hi,
 >   
 >   Sorry for my mistake.
 >   
 >   Manuel Bouyer <bouyer@antioche.eu.org> writes:
 >   
 >   > On Mon, Sep 12, 2022 at 07:35:00PM +0000, ryoon@NetBSD.org wrote:
 >   >> [...]
 >   >> After this commit
 >   >> https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
 >   
 >   The original problematic commit is here:
 >   https://mail-index.netbsd.org/source-changes/2022/09/07/msg140819.html
 >   
 >   
 >   >> [...]
 >   >> And after this commit
 >   >> https://mail-index.netbsd.org/source-changes/2022/09/12/msg140933.html
 >   >
 >   > one of these links should be something else, I guess.
 >   > Or maybe both of them, because this commit changes a code which is only
 >   > used for XEN.
 >   
 >   This might be my misunderstanding. So it may be unrelated to my problem.
 >   I am not using Xen for my laptop.
 >   
 >   > --
 >   > Manuel Bouyer <bouyer@antioche.eu.org>
 >   >      NetBSD: 26 ans d'experience feront toujours la difference
 >   > --
 >   
 >   --
 >   Ryo ONODERA // ryo@tetera.org
 >   PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
 >   

 -- 
 //////////////////////////////////////////////////////////////////////
 Internet Initiative Japan Inc.

 Device Engineering Section,
 Product Division,
 Technology Unit

 Kengo NAKAHARA <k-nakahara@iij.ad.jp>


From: Ryo ONODERA <ryo@tetera.org>
To: Kengo NAKAHARA <k-nakahara@iij.ad.jp>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Tue, 13 Sep 2022 12:44:38 +0900

 Hi,

 Kengo NAKAHARA <k-nakahara@iij.ad.jp> writes:

 > Hi,
 >
 > Could you show me your kernel configuration?

 My kernel conf file is as follows:
 It is GENERIC without DIAGNOSTIC.

 === ===
 # Machine description file for ryoon@'s environments

 include 	"arch/amd64/conf/GENERIC"

 no options 	DIAGNOSTIC
 #options 	XHCI_DEBUG
 #amdgpu* 	at pci? dev ? function ?
 #amdgpufb* 	at amdgpufbbus?
 === ===


 -- 
 Ryo ONODERA // ryo@tetera.org
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

From: "Kengo NAKAHARA" <knakahara@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57007 CVS commit: src/sys/arch/amd64/amd64
Date: Tue, 13 Sep 2022 05:36:29 +0000

 Module Name:	src
 Committed By:	knakahara
 Date:		Tue Sep 13 05:36:29 UTC 2022

 Modified Files:
 	src/sys/arch/amd64/amd64: lock_stubs.S

 Log Message:
 Fix PR kern/57007.  I missed applying a part of the original patch.


 To generate a diff of this commit:
 cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/amd64/lock_stubs.S

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Kengo NAKAHARA <k-nakahara@iij.ad.jp>
To: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org, ryoon@NetBSD.org
Cc: 
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Tue, 13 Sep 2022 14:42:28 +0900

 Hi,

 Thank you for your information, I can get reproduction.

 I fix the bug in lock_stub.S:r1.38, and that works in my system
 that was reproduction by no options DIAGNOSTIC kernel.

 Could you try lock_stub.S:r1.38?

 On 2022/09/13 12:45, Ryo ONODERA wrote:
 > The following reply was made to PR kern/57007; it has been noted by GNATS.
 > 
 > From: Ryo ONODERA <ryo@tetera.org>
 > To: Kengo NAKAHARA <k-nakahara@iij.ad.jp>, gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 >   unstable
 > Date: Tue, 13 Sep 2022 12:44:38 +0900
 > 
 >   Hi,
 >   
 >   Kengo NAKAHARA <k-nakahara@iij.ad.jp> writes:
 >   
 >   > Hi,
 >   >
 >   > Could you show me your kernel configuration?
 >   
 >   My kernel conf file is as follows:
 >   It is GENERIC without DIAGNOSTIC.
 >   
 >   === ===
 >   # Machine description file for ryoon@'s environments
 >   
 >   include 	"arch/amd64/conf/GENERIC"
 >   
 >   no options 	DIAGNOSTIC
 >   #options 	XHCI_DEBUG
 >   #amdgpu* 	at pci? dev ? function ?
 >   #amdgpufb* 	at amdgpufbbus?
 >   === ===
 >   
 >   
 >   --
 >   Ryo ONODERA // ryo@tetera.org
 >   PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
 >   

 -- 
 //////////////////////////////////////////////////////////////////////
 Internet Initiative Japan Inc.

 Device Engineering Section,
 Product Division,
 Technology Unit

 Kengo NAKAHARA <k-nakahara@iij.ad.jp>


Responsible-Changed-From-To: kern-bug-people->knakahara
Responsible-Changed-By: knakahara@NetBSD.org
Responsible-Changed-When: Tue, 13 Sep 2022 05:51:41 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->feedback
State-Changed-By: knakahara@NetBSD.org
State-Changed-When: Tue, 13 Sep 2022 05:51:41 +0000
State-Changed-Why:


From: Ryo ONODERA <ryo@tetera.org>
To: Kengo NAKAHARA <k-nakahara@iij.ad.jp>, gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 unstable
Date: Tue, 13 Sep 2022 20:48:35 +0900

 Hi,

 Kengo NAKAHARA <k-nakahara@iij.ad.jp> writes:

 > Hi,
 >
 > Thank you for your information, I can get reproduction.
 >
 > I fix the bug in lock_stub.S:r1.38, and that works in my system
 > that was reproduction by no options DIAGNOSTIC kernel.
 >
 > Could you try lock_stub.S:r1.38?

 lock_stubs.S r1.38 fixes my problem.
 I have built some relatively heavy pkgsrc packages and
 kept low load average. And I have no kernel panic.

 Thanks for your quick fix!!!


 > On 2022/09/13 12:45, Ryo ONODERA wrote:
 >> The following reply was made to PR kern/57007; it has been noted by GNATS.
 >> 
 >> From: Ryo ONODERA <ryo@tetera.org>
 >> To: Kengo NAKAHARA <k-nakahara@iij.ad.jp>, gnats-bugs@NetBSD.org
 >> Cc:
 >> Subject: Re: kern/57007: NetBSD/amd64 9.99.99 on AMD Ryzen 7 5800U is very
 >>   unstable
 >> Date: Tue, 13 Sep 2022 12:44:38 +0900
 >> 
 >>   Hi,
 >>   
 >>   Kengo NAKAHARA <k-nakahara@iij.ad.jp> writes:
 >>   
 >>   > Hi,
 >>   >
 >>   > Could you show me your kernel configuration?
 >>   
 >>   My kernel conf file is as follows:
 >>   It is GENERIC without DIAGNOSTIC.
 >>   
 >>   === ===
 >>   # Machine description file for ryoon@'s environments
 >>   
 >>   include 	"arch/amd64/conf/GENERIC"
 >>   
 >>   no options 	DIAGNOSTIC
 >>   #options 	XHCI_DEBUG
 >>   #amdgpu* 	at pci? dev ? function ?
 >>   #amdgpufb* 	at amdgpufbbus?
 >>   === ===
 >>   
 >>   
 >>   --
 >>   Ryo ONODERA // ryo@tetera.org
 >>   PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
 >>   
 >
 > -- 
 > //////////////////////////////////////////////////////////////////////
 > Internet Initiative Japan Inc.
 >
 > Device Engineering Section,
 > Product Division,
 > Technology Unit
 >
 > Kengo NAKAHARA <k-nakahara@iij.ad.jp>
 >
 >

 -- 
 Ryo ONODERA // ryo@tetera.org
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

State-Changed-From-To: feedback->closed
State-Changed-By: knakahara@NetBSD.org
State-Changed-When: Wed, 14 Sep 2022 01:31:34 +0000
State-Changed-Why:
ryoon@n.o reports that is fixed.  Thank you for test!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.