Re: kextunload problem
Re: kextunload problem
- Subject: Re: kextunload problem
- From: chuck remes <email@hidden>
- Date: Tue, 12 Nov 2002 07:07:15 -0600
On Monday, November 11, 2002, at 08:22 PM, chuck remes wrote:
On Sunday, November 10, 2002, at 10:54 AM, chuck remes wrote:
I'm trying to get my kext to successfully unload so I can test it
without going through a reboot cycle. I'm having problems. After
running kextload, my kext goes through its init() and start()
sequences. I have engineered it so start() fails.
When I run kextunload, I get this in system.log.
: Can't unload com.chuck.iokit.tulip due to -
: com.chuck.iokit.tulip: com_cremes_eeprom has 1 instance(s)
: com.chuck.iokit.tulip: com_chuck_iokit_tulip has 1 instance(s)
: com.chuck.iokit.tulip: com_cremes_eeprom_sio has 1 instance(s)
: com.chuck.iokit.tulip: com_cremes_eeprom_sio_dec2114x has 1
instance(s)
: com.chuck.iokit.tulip: com_chuck_iokit_tulip_dec2114x has 1
instance(s)
: com.chuck.iokit.tulip: com_chuck_iokit_tulip_pnic2 has 1 instance(s)
<snip>
Okay, here's a little more information. I'm cross-posting this in
darwin-kernel since it deals with some kernel internals. In the
terminal window the command generates:
[12-247-46-43:projects/tulip/build] cremes% sudo kextunload tulip.kext/
unload kext tulip.kext/ failed (result code 0xdc004002)
I don't mean to SPAM this list, but here's a teeny bit more info. I
changed the start() routine in my com_chuck_iokit_tulip_pnic2 subclass
(which now directly inherits from com_chuck_iokit_tulip to get the
dec2114x subclass out of the way). The start() routine now exits with a
failure immediately and doesn't do *any* object allocation, so this
eliminates the com_cremes_eeprom classes from the picture.
As soon as start() exits, the system calls free(). I always check for
the existence of each object before calling release on it, so this
should essentially skip to the end where it calls
IOEthernetController::free(). I still get this output:
: Can't unload com.chuck.iokit.tulip due to -
: com.chuck.iokit.tulip: com_chuck_iokit_tulip has 1 instance(s)
: com.chuck.iokit.tulip: com_chuck_iokit_tulip_pnic2 has 1 instance(s)
I'm rapidly losing my hair because this doesn't make sense! It seems
like IOKit is keeping around some references to my classes and not
cleaning them up.
cr
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.