From owner-freebsd-current@FreeBSD.ORG Mon Jun 23 05:34:54 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69067209 for ; Mon, 23 Jun 2014 05:34:54 +0000 (UTC) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 349662E90 for ; Mon, 23 Jun 2014 05:34:53 +0000 (UTC) Received: by mail-ig0-f175.google.com with SMTP id h3so2569188igd.2 for ; Sun, 22 Jun 2014 22:34:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=gb15wQFGY1xiUpOhWNJUbB4s7bgWXKfYwKtLvREOS1U=; b=Mn4xpkNvcK8Lngldm9F4CHA+k2Qn2NqnSBBdryQoRE2WkOwSqDnokS7UGVeStx6T/F WD7GwWNjMTv3w3Hw7/VUA6t7m/2gMPVZseVB4SG3Kb6pVUagcp2TMH2pT5Ig6/i7wH4l LN6gpGLkkQU41Eq3CGFw+lrAM92RGmFQNa/eIX3P9Gq/SDGVBHNmD8h1BWU4v5OscJ7z frtIBpXbu4XWoUCK5g1+ov3DZ1Da7Pdm4pJt2RF30DUDdDm+PAwjryAke/ObKnOzXUqJ nrMUvuY/rSTZUrsg9PbD7qN/Y/uSSZfBy6UTaETQF2LQ11OdcBMi9MJY1aldlW9B5VYL taHA== X-Gm-Message-State: ALoCoQmVonFp1U4fAOjy1Tclg0Yzsrc8n8n9nSi59JA1jEuPhcKFwP/UYW/Jf0+QIXxwVoVIEmMq4boiKX21EugQdxdiMszD3BqPv0q6Rci+krgxiEz1UQ4= X-Received: by 10.50.23.109 with SMTP id l13mr2859870igf.46.1403501691433; Sun, 22 Jun 2014 22:34:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.43.69.131 with HTTP; Sun, 22 Jun 2014 22:34:36 -0700 (PDT) In-Reply-To: <53A79732.6060705@selasky.org> References: <53A3E81B.5050805@selasky.org> <53A79732.6060705@selasky.org> From: "Lundberg, Johannes" Date: Mon, 23 Jun 2014 14:34:36 +0900 Message-ID: Subject: Re: ucom_free Fatal trap on shutdown / module unload To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2014 05:34:54 -0000 I added some logging to see what is going on and this is what I got (none of the proposed solution solved the problem) uhso_detach gets called 7 times (for oid 0-6). It crashes the 2nd time on the call usbd_transfer_unsetup(sc->sc_xfer, 3); -- Johannes Lundberg BRILLIANTSERVICE CO., LTD. On Mon, Jun 23, 2014 at 11:55 AM, Hans Petter Selasky wrote: > 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 th= at >> 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 =3D EVENTHANDLER_REGISTER(usb_dev_configured, >> uhso_test_autoinst, NULL, EVENTHANDLER_PRI_ANY); >> /* create our unit allocator for inet devs */ >> uhso_ifnet_unit =3D 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 > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- =E7=A7=98=E5=AF=86=E4=BF=9D=E6=8C=81=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=EF= =BC=9A=E3=81=93=E3=81=AE=E9=9B=BB=E5=AD=90=E3=83=A1=E3=83=BC=E3=83=AB=E3=81= =AF=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E3=81=AB=E9=80=81=E4=BF=A1=E3=81=97= =E3=81=9F=E3=82=82=E3=81=AE=E3=81=A7=E3=81=82=E3=82=8A=E3=80=81=E7=A7=98=E5= =8C=BF=E7=89=B9=E6=A8=A9=E3=81=AE=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81=AA=E3=82= =8B=E6=83=85=E5=A0=B1=E3=82=92=E5=90=AB=E3=82=93=E3=81=A7=E3=81=84=E3=81=BE= =E3=81=99=E3=80=82 =E3=82=82=E3=81=97=E3=80=81=E5=90=8D=E5=AE=9B=E4=BA=BA=E4=BB=A5=E5=A4=96=E3= =81=AE=E6=96=B9=E3=81=8C=E5=8F=97=E4=BF=A1=E3=81=95=E3=82=8C=E3=81=9F=E5=A0= =B4=E5=90=88=E3=80=81=E3=81=93=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AE= =E7=A0=B4=E6=A3=84=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E3=81=93=E3=81=AE=E3= =83=A1=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=B8=80=E5=88= =87=E3=81=AE=E9=96=8B=E7=A4=BA=E3=80=81 =E8=A4=87=E5=86=99=E3=80=81=E9=85=8D=E5=B8=83=E3=80=81=E3=81=9D=E3=81=AE=E4= =BB=96=E3=81=AE=E5=88=A9=E7=94=A8=E3=80=81=E3=81=BE=E3=81=9F=E3=81=AF=E8=A8= =98=E8=BC=89=E5=86=85=E5=AE=B9=E3=81=AB=E5=9F=BA=E3=81=A5=E3=81=8F=E3=81=84= =E3=81=8B=E3=81=AA=E3=82=8B=E8=A1=8C=E5=8B=95=E3=82=82=E3=81=95=E3=82=8C=E3= =81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=8A=E9=A1=98=E3=81=84=E7=94=B3=E3=81= =97=E4=B8=8A=E3=81=92=E3=81=BE=E3=81=99=E3=80=82 --- CONFIDENTIALITY NOTE: The information in this email is confidential and intended solely for the addressee. Disclosure, copying, distribution or any other action of use of this email by person other than intended recipient, is prohibited. If you are not the intended recipient and have received this email in error, please destroy the original message.