NetBSD Problem Report #57126

From www@netbsd.org  Wed Dec 21 11:13:48 2022
Return-Path: <www@netbsd.org>
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 8FCD31A921F
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 21 Dec 2022 11:13:48 +0000 (UTC)
Message-Id: <20221221111347.AB7D61A9239@mollari.NetBSD.org>
Date: Wed, 21 Dec 2022 11:13:47 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
Subject: wsfb crashes early clearing the screen (powerbook 160)
X-Send-Pr-Version: www-1.0

>Number:         57126
>Category:       port-mac68k
>Synopsis:       wsfb crashes early clearing the screen (powerbook 160)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mac68k-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 21 11:15:00 +0000 2022
>Closed-Date:    Mon Dec 26 21:17:02 +0000 2022
>Last-Modified:  Mon Dec 26 21:17:02 +0000 2022
>Originator:     Nat Sloss
>Release:        NetBSD 10.99.1
>Organization:
>Environment:
NetBSD 10.99.1 (WSFBPWR) #6: Wed Dec 21 20:06:20 AEDT 2022
build@microrusty:/home/build/nbsd999-mac68k/sys/arch/mac68k/compile/WSFBPWR
>Description:
My stripped down kernel based on WSFBSBC does not boot and crashes
upon clearing the screen.

It clears only 1/4 of the screen on my Powerbook 160 (640x400x4bpp)
display.

I added some print statements to GENERIC with the grf device and if reports a video length of 0x8000 bytes which makes no sense as at best I
think it would be 640 x 400 / 2 bytes.

Serial console output to follow in a subsequent email.
>How-To-Repeat:
Try to boot the wsfb enabled kernels on a powerbook 160.

>Fix:
Not known.

>Release-Note:

>Audit-Trail:
From: Nat Sloss <nathanialsloss@yahoo.com.au>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-mac68k/57126: wsfb crashes early clearing the screen (powerbook 160)
Date: Wed, 21 Dec 2022 22:21:20 +1100

 --Boundary-00=_xwuoj4xSNpR9KAc
 Content-Type: Text/Plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit

 Hi,

 Attached is the output of a serial console boot attempt.

 Best regards,

 Nat

 --Boundary-00=_xwuoj4xSNpR9KAc
 Content-Type: text/plain;
   charset="ISO-8859-1";
   name="pwrbookbugreport.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="pwrbookbugreport.txt"

 Connected
 [   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, 2020, 2021, 2022
 [   1.0000000]     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 10.99.1 (WSFBPWR) #6: Wed Dec 21 20:06:20 AEDT 2022
 [   1.0000000] 	build@microrusty:/home/build/nbsd999-mac68k-phil/sys/arch/mac68k/compile/WSFBPWR
 [   1.0000000] Apple Macintosh PowerBook 160  (68030)
 [   1.0000000] cpu: delay factor 265
 [   1.0000000] fpu: emulator
 [   1.0000000] total memory = 8192 KB
 [   1.0000000] avail memory = 5152 KB
 [   1.0000000] mrg: '2nd Powerbook class ROMs' ROM glue, tracing off, debug off, silent traps
 [   1.0000000] mainbus0 (root)
 [   1.0000000] obio0 at mainbus0
 [   1.0000000] adb0 at obio0
 [   1.0000000] intvid0 at obio0DEFAULT
 [   1.0000000]  @ 60000000: On-board video
 [   1.0000000] intvid0: 640 x 400, 4-bpp color
 [   1.0000000] genfb0 at intvid0: 
 [   1.0000000] uvm_fault(0x1d2150, 0x2f0e000, 0x2) -> 0xe
 [   1.0000000]   type 8, code [mmu,,ssw]: 402070d
 [   1.0000000] trap type 8, code = 0x402070d, v = 0x2f0e000
 [   1.0000000] kernel program counter = 0x637b6
 [   1.0000000] kernel: MMU fault trap
 [   1.0000000] pid = 0, lid = 0, pc = 000637B6, ps = 2704, sfc = 1, dfc = 1
 [   1.0000000] Registers:
 [   1.0000000]              0        1        2        3        4        5        6        7
 [   1.0000000] dreg: 00000000 0001F400 FD0FA000 0001F400 00000004 00000031 0001F400 000012C0
 [   1.0000000] areg: 02F0E004 02F25400 0061A014 00063770 00000018 002399B0 00239868 FFFF9FFC

 [   1.0000000] Kernel stack (00239714):
 [   1.0000000] 239714: 0001558C 002397FC 00000080 FD0FA000 0001F400 00000004 00000031 0001F400
 [   1.0000000] 239734: 000012C0 0061A014 00063770 00000018 002399B0 00000002 00000067 02F0E000
 [   1.0000000] 239754: 001D3D68 00000000 00239790 000B62CC 001BD600 00000001 00000000 00000000
 [   1.0000000] 239774: 00000000 00000000 00000000 00000000 00000000 00000000 00000008 00000000
 [   1.0000000] 239794: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 [   1.0000000] 2397B4: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 [   1.0000000] 2397D4: 00000000 00000000 00000000 00000000 00239868 00003072 002397FC 00000008
 [   1.0000000] 2397F4: 0402070D 02F0E000 00000000 0001F400 FD0FA000 0001F400 00000004 00000031
 [   1.0000000] 239814: 0001F400 000012C0 02F0E004 02F25400 0061A014 00063770 00000018 002399B0
 [   1.0000000] 239834: 00239868 FFFF9FFC 00000000 27040006 37B6A008 0EEE070D 66FA0801 02F0E000
 [   1.0000000] 239854: 02F0E000 00000000 B3C80000 00000700 00002700 002398A8 0006420A 02F06000
 [   1.0000000] 239874: 00000000 0001F400 00000050 00000111 00000019 000089D0 00171770 000D0B98
 [   1.0000000] 239894: 0061A014 005DCAC0 000D5FEC 002399B0 0061A014 00239900 0006453E 0061A014
 [   1.0000000] 2398B4: 00000019 00000050 00000000 0061A4C8 0061A174 000089D0 00171770 000D0B98
 [   1.0000000] 2398D4: 0061A014 005DCAC0 000D5FEC 002399B0 0060FEC0 0015FD1C 00000001 0060FEC8
 [   1.0000000] 2398F4: 00000000 00000002 0061A014 0023992C 0006C1CA 0061A014 00000000 00000050
 [   1.0000000] panic: MMU fault
 [   1.0000000] cpu0: Begin traceback...
 [   1.0000000] ?(?)
 [   1.0000000] db_panic(8,2700,402070d,e16b8,239714) at 0
 [   1.0000000] vpanic(1552d2,239720,2397e4,155b4,1552d2) + 186
 [   1.0000000] panic(1552d2,fd0fa000,1f400,4,31) + c
 [   1.0000000] trap(2397fc,8,402070d,2f0e000) + 1de
 [   1.0000000] rasops_memset32(2f06000,0,1f400,50,111) + 46
 [   1.0000000] rasops_reconfig(61a014,19,50) + 4de
 [   1.0000000] rasops_init(61a014,0,50,1,61a014) + 100
 [   1.0000000] genfb_init_screen(5dcac0,61a014,1,2399b0,5dcac8) + 20a
 [   1.0000000] vcons_init_screen(5dcac8,61a014,1,2399b0,5dcac8) + 44
 [   1.0000000] genfb_attach(5dcac0,1b3bf8,239aa4,1d67ac,60c740,1,60c740) + 1a8
 [   1.0000000] config_attach_internal(?)
 [   1.0000000] aprint_verbose_internal(60c580,1c7f98,239aa4,89d0,239a58) + 16c
 [   1.0000000] config_found(60c580,239aa4,89d0,0,239aac,5f036c,b4) + 3e
 [   1.0000000] grf_establish(5f0340,0,8ad0,1d67ac,60c580,1,60c580) + c4
 [   1.0000000] config_attach_internal(?)
 [   1.0000000] aprint_verbose_internal(60c200,1c8040,239c24,3b3e,239be8) + 16c
 [   1.0000000] config_attach(60c200,1c8040,239c24,3b3e,0) + 22
 [   1.0000000] obio_search(60c200,1c8040,0,239e7c) + 4a
 [   1.0000000] mapply(239c88,1c8040) + 28
 [   1.0000000] config_search_internal(?)
 [   1.0000000] db_vprintf(60c200,239e7c,239cbc,239cf4,239cbc) + 9a
 [   1.0000000] config_search(60c200,239e7c,239cf4,239cf8,0,18,154219) + 1a
 [   1.0000000] obio_attach(60c040,60c200,239e7c,1d67ac,60c200,1,60c200) + 3a
 [   1.0000000] config_attach_internal(?)
 [   1.0000000] aprint_verbose_internal(60c040,1c7fc8,239e7c,0,239d7c) + 16c
 [   1.0000000] config_attach(60c040,1c7fc8,239e7c,0,0) + 22
 [   1.0000000] mainbus_search(60c040,1c7fc8,0,239e7c) + 32
 [   1.0000000] mapply(239e10,1c7fc8) + 28
 [   1.0000000] config_search_internal(?)
 [   1.0000000] db_vprintf(60c040,239e7c,239e44,239e84,239e44) + 9a
 [   1.0000000] config_search(60c040,239e7c,239e84,239e88,0,18,154219) + 1a
 [   1.0000000] mainbus_attach(0,60c040,0,1d67ac,60c040,1,60c040) + 46
 [   1.0000000] config_attach_internal(?)
 [   1.0000000] aprint_verbose_internal(0,1c7fb0,0,0,239f0c) + 16c
 [   1.0000000] config_attach(0,1c7fb0,0,0,0) + 22
 [   1.0000000] config_rootfound(153be8,0) + 2e
 [   1.0000000] cpu_configure(70f0,16668,80000489,60040000,0) + 18
 [   1.0000000] uvm_fault(0x1d2150, 0xffffe000, 0x1) -> 0xe
 [   1.0000000]   type 8, code [mmu,,ssw]: 402074d
 [   1.0000000] trap type 8, code = 0x402074d, v = 0xfffffffd
 [   1.0000000] kernel program counter = 0x167c4
 [   1.0000000] kernel: MMU fault trap
 [   1.0000000] trap during panic!
 [   1.0000000] pid = 0, lid = 0, pc = 000167C4, ps = 2714, sfc = 1, dfc = 1
 [   1.0000000] Registers:
 [   1.0000000]              0        1        2        3        4        5        6        7
 [   1.0000000] dreg: 00000004 00000004 00000000 0023A000 00000004 00000000 4EDC9F59 00239F58
 [   1.0000000] areg: FFFFFFFD 002395EC 002395EC 00000003 00052FB4 0000ED9C 002395BC FFFF9FFC

 [   1.0000000] Kernel stack (00239430):
 [   1.0000000] 239430: 0001558C 00239518 00000080 00000000 0023A000 00000004 00000000 4EDC9F59
 [   1.0000000] 239450: 00239F58 002395EC 00000003 00052FB4 0000ED9C 00000001 00239550 FFFFE000
 [   1.0000000] 239470: 001D3D68 00000000 0000000A 00239494 00000001 00000000 00000000 00000000
 [   1.0000000] 239490: 00000000 00000000 00000000 00000000 00000000 00000008 00000000 00000000
 [   1.0000000] 2394B0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 [   1.0000000] 2394D0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 [   1.0000000] 2394F0: 00000000 00000000 000E17AA 00000000 002395BC 00003072 00239518 00000008
 [   1.0000000] 239510: 0402074D FFFFFFFD 00000004 00000004 00000000 0023A000 00000004 00000000
 [   1.0000000] 239530: 4EDC9F59 00239F58 FFFFFFFD 002395EC 002395EC 00000003 00052FB4 0000ED9C
 [   1.0000000] 239550: 002395BC FFFF9FFC 00000000 27140001 67C4B008 1EEC074D 601C7002 FFFFFFFD
 [   1.0000000] 239570: FFFFFFFD 00000004 22902290 000167CA 000167C8 000167C6 00000000 601CFF0A
 [   1.0000000] 239590: 000FF482 00000000 00052FB4 00003F20 00000000 00200000 000167C4 00000000
 [   1.0000000] 2395B0: 00000000 00239600 002395EC 002395F0 00052FD6 FFFFFFFD 00000004 002395EC
 [   1.0000000] 2395D0: 00000000 0023A000 FFFFFFFD 00000001 4EDC9F59 00239F58 00239668 00000003
 [   1.0000000] 2395F0: 0023961C 0001D828 FFFFFFFD 00000004 00000000 00000000 0023A000 0000FFE0
 [   1.0000000] 239610: 000E16B8 00052FB4 001BD600 002396C0 0001DE5C 00239668 00000104 001552D2
 [   1.0000000] Skipping crash dump on recursive panic
 [   1.0000000] panic: MMU fault
 [   1.0000000] Faulted in mid-traceback; aborting...
 Stopped in pid 0.0 (system) at  netbsd:cpu_Debugger+0x6:        unlk    a6
 db> ~
 [EOT]

 --Boundary-00=_xwuoj4xSNpR9KAc--

From: Nat Sloss <nathanialsloss@yahoo.com.au>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-mac68k/57126: wsfb crashes early clearing the screen (powerbook 160)
Date: Sat, 24 Dec 2022 19:40:47 +1100

 --Boundary-00=_SsrpjnxGVaUo7ot
 Content-Type: Text/Plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit

 This seems to fix it, see attached.

 Best regards,

 Nat

 --Boundary-00=_SsrpjnxGVaUo7ot
 Content-Type: text/x-patch;
   charset="ISO-8859-1";
   name="mac68kwsfb.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="mac68kwsfb.diff"

 diff -r dd49f08c0f10 sys/arch/mac68k/obio/grf_obio.c
 --- a/sys/arch/mac68k/obio/grf_obio.c	Sun Oct 30 21:30:34 2022 +1100
 +++ b/sys/arch/mac68k/obio/grf_obio.c	Sat Dec 24 19:15:43 2022 +1100
 @@ -187,6 +187,11 @@
  		break;
  	}

 +	/* XXX Hack  for wrongly configured size */
 +	int newsize = mac68k_video.mv_height * mac68k_video.mv_stride;
 +	if (mac68k_video.mv_len < newsize)
 +		mac68k_video.mv_len = newsize;
 +
  	return found;
  }


 --Boundary-00=_SsrpjnxGVaUo7ot--

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: nathanialsloss@yahoo.com.au, tsutsui@ceres.dti.ne.jp
Subject: Re: port-mac68k/57126: wsfb crashes early clearing the screen (powerbook
	 160)
Date: Sat, 24 Dec 2022 19:17:33 +0900

 >  --- a/sys/arch/mac68k/obio/grf_obio.c	Sun Oct 30 21:30:34 2022 +1100
 >  +++ b/sys/arch/mac68k/obio/grf_obio.c	Sat Dec 24 19:15:43 2022 +1100
 >  @@ -187,6 +187,11 @@
 >   		break;
 >   	}
 >   
 >  +	/* XXX Hack  for wrongly configured size */
 >  +	int newsize = mac68k_video.mv_height * mac68k_video.mv_stride;
 >  +	if (mac68k_video.mv_len < newsize)
 >  +		mac68k_video.mv_len = newsize;
 >  +
 >   	return found;
 >   }
 >   

 Looks this should rather be handled in check_video() or get_mapping()
 in mac68k/machdep.c.

 ---
 Izumi Tsutsui

From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57126 CVS commit: src/sys/arch/mac68k/mac68k
Date: Mon, 26 Dec 2022 01:05:36 +0000

 Module Name:	src
 Committed By:	nat
 Date:		Mon Dec 26 01:05:36 UTC 2022

 Modified Files:
 	src/sys/arch/mac68k/mac68k: machdep.c

 Log Message:
 Sanity check and set the framebuffer length if necessary.

 Addresses PR 57126.


 To generate a diff of this commit:
 cvs rdiff -u -r1.363 -r1.364 src/sys/arch/mac68k/mac68k/machdep.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: nat@NetBSD.org
State-Changed-When: Mon, 26 Dec 2022 21:17:02 +0000
State-Changed-Why:
Fixed.


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