Re: ucom_free Fatal trap on shutdown / module unload

From: Hans Petter Selasky <hps_at_selasky.org>
Date: Mon, 23 Jun 2014 04:55:46 +0200
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
Received on Mon Jun 23 2014 - 00:55:32 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:50 UTC