NetBSD Problem Report #54873

From tsutsui@ceres.dti.ne.jp  Sat Jan 18 16:46:43 2020
Return-Path: <tsutsui@ceres.dti.ne.jp>
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 59F187A149
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Jan 2020 16:46:43 +0000 (UTC)
Message-Id: <202001181646.00IGkWc2006154@ceres.dti.ne.jp>
Date: Sun, 19 Jan 2020 01:46:32 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: 9.0_RC1 sun3 GENERIC panic by keyboard with serial console
X-Send-Pr-Version: 3.95

>Number:         54873
>Category:       port-sun3
>Synopsis:       9.0_RC1 sun3 GENERIC panic by keyboard with serial console
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    port-sun3-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 18 16:50:00 +0000 2020
>Closed-Date:    Sat Feb 01 05:37:47 +0000 2020
>Last-Modified:  Sat Feb 01 05:37:47 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0_RC1
>Organization:
>Environment:
NetBSD 9.0_RC1 (GENERIC) #0: Wed Nov 27 16:14:52 UTC 2019  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/sun3/compile/GENERIC
Architecture: m68k
Machine: sun3
>Description:
NetBSD/sun3 GENERIC kernel gets the following panic
if it's booted using serial console on ttya and then
keyboard is typed:

---
[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[   1.0000000]     2018, 2019 The NetBSD Foundation, Inc.  All rights reserved.
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.0000000]     The Regents of the University of California.  All rights reserved.

[   1.0000000] NetBSD 9.0_RC1 (GENERIC) #0: Wed Nov 27 16:14:52 UTC 2019
[   1.0000000]  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/sun3/compile/GENERIC
[   1.0000000] Model: sun3 60
[   1.0000000] fpu: mc68881
[   1.0000000] total memory = 24576 KB
[   1.0000000] avail memory = 22096 KB
[   1.0000000] mainbus0 (root)
[   1.0000000] obio0 at mainbus0
[   1.0000000] zsc0 at obio0 addr 0x0 ipl 6: (softpri 3)
[   1.0000000] kbd0 at zsc0 channel 0: baud rate 1200
[   1.0000000] ms0 at zsc0 channel 1: baud rate 1200
[   1.0000000] zsc1 at obio0 addr 0x20000 ipl 6: (softpri 3)
[   1.0000000] zstty0 at zsc1 channel 0 (console i/o)
[   1.0000000] zstty1 at zsc1 channel 1
[   1.0000000] eeprom0 at obio0 addr 0x40000
[   1.0000000] oclock0 at obio0 addr 0x60000 ipl 5: intersil7170
[   1.0000000] memerr0 at obio0 addr 0x80000 ipl 7: (Parity memory)
[   1.0000000] intreg0 at obio0 addr 0xa0000
[   1.0000000] le0 at obio0 addr 0x120000 ipl 3: address 08:00:20:06:a2:15
[   1.0000000] le0: 8 receive buffers, 2 transmit buffers
[   1.0000000] si0 at obio0 addr 0x140000 ipl 2: options=0xf
[   1.0000000] scsibus0 at si0: 8 targets, 8 luns per target
[   1.0000000] obmem0 at mainbus0
[   1.0000000] bwtwo0 at obmem0 addr 0xff000000 (1152x900)
[   1.0000000] enabling interrupts
[   1.0200220] scsibus0: waiting 2 seconds for devices to settle...
[   5.3400220] sd0 at scsibus0 target 0 lun 0: <MELCO, DSC-UE4.3G, 1.05> disk fixed
[   5.3800220] sd0: 4103 MB, 12968 cyl, 6 head, 108 sec, 512 bytes/sect x 8403264 sectors
[   5.4100220] sd0: async, 8-bit transfers
[   7.9100220] boot device: le0
[   7.9300220] root device (default le0): sd0a
[   8.0100220] dump device (default sd0b):
[   8.0400220] file system (default generic):
[   8.0600220]  dumps on sd0b
[   8.1700220] root file system type: ffs
[   8.2000220] kern.module.path=/stand/sun3/9.0/modules
[   8.3400220] init path (default /sbin/init):
[   8.3800220] init: trying /sbin/init
Enter pathname of shell or RETURN for /bin/sh:
We recommend that you create a non-root account and use su(1) for root access.
# [  26.4800220] vm_fault(0xe1bd3c0, 0x0, 0x1) -> 0xe
[  26.4800220] trap type=0x8, code=0x145, v=0x0
[  26.4800220] kernel: MMU fault trap
[  26.4800220] pid = 0, lid = 6, pc = 0E0D0A30, ps = 2700, sfc = 1, dfc = 1
[  26.4800220] Registers:
[  26.4800220]              0        1        2        3        4        5        6        7
[  26.4800220] dreg: 00000000 00000001 00000000 0E2D2640 0E0177BE 0E219EB4 00000040 FFFFFFFF
[  26.4800220] areg: 00000000 0E1A50C0 0E2D26C8 00000000 0E0B9A2C 0E0B9936 0F5E3EA8 0DFFFFFC

[  26.4800220] Kernel stack (0F5E3D04):
[  26.4800220] 5E3D04: 0E008D3E 0F5E3DF4 00000080 00000000 0E2D2640 0E0177BE 0E219EB4 00000040
[  26.4800220] 5E3D24: FFFFFFFF 0E2D26C8 00000000 0E0B9A2C 0E0B9936 0E1BF010 00000004 00000001
[  26.4800220] 5E3D44: 00000000 00000000 00000000 00000020 0F5E3ED0 0E038E74 0F5E3DC1 00000001
[  26.4800220] 5E3D64: 00000000 00000000 00000000 00000000 00000002 00000000 00000000 00000000
[  26.4800220] 5E3D84: 00000008 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  26.4800220] 5E3DA4: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  26.4800220] 5E3DC4: 00000000 00000000 00000000 00000000 00000000 00000000 0F5E3EA8 0E0040EA
[  26.4800220] 5E3DE4: 0F5E3DF4 00000008 00000145 00000000 00000000 00000001 00000000 0E2D2640
[  26.4800220] 5E3E04: 0E0177BE 0E219EB4 00000040 FFFFFFFF 00000000 0E1A50C0 0E2D26C8 00000000
[  26.4800220] 5E3E24: 0E0B9A2C 0E0B9936 0F5E3EA8 0DFFFFFC 00000000 27000E0D 0A30B008 1E2C0145
[  26.4800220] 5E3E44: 2F024E95 00000000 00000000 00000000 24132413 0E0D0A36 0E0D0A34 0E0D0A32
[  26.4800220] 5E3E64: 4E95588F 2F02FF0D 000F1487 203C246E 0E2F8FEC 0000203C 00000000 801E0000
[  26.4800220] 5E3E84: 0E2D26D8 00000000 00000000 0F5E3ED0 00000000 0E2D26C8 0E2D2698 0F5E3EF0
[  26.4800220] 5E3EA4: 0E017026 0F5E3EC4 0E0D0F7A 0E2D26C8 0000000D 00000059 0F5C2000 0E2D2640
[  26.4800220] 5E3EC4: 0F5E3F08 0E017AC2 0E2D26C8 00000000 0E0177BE 0E2D2640 00000059 00000000
[  26.4800220] 5E3EE4: 0E2D2640 00000001 0E2F8FEC 0E2D4650 0F5E3F08 0E0CC826 0E1AA788 0E1AC430
[  26.4800220] panic: MMU fault
[  26.4800220] cpu0: Begin traceback...
[  26.4800220] ?(?)
[  26.4800220] db_panic(8,2700,d,e0e276a,f5e3d04) at 0
[  26.4800220] vpanic(e154795,f5e3d10,f5e3ddc,e008b32,e154795) + 13c
[  26.4800220] panic(e154795,0,e2d2640,e0177be,e219eb4) + c
[  26.4800220] trap(f5e3df4,8,145,0) + 116
[  26.4800220] callout_lock(?)
[  26.4800220] pool_printit(e2d26c8) + 1c
[  26.4800220] callout_reset(e2d26c8,0,e0177be,e2d2640) + 1a
[  26.4800220] kbd_input(e2d2640,59) + 182
[  26.4800220] kbd_sun_input(e2d2640,59) + 110
[  26.4800220] kbd_zs_softint(e2f8fec) + 12c
[  26.4800220] zsc_intr_soft(e2f8fe0) + 24
[  26.4800220] softint_execute.isra.0(f5cc0f8,e0a2000) + 66
[  26.4800220] softint_thread(f5cc0f8) + 3c
[  26.4800220] lwp_trampoline() + e
[  26.4800220] cpu0: End traceback...
Stopped in pid 0.6 (system) at  netbsd:cpu_Debugger+0x6:        unlk    a6
db>

---

Note on TME emulating 3/120 keyboard seems working without problem.

>How-To-Repeat:
- boot NetBSD/sun3 9.0_RC1 GENERIC on 3/60 with serial console
- type keyboard

>Fix:
Looks missing callout initialization. I'll check what's wrong.

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: port-sun3/54873: 9.0_RC1 sun3 GENERIC panic by keyboard with serial
	 console
Date: Sun, 19 Jan 2020 05:17:25 +0900

 > 	Note: There was a bad value `' for the field `Confidential'.
 > 	It was set to the default value of `yes'.

 Fixed in gnats.

 > >Fix:
 > Looks missing callout initialization. I'll check what's wrong.

 The problem is in src/sys/dev/sun/kbd.c on ports which have not
 switched to wscons, i.e. only sun3 is affected.

 In src/sys/dev/sun/kbd.c a callout(9) for auto keyrepeat
 is initialized only if it's attached as console, but
 it touches the callout via kb_input_console even if
 /dev/kbd is not console.

 The following diff fixes the panic (and keyboard console
 still works at least on TME):

 ---
 Index: sys/dev/sun/kbd.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/sun/kbd.c,v
 retrieving revision 1.69
 diff -u -p -d -r1.69 kbd.c
 --- sys/dev/sun/kbd.c	8 Feb 2018 10:52:05 -0000	1.69
 +++ sys/dev/sun/kbd.c	18 Jan 2020 20:16:08 -0000
 @@ -202,7 +202,7 @@ kbdopen(dev_t dev, int flags, int mode, 
  	k->k_events.ev_io = l->l_proc;

  	/* stop pending autorepeat of console input */
 -	if (k->k_repeating) {
 +	if (k->k_cc != NULL && k->k_repeating) {
  		k->k_repeating = 0;
  		callout_stop(&k->k_repeat_ch);
  	}
 @@ -492,9 +492,11 @@ kbd_input(struct kbd_softc *k, int code)

  	/*
  	 * If /dev/kbd is not connected in event mode, or wskbd mode,
 -	 * translate and send upstream (to console).
 +	 * and is attached as console, translate and send upstream
 +	 * (to console).
  	 */
 -	kbd_input_console(k, code);
 +	if (k->k_cc != NULL)
 +		kbd_input_console(k, code);
  }


 --

 ---
 Izumi Tsutsui

From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54873 CVS commit: src/sys/dev/sun
Date: Sat, 18 Jan 2020 21:08:42 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Sat Jan 18 21:08:42 UTC 2020

 Modified Files:
 	src/sys/dev/sun: kbd.c

 Log Message:
 Fix panic on sun3 when any key is typed when kbd is not console. PR/54873

 Should be pulled up to netbsd-9.


 To generate a diff of this commit:
 cvs rdiff -u -r1.70 -r1.71 src/sys/dev/sun/kbd.c

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54873 CVS commit: [netbsd-9] src/sys/dev/sun
Date: Tue, 21 Jan 2020 15:44:24 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Jan 21 15:44:24 UTC 2020

 Modified Files:
 	src/sys/dev/sun [netbsd-9]: kbd.c

 Log Message:
 Pull up following revision(s) (requested by tsutsui in ticket #637):

 	sys/dev/sun/kbd.c: revision 1.71

 Fix panic on sun3 when any key is typed when kbd is not console. PR/54873
 Should be pulled up to netbsd-9.


 To generate a diff of this commit:
 cvs rdiff -u -r1.69 -r1.69.10.1 src/sys/dev/sun/kbd.c

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

State-Changed-From-To: open->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 01 Feb 2020 05:37:47 +0000
State-Changed-Why:
Fixed and pulled up.


>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.