Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2007 13:08:05 -0700
From:      "Victor Liu" <victor.liu@gmail.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        bug-followup@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: usb/114310: USB hub attachment panics kernel during libusb device scan
Message-ID:  <a58ca4220707061308s6481b2c0m35e647a915f69f2f@mail.gmail.com>
In-Reply-To: <20070706.133037.-1540390124.imp@bsdimp.com>
References:  <200707050410.l654AARS029968@freefall.freebsd.org> <a58ca4220707061007w66ff866esba5adbd4781ac7ed@mail.gmail.com> <20070706.133037.-1540390124.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Here is the code I just used to panic it just now (requires libusb):
/////////// usbtest.c:
#include "/usr/local/include/usb.h"

int main(int argc, char **argv){
	while(1){
		usb_init ();
		usb_find_busses ();
		usb_find_devices ();
	}
	return 0;
}
//////////// Makefile:
CC=gcc
LD=ld
CFLAGS = -g -c -Wall

all: usbtest.o
	$(CC) -o usbtest usbtest.o /usr/local/lib/libusb.a

clean:
	rm -f usbtest usbtest.tgz *.o *~


It took me about 15 plug-in/unplug cycles to get it to crash
(sometimes as many as 30 during previous testing when I'm unlucky).
There's about a 200ms window during which the panic will occur, and
it's hard to say exactly when that is. You can probably add a printf
to given an indication of where in the loop you're plugging in the
hub, so you can change the timing around a bit.

-victor

On 7/6/07, M. Warner Losh <imp@bsdimp.com> wrote:
> Thanks for the update Victor.
>
> I can't get it to happen in current.  Maybe I'm doing something
> differently than you.  Do you have an easy recipe for causing the
> panic?
>
> Warner
>
> In message: <a58ca4220707061007w66ff866esba5adbd4781ac7ed@mail.gmail.com>
>             "Victor Liu" <victor.liu@gmail.com> writes:
> : Managed to find a newer box, and yes, I could duplicate the panic
> : within less than 10 attachments. uname -a:
> : FreeBSD xxxxxxxxxxxxxxxxxx 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan
> : 12 11:05:30 UTC 2007
> : xxxxxxxxxxxxxxxxxxxxxxxxxxxx:/usr/obj/usr/src/sys/SMP  i386
> :
> : -victor
> :
> : On 7/4/07, M. Warner Losh <imp@bsdimp.com> wrote:
> : > The following reply was made to PR usb/114310; it has been noted by GNATS.
> : >
> : > From: "M. Warner Losh" <imp@bsdimp.com>
> : > To: victor.liu@gmail.com
> : > Cc: freebsd-gnats-submit@FreeBSD.org
> : > Subject: Re: usb/114310: USB hub attachment panics kernel during libusb
> : >  device scan
> : > Date: Wed, 04 Jul 2007 22:03:35 -0600 (MDT)
> : >
> : >  Would you happen to know if this happens on FreeBSD -current?
> : >
> : >  Warner
> : > _______________________________________________
> : > freebsd-usb@freebsd.org mailing list
> : > http://lists.freebsd.org/mailman/listinfo/freebsd-usb
> : > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org"
> : >
> :
> :
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a58ca4220707061308s6481b2c0m35e647a915f69f2f>