NetBSD Problem Report #55316

From gson@gson.org  Fri May 29 15:52:00 2020
Return-Path: <gson@gson.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 CDCBE1A9218
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 29 May 2020 15:52:00 +0000 (UTC)
Message-Id: <20200529155154.A9953253F45@guava.gson.org>
Date: Fri, 29 May 2020 18:51:54 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: sparc reports "panic: crazy interrupts" after serial break
X-Send-Pr-Version: 3.95

>Number:         55316
>Category:       port-sparc
>Synopsis:       sparc reports "panic: crazy interrupts" after serial break
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 29 15:55:00 +0000 2020
>Last-Modified:  Fri May 29 19:45:01 +0000 2020
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2020.05.17.19.34.07
>Organization:
>Environment:
System: NetBSD
Architecture: sparc
Machine: sparc
>Description:

When I run NetBSD-current/sparc in qemu with a serial console and
send a break sequence by typing "control-a b", I get output like
this:

[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] stray interrupt cpu0 ipl 0xc pc=0x31a6c npc=0x31a70 psr=0x4401083<EF,S>
[  23.8931665] panic: crazy interrupts
[  23.8931665] cpu0: Begin traceback...
[  23.8931665] 0x0(0xf046c550, 0xf052f2f8, 0xf056bc00, 0xf056cc00, 0x104, 0xf056cae0) at netbsd:panic+0x20
[  23.8931665] panic(0xf046c550, 0x0, 0xc, 0x31a6c, 0x31a70, 0xf052f310) at netbsd:strayintr+0xa4
[  23.8931665] strayintr(0xf052f3b0, 0xf0013b64, 0xf00, 0x48010a3, 0x0, 0x17) at netbsd:sparc_interrupt44c+0x168
[  23.8931665] cpu0: End traceback...
[  23.8931665] Frame pointer is at 0xf052f0b0
[  23.8931665] Call traceback:
[  23.8931665]   pc = 0xf002cc94  args = (0xf056cc7c, 0xf048f8d8, 0xf052f1d0, 0xf04b3400, 0x168, 0xf0548400) fp = 0xf052f120
[  23.8931665]   pc = 0xf02de010  args = (0x104, 0x0, 0xf08b3d00, 0x0, 0x4401fe7, 0xf056a000) fp = 0xf052f188
[  23.8931665]   pc = 0xf031d9b8  args = (0x104, 0x0, 0xf046c550, 0xf052f2f8, 0x0, 0xf0002000) fp = 0xf052f1e8
[  23.8931665]   pc = 0xf031da64  args = (0xf046c550, 0xf052f2f8, 0xf056bc00, 0xf056cc00, 0x104, 0xf056cae0) fp = 0xf052f248
[  23.8931665]   pc = 0xf002a6d0  args = (0xf046c550, 0x0, 0xc, 0x31a6c, 0x31a70, 0xf052f310) fp = 0xf052f2b0
[  23.8931665]   pc = 0xf0008cc0  args = (0xf052f3b0, 0xf0013b64, 0xf00, 0x48010a3, 0x0, 0x17) fp = 0xf052f350
[  23.8931665]   pc = 0x1ec2c  args = (0x1, 0x58, 0x0, 0x0, 0x1c, 0xed964074) fp = 0xeffff6d0

[  23.8931665] dumping to dev 7,1 offset 164063
[  23.8931665] dump succeeded
[  23.8931665] rebooting

I don't know if this is a NetBSD bug or a qemu bug.  I have tried the
following combinations of qemu version and NetBSD version, and they
all panic:

  qemu-5.0.0nb4, -current
  qemu-5.0.0nb4, 7.2
  qemu-3.1.0nb1, -current

>How-To-Repeat:

anita interact http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/images/NetBSD-9.99.64-sparc.iso
(wait for login prompt)
<control-a> 

>Fix:

>Audit-Trail:
From: "John D. Baker" <jdbaker@consolidated.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-sparc/55316: sparc reports "panic: crazy interrupts" after
 serial break
Date: Fri, 29 May 2020 14:34:54 -0500 (CDT)

 I just booted a real SPARCstation (5, 110MHz) with 9.99.64 from sources
 around 26 May 2020 and sending a BREAK to the serial console ('cu -9600
 -l dty00' on netbsd-9/amd64 host) drops into DDB as expected.

 Points to possible QEMU issue?

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]consolidated[flyspeck]net  OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Andreas Gustafsson <gson@gson.org>
To: "John D. Baker" <jdbaker@consolidated.net>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55316: sparc reports "panic: crazy interrupts" after serial break
Date: Fri, 29 May 2020 22:42:57 +0300

 John D. Baker wrote:
 >  I just booted a real SPARCstation (5, 110MHz) with 9.99.64 from sources
 >  around 26 May 2020 and sending a BREAK to the serial console ('cu -9600
 >  -l dty00' on netbsd-9/amd64 host) drops into DDB as expected.
 >  
 >  Points to possible QEMU issue?

 Yes, it would seem so.
 -- 
 Andreas Gustafsson, gson@gson.org

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.