Subject: kern/31309: panic when freeing 0-ptr in lptclose
To: None <,,>
From: Frank Kardel <>
List: netbsd-bugs
Date: 09/13/2005 20:27:03
>Number:         31309
>Category:       kern
>Synopsis:       panic when freeing 0-ptr in lptclose
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 13 20:27:00 +0000 2005
>Originator:     Frank Kardel
>Release:        NetBSD 3.99.8
System: NetBSD 3.99.8 NetBSD 3.99.8 (PIP.MP) #1: Sun Sep 11 12:41:34 MEST 2005 i386
Architecture: i386
Machine: i386
	in -current 20050910 and somewhat before cupsd triggers a panic when closing
	lpt0. Additional diagnostic code shows that open does not produce
	a 0-ptr, but lptclose() will sometimes attempt to free a 0-ptr (close on
	uninitialized structure?).
	Configure an lpt based printer in cups. Boot and sometimes the panic
	occurs. This happens on a fast machines (Athlon XP 2800+ and Athlon 64 X2 4400+).
	Workaround - don't call free when a 0-ptr would be freed.