Hi, On 06/23/2013 04:51 PM, Xiaofan Chen wrote:
<snip> >> Hmm, can you run under gdb, and then do a backtrace when it hangs / >> crashes (when it hangs first do ctrl+c to return to gdb). >> >> IE: >> >> gdb ./examples/listdevs >>> run >> ... >>> bt > > A bit problematic to use gdb here. > > $ ./examples/listdevs > 0483:3748 (bus 1, device 2) > Abort trap (core dumped) > $ gdb ./examples/listdevs > GNU gdb 6.3 > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as > "i386-unknown-openbsd5.2"..."/home/mcuee/Desktop/build/libusbx/libusbx-1.0.16-rc1/examples/listdevs": > not in executable format: File format not recognized > > (gdb) run > Starting program: > No executable file specified. > Use the "file" or "exec-file" command. > (gdb) file ./examples/listdevs > "/home/mcuee/Desktop/build/libusbx/libusbx-1.0.16-rc1/examples/listdevs": > not in executable format: File format not recognized > (gdb) quit > > But I solved the problem by using --disable-shared > configure option. > > $ gdb ./examples/listdevs > GNU gdb 6.3 > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i386-unknown-openbsd5.2"... > (gdb) run > Starting program: > /home/mcuee/Desktop/build/libusbx/libusbx-1.0.16-rc1/examples/listdevs > 0483:3748 (bus 1, device 2) > > Program received signal SIGABRT, Aborted. > 0x0cfda98d in kill () from /usr/lib/libc.so.65.0 > (gdb) bt > #0 0x0cfda98d in kill () from /usr/lib/libc.so.65.0 > #1 0x0d046545 in abort () at /usr/src/lib/libc/stdlib/abort.c:68 > #2 0x0a779065 in _rthread_mutex_lock (mutexp=0x853a2d18, trywait=0, > abstime=0x0) at /usr/src/lib/librthread/rthread_sync.c:127 > #3 0x1c001f13 in usbi_disconnect_device (dev=0x853a2800) at core.c:576 > #4 0x1c001ffe in libusb_unref_device (dev=0x853a2800) at core.c:991 > #5 0x1c002dd6 in libusb_exit (ctx=0x853a2d00) at core.c:1920 > #6 0x1c001295 in main () at listdevs.c:69 > (gdb) quit > The program is running. Exit anyway? (y or n) y Thanks, that explains what is going on. I've just pushed 2 commits to fix this. I would appreciate it if you could first run with only the first commit applied: "core: Only do hotplug cleanup for hotplug capable backends" Then you should get a warning on exit saying that some libusb_devices were leaked. Then try again with both commits present in your build, so also the: "openbsd: Fix memleak in obsd_get_device_list()" Commit and then that warning should be gone. Thanks & Regards, Hans ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel