Subject: kern/6269: ym_isapnp.c crashes during attach
To: None <>
From: John F. Woods <>
List: netbsd-bugs
Date: 10/09/1998 21:08:08
>Number:         6269
>Category:       kern
>Synopsis:       ym_isapnp.c crashes during attach
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct  9 18:20:00 1998
>Originator:     John F. Woods
>Release:        netbsd-current october 8
System: NetBSD 1.3H (GENERIC) #4: Tue Oct  6 23:45:26 MEST 1998

	I have a PC with an OPL-SA3 based audio card (ISA plug-n-pray).
When I boot the 9/30 snapshot provided by Havard Eidnes, it crashes
when trying to attach the sound card; it calls ym_attach, which calls
ad1848_attach, which calls a null function pointer.  (Which then causes
a kernel page fault in DDB's disassembler, by the way.)

	The null function pointer was the sc_writereg function pointer in
struct ad1848_softc, which was probably added to ad1848.c on Aug 28, but
was not added to any of the ym drivers (isapnp or isa).  I think the key
is that the other drivers which borrow the ad1848 functionality also call
ad1848_*_probe() which sets the functions pointers, but ym_attach skips
that step.

	"Just do it."

	If no one gets to this by Monday, I'll submit a fix.  Presumably
it's a matter of either calling ad1848_*_probe or duplicating an appropriate
amount of its functionality, but I've spent no time on anything other than
spotting the problem.