From: Deti F. <de...@fl...> - 2012-09-01 12:48:10
|
Hi TinY, you can fix the problem by using libusb instead of libusb-1.0. Try the Openwrt-Makefile attached to this mail. Deti On 8/20/12 2:07 AM, TinY One wrote: > Hi Marcus, > > I have been stepping through the debugger and found that the program > actually crash at the libusb_get_device_list while trying to initialise > the camera > > These are the port configuration in my box > > =========================== > Port Configurations > =========================== > root@OpenWrt:~# gphoto2 --list-ports > Devices found: 5 > Path Description > -------------------------------------------------------------- > ptpip: PTP/IP Connection > serial:/dev/ttyS0 Serial Port 0 > usb:001,003 Universal Serial Bus > usb:001,004 Universal Serial Bus > usbdiskdirect:/dev/sda USB Mass Storage direct IO > > > root@OpenWrt:~# lsusb > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB > Bus 001 Device 003: ID 0781:5571 SanDisk Corp. > Bus 001 Device 004: ID 04b0:0421 Nikon Corp. > > This is the command I executed ==>gdbserver :9000 gphoto2 > --port=usb:001,004 --camera="Nikon DSC D90 (PTP Mode)" --summary --debug > --debug-logfile=my-logfile.txt > > The initial port discovery in gphoto2 seems fine... managed to find 4 > usb devices in the gphoto2-port-info-list > > =========================== > USB desc from gdb > =========================== > The gp_port_library_list found 4 ports > > Device 0 > {bLength = 18 '\022', bDescriptorType = 1 '\001', bcdUSB = 512, > bDeviceClass = 9 '\t', > bDeviceSubClass = 0 '\000', bDeviceProtocol = 1 '\001', > bMaxPacketSize0 = 64 '@', idVendor = 7531, > idProduct = 2, bcdDevice = 771, iManufacturer = 3 '\003', iProduct = > 2 '\002', iSerialNumber = 1 '\001', > bNumConfigurations = 1 '\001'} > Device 1 > {bLength = 18 '\022', bDescriptorType = 1 '\001', bcdUSB = 512, > bDeviceClass = 9 '\t', > bDeviceSubClass = 0 '\000', bDeviceProtocol = 1 '\001', > bMaxPacketSize0 = 64 '@', idVendor = 1507, > idProduct = 1544, bcdDevice = 30564, iManufacturer = 0 '\000', > iProduct = 1 '\001', iSerialNumber = 0 '\000', > bNumConfigurations = 1 '\001'} > Device 2 > {bLength = 18 '\022', bDescriptorType = 1 '\001', bcdUSB = 512, > bDeviceClass = 0 '\000', > bDeviceSubClass = 0 '\000', bDeviceProtocol = 0 '\000', > bMaxPacketSize0 = 64 '@', idVendor = 1921, > idProduct = 21873, bcdDevice = 290, iManufacturer = 1 '\001', > iProduct = 2 '\002', iSerialNumber = 3 '\003', > bNumConfigurations = 1 '\001'} > Device 3 > {bLength = 18 '\022', bDescriptorType = 1 '\001', bcdUSB = 512, > bDeviceClass = 0 '\000', > bDeviceSubClass = 0 '\000', bDeviceProtocol = 0 '\000', > bMaxPacketSize0 = 64 '@', idVendor = 1200, > idProduct = 1057, bcdDevice = 256, iManufacturer = 1 '\001', iProduct > = 2 '\002', iSerialNumber = 3 '\003', > bNumConfigurations = 1 '\001'} > > =========================== > Snapshot of the gphoto2 log > =========================== > 1.172055 gphoto2-port-info-list(2): Could not load port driver list: > 'Unspecified error'. > 1.192850 gphoto2-port-info-list(2): Called for filename > '/usr/lib/libgphoto2_port/0.8.0/ptpip'. > 1.520400 gphoto2-port-info-list(2): Loaded 'PTP/IP Connection' > ('ptpip:') from '/usr/lib/libgphoto2_port/0.8.0/ptpip'. > 1.547936 gphoto2-port-info-list(2): Loaded '' ('^ptpip') from > '/usr/lib/libgphoto2_port/0.8.0/ptpip'. > 1.574023 gphoto2-port-info-list(2): Called for filename > '/usr/lib/libgphoto2_port/0.8.0/serial'. > 1.917965 gphoto2-port-info-list(2): Loaded 'Serial Port 0' > ('serial:/dev/ttyS0') from '/usr/lib/libgphoto2_port/0.8.0/serial'. > 1.945314 gphoto2-port-info-list(2): Loaded '' ('^serial') from > '/usr/lib/libgphoto2_port/0.8.0/serial'. > 1.971192 gphoto2-port-info-list(2): Called for filename > '/usr/lib/libgphoto2_port/0.8.0/usb1'. > 2.327202 gphoto2-port-info-list(2): Loaded '' ('^usb:') from > '/usr/lib/libgphoto2_port/0.8.0/usb1'. > 2.353230 gphoto2-port-info-list(2): Loaded 'Universal Serial Bus' > ('usb:001,003') from '/usr/lib/libgphoto2_port/0.8.0/usb1'. > 2.380613 gphoto2-port-info-list(2): Loaded 'Universal Serial Bus' > ('usb:001,004') from '/usr/lib/libgphoto2_port/0.8.0/usb1'. > 2.407724 gphoto2-port-info-list(2): Called for filename > '/usr/lib/libgphoto2_port/0.8.0/usbdiskdirect'. > 2.733336 gphoto2-port-info-list(2): Loaded 'USB Mass Storage direct IO' > ('usbdiskdirect:/dev/sda') from > '/usr/lib/libgphoto2_port/0.8.0/usbdiskdirect'. > 2.760780 gphoto2-port-info-list(2): Called for filename > '/usr/lib/libgphoto2_port/0.8.0/usbscsi'. > 3.098742 gphoto2-port-info-list(2): Counting entries (9 available)... > 3.120579 gphoto2-port-info-list(2): 5 regular entries available. > 3.155843 gphoto2-port-info-list(2): Looking for path 'usb:001,004' (9 > entries available)... > 3.179534 gphoto2-port-info-list(2): Getting info of entry 3 (9 > available)... > 3.203256 gphoto2-camera(2): Setting port info for port 'Universal Serial > Bus' at 'usb:001,004'... > 3.416306 gphoto2-port(2): Setting timeout to 5000 milliseconds... > 3.436781 gphoto2-port(2): Setting settings... > 3.453708 libusb1(2): gp_port_usb_update(old int=0, conf=-1, alt=-1), > (new int=0, conf=-1, alt=-1) > 3.496945 setting/gphoto2-setting.c(2): Creating $HOME/.gphoto > 3.514409 setting/gphoto2-setting.c(2): Loading settings from file > "/root/.gphoto/settings" > 3.534946 gphoto2-setting(2): Setting key 'port' to value 'usb:001,004' > (gphoto2) > 3.561675 gphoto2-setting(2): Saving 2 setting(s) to file > "/root/.gphoto/settings" > 3.597505 main(2): Processing 'model' option ('Nikon DSC D90 (PTP Mode)')... > 3.617985 gphoto2-abilities-list(2): Using ltdl to load camera libraries > from '/usr/lib/libgphoto2/2.4.12'... > > However, after gphoto2 loaded the driver, during camera initialization > the segmentation error occurs at the libusb_get_device_list (NULL, > &devs) function, which was running fine during ports listing > > =========================== > Snapshot of the gphoto2 log > =========================== > > 5.040795 gp-abilities-list(2): Found 63 camera drivers. > 29.555861 gphoto2-camera(2): Setting abilities ('Nikon DSC D90 (PTP > mode)')... > 29.577872 gphoto2-setting(2): Setting key 'model' to value 'Nikon DSC > D90 (PTP mode)' (gphoto2) > 29.605504 gphoto2-setting(2): Saving 2 setting(s) to file > "/root/.gphoto/settings" > 29.648197 gphoto2-camera(2): Initializing camera... > > =========================== > gdb backtrace > =========================== > GDB command ==> ./scripts/remote-gdb 192.168.3.1:9000 > <http://192.168.3.1:9000> > ./staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/gphoto2 > > Using target mips_r2 (uClibc-0.9.33.2) > GNU gdb (Linaro GDB) 7.2-2011.03-0 > Copyright (C) 2010 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > <http://gnu.org/licenses/gpl.html> > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "--host=i686-linux-gnu > --target=mips-openwrt-linux-uclibc". > For bug reporting instructions, please see: > <http://bugs.launchpad.net/gdb-linaro/>... > Reading symbols from > /home/XXX/openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/gphoto2...done. > warning: Can not parse XML target description; XML support was disabled > at compile time > 0x770f2f60 in _start () from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/lib/ld-uClibc.so.0 > (gdb) b libusb1.c:99 > No source file named libusb1.c. > Make breakpoint pending on future shared library load? (y or [n]) y > Breakpoint 1 (libusb1.c:99) pending. > (gdb) c > Continuing. > > ============================ > + device listing OK during port listing + > ============================ > Breakpoint 1, load_devicelist () at libusb1.c:99 > 99 nrofdevs = libusb_get_device_list (NULL, &devs); > (gdb) c > Continuing. > warning: Temporarily disabling breakpoints for unloaded shared library > "/home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libgphoto2_port/0.8.0/usb1.so" > > =================================== > + device listing FAILED when initialing camera + > =================================== > Breakpoint 1, load_devicelist () at libusb1.c:99 > 99 nrofdevs = libusb_get_device_list (NULL, &devs); > (gdb) c > Continuing. > > Program received signal SIGSEGV, Segmentation fault. > 0x770aaa6c in pthread_mutex_lock () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/lib/libpthread.so.0 > (gdb) bt > #0 0x770aaa6c in pthread_mutex_lock () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/lib/libpthread.so.0 > #1 0x76e16aa4 in usbi_get_device_by_session_id () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libusb-1.0.so.0 > #2 0x76e1ee48 in enumerate_device () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libusb-1.0.so.0 > #3 0x76e1f234 in op_get_device_list () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libusb-1.0.so.0 > #4 0x76e16e14 in libusb_get_device_list () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libusb-1.0.so.0 > #5 0x76e32cd8 in load_devicelist () at libusb1.c:99 > #6 0x76e3336c in gp_port_usb_find_device_lib (port=0x9a92f8, > idvendor=1200, idproduct=1057) at libusb1.c:769 > #7 0x76f40880 in gp_port_usb_find_device (port=<value optimized out>, > idvendor=<value optimized out>, idproduct=<value optimized out>) > at gphoto2-port.c:808 > #8 0x76f5b470 in gp_camera_init (camera=0x9a8018, context=0x9aa0c0) at > gphoto2-camera.c:739 > #9 0x76f5eeb0 in gp_camera_get_summary (camera=0x9a8018, > summary=0x7f985b60, context=0x9aa0c0) at gphoto2-camera.c:888 > #10 0x00407b1c in action_camera_summary (params=<value optimized out>) > at actions.c:797 > #11 0x0040d9e0 in cb_arg_run (ctx=<value optimized out>, reason=<value > optimized out>, opt=0x7f98e1e4, arg=0x9ab220 "Nikon DSC D90 (PTP Mode)", > data=0x7f98dd40) at main.c:1444 > #12 cb_arg (ctx=<value optimized out>, reason=<value optimized out>, > opt=0x7f98e1e4, arg=0x9ab220 "Nikon DSC D90 (PTP Mode)", data=0x7f98dd40) > at main.c:1568 > #13 0x76f0fa50 in invokeCallbacksOPTION () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libpopt.so.0 > #14 0x76f0f9c0 in invokeCallbacksOPTION () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libpopt.so.0 > #15 0x76f10c1c in poptGetNextOpt () > from > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/lib/libpopt.so.0 > #16 0x004058a8 in main (argc=6, argv=0x7f990ac4, envp=<value optimized > out>) at main.c:2184 > (gdb) c > Continuing. > > Program terminated with signal SIGSEGV, Segmentation fault. > The program no longer exists. > > > Any hints on how to proceed? > > > On Mon, Aug 20, 2012 at 1:19 AM, Marcus Meissner <mei...@su... > <mailto:mei...@su...>> wrote: > > On Sun, Aug 19, 2012 at 11:56:09AM +0800, Ong Tat Yeong wrote: > > Hi Marcus, > > > > Thanks for replying ;) > > > > Managed to get some backtrace from my box. > > > > Do you think it's suggesting that I should be looking at the > > libgphoto2-drivers? > > > > Thanks, TinY > > > > Program received signal SIGSEGV, Segmentation fault. > > 0x7705c64c in __pthread_initialize_minimal_internal () from > > > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/lib/libpthread.so.0 > > (gdb) bt > > #0 0x7705c64c in __pthread_initialize_minimal_internal () from > > > /home/XXX/openwrt/trunk/scripts/../staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/lib/libpthread.so.0 > > #1 0x76d93e48 in enumerate_device () > > It crashes during pthread initialization... > > I am not sure if we need to set up pthreads before starting up > gphoto2 ourselves, but > in general this should not crash, as basically the same code is used > in regular x86 Linux too. > > Ciao, Marcus > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > > _______________________________________________ > Gphoto-devel mailing list > Gph...@li... > https://lists.sourceforge.net/lists/listinfo/gphoto-devel > |