NetBSD Problem Report #5684

Received: (qmail 17649 invoked from network); 1 Jul 1998 14:10:46 -0000
Message-Id: <199807011410.QAA00391@garfield.lip6.fr>
Date: Wed, 1 Jul 1998 16:10:33 +0200 (MEST)
From: Manuel.Bouyer@lip6.fr (Manuel Bouyer)
Reply-To: Manuel.Bouyer@lip6.fr (Manuel Bouyer)
To: gnats-bugs@gnats.netbsd.org
Subject: vm_fault in ip_reass
X-Send-Pr-Version: 3.95

>Number:         5684
>Category:       kern
>Synopsis:       vm_fault in ip_reass
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 01 07:20:01 +0000 1998
>Closed-Date:    Mon Jan 11 22:47:58 +0000 1999
>Last-Modified:  Tue Sep 04 23:44:00 +0000 2001
>Originator:     Manuel Bouyer
>Release:        NetBSD 1.3.2
>Organization:

LIP6, Universite Paris VI.

>Environment:

System: NetBSD garfield.lip6.fr 1.3.2 NetBSD 1.3.2 (GARFIELD) #2: Fri Jun 26 09:39:11 MEST 1998 bouyer@garfield.lip6.fr:/usr/src/sys/arch/i386/compile/GARFIELD i386


>Description:

	I have a PC here with several NFS-exported partitions on 2 IDE disks:
	/dev/wd0a on / type ffs (local)
	/dev/wd0e on /usr type ffs (local)
	/dev/wd0g on /images type msdos (NFS exported, local)
	/dev/wd0h on /cd1 type ffs (NFS exported, local)
	/dev/wd1e on /cd2 type ffs (NFS exported, local)
	/dev/wd1f on /cd3 type ffs (NFS exported, local)
	/dev/wd1g on /archives type ffs (local)
	pid154@garfield:/auto on /auto type nfs
	hera:/comptes on /a/hera/comptes type nfs

	Today I had 3 NFS tranferts running (2 cpio -p, and one mkisofs),
	when the machine paniced. Here is the stack trace (written by hand):

	vm_fault(0xf0756e00, deadb000, 1, 0) -> 1
	kernel: page fault trap, code=0
	Stopped at _ip_reass+0x8: movl 0x8(%ebx), %eax

	_ip_reass(f0785cc0, f0703500, 0, f0101c14,4)+0x8
	_ipintr(1f, 1f, 243592be, 1852ef71,a74ed382)+0x39b
	Bad frame pointer: 0xf20ebfa8

	Kernel image and core dump available on request.

	Before this panic, the machine has sent some "mb_map full" messages.
	I'll try increasing the NMBCLUSTERS to see if it helps if I get
	another panic.


>How-To-Repeat:

	Seems hard to reproduce. I have other NetBSD NFS servers here,
	which never paniced this way ... Maybe it's related to the
	NFS-exported msdos filesystem, but this seems hard to belive.
>Fix:
	Unknow, sorry. Sounds like an mbuf chain or the fragment queue got
	corrupted somewhere.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: thorpej 
State-Changed-When: Fri Dec 18 13:23:34 PST 1998 
State-Changed-Why:  
I believe I know what the problem is.  It is related to another problem 
that someone else reported to me, where the lossage occurred with the 
TCP sequence queue.  It's more likely to happen with TCP (and only in 
-current, because 1.3.x doesn't have tcp_drain()), because out-of-sequence 
packets are more likely than fragmented IP datagrams. 

I believe the following is happening: 

- ip_reass() is reassembling a fragmented datagram. 

- Device interrupt occurs.  Device attempts to allocate a cluster 
to hold the packet. 

- Memory is low, so m_reclaim() is called to drain the protocols. 

- ip_drain() frees the IP reassembly queue. 

- Upon RTI, the ipq is now corrupt and the fault occurs. 

Something similar happens w/ TCP's sequence queues. 

I have devised a locking protocol between the reassembly routines and 
the drain routines.  I will commit it to -current shortly.  This should 
solve your problem. 

I don't know what state I should put the PR in once the fix is committed, 
as you are having a tough time reproducing the problem.  Feedback would be 
appreciated, however. 
Responsible-Changed-From-To: kern-bug-people->thorpej 
Responsible-Changed-By: thorpej 
Responsible-Changed-When: Fri Dec 18 13:28:46 PST 1998 
Responsible-Changed-Why:  
I have analyzed the problem, and will act as POC for this bug. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: thorpej 
State-Changed-When: Mon Jan 11 14:47:58 PST 1999 
State-Changed-Why:  
Cannot reproduce the bug, will assume closed. 
>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.