From nobody  Tue Feb 11 19:19:04 1997
Received: (from nobody@localhost)
          by freefall.freebsd.org (8.8.5/8.8.5) id TAA14545;
          Tue, 11 Feb 1997 19:19:04 -0800 (PST)
Message-Id: <199702120319.TAA14545@freefall.freebsd.org>
Date: Tue, 11 Feb 1997 19:19:04 -0800 (PST)
From: futagi@csctk.jcsnet.or.jp
To: freebsd-gnats-submit@freebsd.org
Subject: Panic with daily script (find)
X-Send-Pr-Version: www-1.0

>Number:         2717
>Category:       kern
>Synopsis:       Panic with daily script (find)
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 11 19:20:01 PST 1997
>Closed-Date:    Wed Mar 10 01:01:06 PST 1999
>Last-Modified:  Wed Mar 10 01:02:32 PST 1999
>Originator:     Masaaki Futagi
>Release:        2.1.6R
>Organization:
Japan Computer Science Co.,Ltd.
>Environment:
FreeBSD csc-wall2.jcsnet.or.jp 2.1.6-RELEASE FreeBSD 2.1.6-RELEASE #10: Wed Feb
12 11:40:07 JST 1997     futagi@csc-wall2.jcsnet.or.jp:/usr/src/sys/compile/JFK
 i386 

We added our original 'firewall' code to some modules in /sys/netinet
This firewall module puts many 'printf' messages to syslog and console.
>Description:
Panic message:

Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x0
fault code              = supervisor write, page not present
instruction pointer     = 0x8:0xf0127564  (is in cache_lookup() in vfs_cache.o)
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 7438 (find)
interrupt mask          =
panic: page fault     

At 02:03 AM when /etc/daily was running.
This problem did not occur everyday.
>How-To-Repeat:
I could not repeat the probloem manually, 
but it occurd not once in midnight.

>Fix:
I found PURGE() procedure (macro)  was called in cache_lookup()/vfs_cache.c

Now I inhibit interrupts while 'PURGE()' and observing.

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: freebsd-gnats-submit@FreeBSD.ORG, futagi@csctk.jcsnet.or.jp
Cc:  Subject: Re: kern/2717: Panic with daily script (find)
Date: Wed, 12 Feb 1997 17:40:11 +1100

 >We added our original 'firewall' code to some modules in /sys/netinet
 >This firewall module puts many 'printf' messages to syslog and console.
 
 The standard (syscons) console driver and perhaps the pcvt console driver
 have some races when kernel printfs from interrupt handlers are mixed with
 normal console output.
 
 Workarounds: don't put (m)any printfs in interrupt handlers, or don't use
 /dev/ttyv0 for normal applications (it's still used for console output by
 syslogd etc so this only reduces the problem), or use a serial console.
 
 >>How-To-Repeat:
 
 Do `printf("*");' every clock tick in a timeout handler while an application
 is writing to the console.
 
 Bruce
State-Changed-From-To: open->feedback 
State-Changed-By: jkoshy 
State-Changed-When: Mon Jun 1 04:49:23 PDT 1998 
State-Changed-Why:  
Asked Mr. Futagi if the problem is present in more recent versions of 
FreeBSD. 
State-Changed-From-To: feedback->closed 
State-Changed-By: sheldonh 
State-Changed-When: Wed Mar 10 01:01:06 PST 1999 
State-Changed-Why:  
bde's advice was sound, problem resolved by reducing the number of 
printf's in custom kernel patch. 
>Unformatted:
