ucom_free Fatal trap on shutdown / module unload
Hans Petter Selasky
hps at selasky.org
Mon Jun 23 02:55:32 UTC 2014
On 06/23/14 03:30, Lundberg, Johannes wrote:
> Hi
>
> I tried replacing
> DRIVER_MODULE(uhso, uhub, uhso_driver, uhso_devclass, uhso_driver_loaded,
> 0);
> with
> DRIVER_MODULE_ORDERED(uhso, uhub, uhso_driver, uhso_devclass,
> uhso_driver_loaded, 0, SI_ORDER_ANY);
> but makes no difference..
>
> Don't know if its relevant but with ucom debug on I get a message just
> before crash in method ucom_close that it tries to close a connection that
> has already been closed.
>
Hi Johannes,
Try the opposite:
DRIVER_MODULE_ORDERED(uhso, uhub, uhso_driver, uhso_devclass,
uhso_driver_loaded, 0, SI_ORDER_MIDDLE + 1);
Because I suspect that the "uhso_ifnet_unit" unrhdr is freed before the
"fake" detach is executed:
> static int
> uhso_driver_loaded(struct module *mod, int what, void *arg)
> {
> switch (what) {
> case MOD_LOAD:
> /* register our autoinstall handler */
> uhso_etag = EVENTHANDLER_REGISTER(usb_dev_configured,
> uhso_test_autoinst, NULL, EVENTHANDLER_PRI_ANY);
> /* create our unit allocator for inet devs */
> uhso_ifnet_unit = new_unrhdr(0, INT_MAX, NULL);
> break;
> case MOD_UNLOAD:
> EVENTHANDLER_DEREGISTER(usb_dev_configured, uhso_etag);
> delete_unrhdr(uhso_ifnet_unit);
> break;
> default:
> return (EOPNOTSUPP);
> }
> return (0);
> }
Alternativly set "uhso_ifnet_unit" to NULL and check this in probe and
attach!
--HPS
--HPS
More information about the freebsd-current
mailing list