From parag@cgt.com  Sun Dec 27 14:59:54 1998
Received: from pinhead.parag.codegen.com (ppp-sfx201--041.sirius.net [205.134.235.41])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA13526
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 27 Dec 1998 14:59:53 -0800 (PST)
          (envelope-from parag@cgt.com)
Received: (from parag@localhost)
	by pinhead.parag.codegen.com (8.9.1/8.8.8) id OAA01521;
	Sun, 27 Dec 1998 14:59:41 -0800 (PST)
	(envelope-from parag)
Message-Id: <199812272259.OAA01521@pinhead.parag.codegen.com>
Date: Sun, 27 Dec 1998 14:59:41 -0800 (PST)
From: parag@codegen.com
Reply-To: parag@cgt.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Fix for "kernel trap 25 with interrupts disabled"
X-Send-Pr-Version: 3.2

>Number:         9211
>Category:       kern
>Synopsis:       doscmd triggers endless "kernel trap 25" messages
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 27 15:00:01 PST 1998
>Closed-Date:    Wed Feb 17 05:17:53 PST 1999
>Last-Modified:  Wed Feb 17 05:19:56 PST 1999
>Originator:     Parag Patel
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
CodeGen, Inc.
>Environment:

	dual PII-300 SMP system, 256Mb RAM, 256Mb swap

>Description:

	Running "doscmd" under the latest 3.0-CURRENT kernel triggers endless
	"kernel trap 25 with interrupts disabled" messages in the
	console and dmesg buffer (which rapidly fills up).

>How-To-Repeat:

	Run "doscmd -x -b" and watch the output of xconsole.

>Fix:
	
	Here is the patch to /sys/i386/i386/trap.c to ignore this
	specific trap.  I don't know if it is the right solution, but it
	turns off the error message and doscmd seems happy.  The code in
	trap.c already has an "if" for a couple of other traps - I just
	added the third trap (25).


Index: trap.c
===================================================================
RCS file: /src/freebsd/src/sys/i386/i386/trap.c,v
retrieving revision 1.131
diff -c -r1.131 trap.c
*** trap.c	1998/12/16 15:21:50	1.131
--- trap.c	1998/12/27 18:52:09
***************
*** 230,236 ****
  			printf(
  			    "pid %ld (%s): trap %d with interrupts disabled\n",
  			    (long)curproc->p_pid, curproc->p_comm, type);
! 		else if (type != T_BPTFLT && type != T_TRCTRAP)
  			/*
  			 * XXX not quite right, since this may be for a
  			 * multiple fault in user mode.
--- 230,237 ----
  			printf(
  			    "pid %ld (%s): trap %d with interrupts disabled\n",
  			    (long)curproc->p_pid, curproc->p_comm, type);
! 		else if (type != T_BPTFLT && type != T_TRCTRAP &&
! 			    type != T_TSSFLT)
  			/*
  			 * XXX not quite right, since this may be for a
  			 * multiple fault in user mode.

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, parag@codegen.com
Cc:  Subject: Re: kern/9211: Fix for "kernel trap 25 with interrupts disabled"
Date: Mon, 28 Dec 1998 22:42:14 +1100

 >>Fix:
 >	
 >	Here is the patch to /sys/i386/i386/trap.c to ignore this
 >	specific trap.  I don't know if it is the right solution, but it
 >	turns off the error message and doscmd seems happy.  The code in
 >	trap.c already has an "if" for a couple of other traps - I just
 >	added the third trap (25).
 
 The existing "if" is a mistake.  It's dangerous to run code that is
 designed to run with interrupts disabled under a debugger, and the
 warning is a good way to tell you that you shouldn't do it.
 
 Bruce
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: imp 
Responsible-Changed-When: Wed Jan 20 11:00:59 MST 1999 
Responsible-Changed-Why:  
I'll look at this. 
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Wed Feb 17 05:17:53 PST 1999 
State-Changed-Why:  
The problem was mostly in the kernel.  An undesirable real/vm86 mode flag 
was passed to protected mode signal handlers. 
Fixed in rev.1.326 of machdep.c in -current. 
Fixed in rev.1.322.2.3 of machdep in post-3.1. 
>Unformatted:
