On Sun, Jun 23, 2013 at 1:55 AM, Hans de Goede <hdego...@redhat.com> wrote:
> On 06/22/2013 04:00 PM, Xiaofan Chen wrote:
>>> I found a regression under NetBSD 6.0 VM. 1.01.5 release
>>> works ok. 1.0.16-rc1 got a hang with the listdevs example.
>>
>>
>> Same regression happens under my OpenBSD 5.2VM.
>>
>> $ export LIBUSB_DEBUG=5
>> $ ./examples/listdevs
>> libusbx: debug [libusb_init] created default context
>> libusbx: debug [libusb_init] libusbx v1.0.16.10755
>> libusbx: debug [usbi_add_pollfd] add fd 3 events 1
>> libusbx: debug [usbi_add_pollfd] add fd 5 events 1
>> libusbx: debug [libusb_get_device_list]
>> libusbx: debug [obsd_get_device_list]
>> libusbx: debug [_cache_active_config_descriptor] fd 7
>> libusbx: debug [_cache_active_config_descriptor] active bLength 9
>> libusbx: debug [_cache_active_config_descriptor] index -1, len 39
>> libusbx: debug [obsd_get_device_descriptor]
>> libusbx: debug [libusb_get_device_descriptor]
>> 0483:3748 (bus 1, device 2)
>> libusbx: debug [libusb_exit]
>> libusbx: debug [libusb_exit] destroying default context
>> Abort trap (core dumped)
>
> 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

BTW, there is a minor waning during compile. But I think
it is not a real problem.

$ ./configure --enable-examples-build --enable-tests-build --disable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... i386-unknown-openbsd5.2
checking host system type... i386-unknown-openbsd5.2
checking how to print strings... print -r
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking how to convert i386-unknown-openbsd5.2 file names to
i386-unknown-openbsd5.2 format... func_convert_file_noop
checking how to convert i386-unknown-openbsd5.2 file names to
toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... match_pattern
/lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$
checking for dlltool... no
checking how to associate runtime and link libraries... print -r --
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... openbsd5.2 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for windres... no
checking for inline... inline
checking whether gcc and cc understand -c and -o together... yes
checking operating system... OpenBSD
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/timerfd.h usability... no
checking sys/timerfd.h presence... no
checking for sys/timerfd.h... no
checking whether TFD_NONBLOCK is declared... no
checking whether to use timerfd for timing... no (header not available)
checking for struct timespec... yes
checking for sigaction... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for gettimeofday... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libusb-1.0.pc
config.status: creating Makefile
config.status: creating libusb/Makefile
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating doc/doxygen.cfg
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
$ make
make  all-recursive
Making all in libusb
  CC       libusb_1_0_la-core.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-io.lo
  CC       libusb_1_0_la-strerror.lo
  CC       libusb_1_0_la-sync.lo
  CC       libusb_1_0_la-hotplug.lo
  CC       libusb_1_0_la-threads_posix.lo
  CC       libusb_1_0_la-openbsd_usb.lo
  CC       libusb_1_0_la-poll_posix.lo
  CCLD     libusb-1.0.la
Making all in doc
Making all in examples
  CC       listdevs.o
  CCLD     listdevs
  CC       xusb.o
  CCLD     xusb
xusb.o(.text+0x1b6b): In function `test_device':
/home/mcuee/Desktop/build/libusbx/libusbx-1.0.16-rc1/examples/xusb.c:172:
warning: sprintf() is often misused, please use snprintf()
  CC       fxload-ezusb.o
  CC       fxload-fxload.o
  CCLD     fxload
  CC       hotplugtest.o
  CCLD     hotplugtest
  CC       dpfp.o
  CCLD     dpfp
  CC       dpfp_threaded-dpfp_threaded.o
  CCLD     dpfp_threaded
  CC       sam3u_benchmark.o
  CCLD     sam3u_benchmark
Making all in tests
  CC       stress.o
  CC       testlib.o
  CCLD     stress



-- 
Xiaofan

------------------------------------------------------------------------------
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

Reply via email to