Re: Socket filter's sf_unregistered func not getting called -- occasionally
Re: Socket filter's sf_unregistered func not getting called -- occasionally
- Subject: Re: Socket filter's sf_unregistered func not getting called -- occasionally
- From: Josh Graessley <email@hidden>
- Date: Sat, 2 Dec 2006 20:29:31 -0800
Attaching using gdb and running the script showallstacks that comes
from the kgmacros will sometimes be enlightening. If I remember
correctly, the socket filter will only fail to unregister if one of
your socket filter functions is currently running. It has been a year
or so since I looked at that stuff though, so I may be off a little,
and there's always the possibility of a bug or two.
-josh
On Dec 2, 2006, at 7:14 PM, Greg Miller wrote:
Hi folks,
I'm playing around with socket filters (sys/kpi_socketfilter.h) on
10.4.8 on Intel, mostly just to experiment and learn. I followed the
tcplognke sample code pretty closely (the code from 11/27,
http://developer.apple.com/samplecode/tcplognke/) and wrote a small
KEXT that basically just logs messages when the sf_notify function is
called. However, I noticed that occasionally the KEXT would fail to
unload. The call to sflt_unregister() succeeded, but my
sf_unregistered function was never getting called back.
To eliminate my code as a suspect, I tried this with the tcplognke
code itself, and it seems to exhibit the same behavior. I have read
the docs and code comments that explain that "[sflt_unregister()] will
not detach the socket filter from all sockets it may be attached to at
the time, it will just prevent the socket filter from being attached
to any new sockets", but the issue seems to be that sometimes the
sf_unregistered function is never called, and so the socket filter can
never safely be unloaded.
Again, this only seems to happen on occasion, and it doesn't seem to
be related to Intel (I've seen it on my G5 as well). When it happens,
it's typically after maybe 5 - 10 minutes of usage with network
traffic.
Am I missing something obvious? Is it a known issue that sometimes
socket filters won't be able to unload?
Thanks in advance.
Greg
--
Greg Miller
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden