NetBSD Problem Report #25787

Received: (qmail 23311 invoked by uid 605); 2 Jun 2004 14:18:38 -0000
Message-Id: <200406021418.i52EIGDx023126@pip.acrys.com>
Date: Wed, 2 Jun 2004 16:18:16 +0200 (MEST)
From: Frank Kardel <kardel@pip.acrys.com>
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: kardel@pip.acrys.com
To: gnats-bugs@gnats.NetBSD.org
Subject: malloc failure at raid setup time leads to a broken raid device
X-Send-Pr-Version: 3.95

>Number:         25787
>Category:       kern
>Synopsis:       malloc failure at raid setup time leads to a broken raid device
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    oster
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 02 14:19:00 +0000 2004
>Closed-Date:    Sat Oct 07 17:43:48 +0000 2006
>Last-Modified:  Sat Oct 07 17:45:05 +0000 2006
>Originator:     Frank Kardel
>Release:        NetBSD 2.0F
>Organization:

>Environment:
System: NetBSD pip 2.0F NetBSD 2.0F (SYSPIP_ISDN) #4: Mon May 31 09:28:58 MEST 2004 kardel@pip:/fs/IC35L180AVV207-1-n/IC35L120AVV207-0-e/src/NetBSD/netbsd/sys/arch/i386/compile/obj.i386/SYSPIP_ISDN i386
Architecture: i386
Machine: i386
>Description:
	When configuring some 34-ish raids the configurarion fails with:
	raidXX: failed to allocate emergency buffer!.
	The device is configured nevertheless (see rf_driver.c). Processes accessing
	the device afterwards hang until interrupted. The device is unusable.
	There seem to be two issues here:
	  - missing error handling on allocation failures.
	  - there seems to be a (low) limit on how many raid devices the current kernel memory configuration
	    can support.
>How-To-Repeat:
	configure about 34 raid mirrors. watch configuration fail becaus malloc() return NULL.
	Accesses to the failed device hang.

>Fix:
	Fix error handling on allocation failures.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->oster 
Responsible-Changed-By: oster 
Responsible-Changed-When: Thu Jun 3 01:40:36 UTC 2004 
Responsible-Changed-Why:  
I'll take RAID-related stuff, thanks. 

From: Greg Oster <oster@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/25787 CVS commit: src/sys/dev/raidframe
Date: Sun, 27 Jun 2004 03:15:18 +0000 (UTC)

 Module Name:	src
 Committed By:	oster
 Date:		Sun Jun 27 03:15:18 UTC 2004

 Modified Files:
 	src/sys/dev/raidframe: rf_driver.c

 Log Message:
 Address a number of issues:
 1) Introduce functions to allocate and free the emergency IO buffers.

 2) Make sure we free any allocated emergency buffers in the event that
 we bail out during configuration, or when we unconfigure an array.

 3) if we run out of memory trying to allocate a given type of buffer,
 don't continue to try to allocate more of those buffers.
 (Partially addresses PR#25787)


 To generate a diff of this commit:
 cvs rdiff -r1.102 -r1.103 src/sys/dev/raidframe/rf_driver.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Havard Eidnes <he@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/25787 CVS commit: [netbsd-2-0] src/sys/dev/raidframe
Date: Sun, 27 Jun 2004 13:39:44 +0000 (UTC)

 Module Name:	src
 Committed By:	he
 Date:		Sun Jun 27 13:39:44 UTC 2004

 Modified Files:
 	src/sys/dev/raidframe [netbsd-2-0]: rf_driver.c

 Log Message:
 Pull up revision 1.103 (requested by go in ticket #559):
   Address a number of issues:
   1) Introduce functions to allocate and free the emergency
      IO buffers.
   2) Make sure we free any allocated emergency buffers in the
      event that we bail out during configuration, or when we
      unconfigure an array.
   3) If we run out of memory trying to allocate a given type
      of buffer, do not continue to try to allocate more of
      those buffers.
   Partially addresses PR#25787.


 To generate a diff of this commit:
 cvs rdiff -r1.98.2.2 -r1.98.2.3 src/sys/dev/raidframe/rf_driver.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: oster@netbsd.org
State-Changed-When: Sat, 07 Oct 2006 17:43:48 +0000
State-Changed-Why:
PR addressed with fix to rf_driver.c


From: Greg Oster <oster@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/25787 CVS commit: src/sys/dev/raidframe
Date: Sat,  7 Oct 2006 17:42:54 +0000 (UTC)

 Module Name:	src
 Committed By:	oster
 Date:		Sat Oct  7 17:42:54 UTC 2006

 Modified Files:
 	src/sys/dev/raidframe: rf_driver.c

 Log Message:
 It's ok to wait for memory for the emergency buffers.  If we don't get
 that memory, fail harder, and bail on configuring the RAID array.
 Addresses PR#25787.


 To generate a diff of this commit:
 cvs rdiff -r1.110 -r1.111 src/sys/dev/raidframe/rf_driver.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:
 Can this bug be closed ?

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.