NetBSD Problem Report #5131

Received: (qmail 26525 invoked from network); 7 Mar 1998 23:34:32 -0000
Message-Id: <199803072333.SAA00650@road-runner.mit.edu>
Date: Sat, 7 Mar 1998 18:33:37 -0500 (EST)
From: nathanw@MIT.EDU
Reply-To: nathanw@MIT.EDU
To: gnats-bugs@gnats.netbsd.org
Subject: gus driver shouldn't decide to drop into debugger.
X-Send-Pr-Version: 3.95

>Number:         5131
>Category:       kern
>Synopsis:       gus driver shouldn't decide to drop into debugger.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 07 15:35:00 +0000 1998
>Closed-Date:    Sun Mar 08 22:26:59 +0000 1998
>Last-Modified:  Mon Mar 09 06:28:44 +0000 1998
>Originator:     Nathan J. Williams
>Release:        <NetBSD-current source date> NetBSD-current of 98/3/7
>Organization:
Massachvsetts Institvte of Technology
>Environment:

System: NetBSD road-runner.mit.edu 1.3E NetBSD 1.3E (ROAD-RUNNER) #92: Sat Mar 7 00:51:36 EST 1998 nathanw@road-runner.mit.edu:/u1/usr/src/sys/arch/i386/compile/ROAD-RUNNER i386


>Description:
	The gus driver has some #ifdef DDB code to decide whether to call 
panic() or Debugger(). This is wrong; the right thing for a driver to do is 
to call panic() and let panic() decide whether to drop into the debugger, a 
decision which depends on more than just DDB being defined (the value of 
db_onpanic, for example).
>How-To-Repeat:
	Try to figure out why your machines keep dropping into DDB when 
db_onpanic is set to 0, and grovel around the kernel sources.
	Stare at sys/dev/isa/gus.c and smack head.
>Fix:
	Apply this patch:

*** gus.c.orig	Sat Mar  7 18:21:43 1998
--- gus.c	Sat Mar  7 18:21:53 1998
***************
*** 1686,1699 ****
  			    sc->sc_playbuf = ++sc->sc_playbuf % sc->sc_nbufs;
  			    gus_start_playing(sc, sc->sc_playbuf);
  			} else if (sc->sc_bufcnt < 0) {
- #ifdef DDB
- 			    printf("%s: negative bufcnt in stopped voice\n",
- 				   sc->sc_dev.dv_xname);
- 			    Debugger();
- #else
  			    panic("%s: negative bufcnt in stopped voice",
  				  sc->sc_dev.dv_xname);
- #endif
  			} else {
  			    sc->sc_playbuf = -1; /* none are active */
  			    gus_stops++;
--- 1686,1693 ----
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: mikel
State-Changed-When: Sun Mar  8 22:26:59 1998
State-Changed-Why:
fixed, thanks.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.