Segfault and gr-fcd

Hi all,

I’m just using the gr-fcd block with an funcube dongle on a gentoo linux
system.

When I try to change the frequency of the dongle by an slider I get the
following segfault:

[ 633.104902] usb 1-5.1: link qh1-0e01/ffff8801251cba00 start 0 [1/3
us]
[ 633.105563] ehci_hcd 0000:00:12.2: reused qh ffff8801251cb580
schedule
[ 633.105574] usb 1-5.1: link qh1-0e01/ffff8801251cb580 start 0 [3/1
us]
[ 633.106207] usb 1-5.1: unlink qh1-0e01/ffff8801251cb580 start 0 [3/1
us]
[ 633.108227] usb 1-5.1: unlink qh1-0e01/ffff8801251cba00 start 0 [1/3
us]
[ 633.108674] ehci_hcd 0000:00:12.2: reused qh ffff8801251cba00
schedule
[ 633.108683] usb 1-5.1: link qh1-0e01/ffff8801251cba00 start 0 [1/3
us]
[ 633.108771] usb 1-5.1: unlink qh1-0e01/ffff8801251cba00 start 0 [1/3
us]
[ 636.943732] gr_fcdtest.py[1645]: segfault at 30 ip 00007f47dadb4c4b
sp 00007fff5e94bff0 error 4 in libusb-1.0.so.0.1.0[7f47dadaf000+10000]

( Taken from the message log )

So I compiled libusb with debug information.

This is the output:

libusb:debug [libusb_get_device_list]
libusb:debug [sysfs_scan_device] scan usb1
libusb:debug [sysfs_scan_device] bus=1 dev=1
libusb:debug [enumerate_device] busnum 1 devaddr 1 session_id 257
libusb:debug [enumerate_device] allocating new device for 1/1 (session
257)
libusb:debug [sysfs_scan_device] scan usb2
libusb:debug [sysfs_scan_device] bus=2 dev=1
libusb:debug [enumerate_device] busnum 2 devaddr 1 session_id 513
libusb:debug [enumerate_device] allocating new device for 2/1 (session
513)
libusb:debug [sysfs_scan_device] scan usb3
libusb:debug [sysfs_scan_device] bus=3 dev=1
libusb:debug [enumerate_device] busnum 3 devaddr 1 session_id 769
libusb:debug [enumerate_device] allocating new device for 3/1 (session
769)
libusb:debug [sysfs_scan_device] scan usb4
libusb:debug [sysfs_scan_device] bus=4 dev=1
libusb:debug [enumerate_device] busnum 4 devaddr 1 session_id 1025
libusb:debug [enumerate_device] allocating new device for 4/1 (session
1025)
libusb:debug [sysfs_scan_device] scan usb5
libusb:debug [sysfs_scan_device] bus=5 dev=1
libusb:debug [enumerate_device] busnum 5 devaddr 1 session_id 1281
libusb:debug [enumerate_device] allocating new device for 5/1 (session
1281)
libusb:debug [sysfs_scan_device] scan usb6
libusb:debug [sysfs_scan_device] bus=6 dev=1
libusb:debug [enumerate_device] busnum 6 devaddr 1 session_id 1537
libusb:debug [enumerate_device] allocating new device for 6/1 (session
1537)
libusb:debug [sysfs_scan_device] scan usb7
libusb:debug [sysfs_scan_device] bus=7 dev=1
libusb:debug [enumerate_device] busnum 7 devaddr 1 session_id 1793
libusb:debug [enumerate_device] allocating new device for 7/1 (session
1793)
libusb:debug [sysfs_scan_device] scan 1-5
libusb:debug [sysfs_scan_device] bus=1 dev=4
libusb:debug [enumerate_device] busnum 1 devaddr 4 session_id 260
libusb:debug [enumerate_device] allocating new device for 1/4 (session
260)
libusb:debug [sysfs_scan_device] scan 3-1
libusb:debug [sysfs_scan_device] bus=3 dev=2
libusb:debug [enumerate_device] busnum 3 devaddr 2 session_id 770
libusb:debug [enumerate_device] allocating new device for 3/2 (session
770)
libusb:debug [discovered_devs_append] need to increase capacity
libusb:debug [sysfs_scan_device] scan 3-2
libusb:debug [sysfs_scan_device] bus=3 dev=3
libusb:debug [enumerate_device] busnum 3 devaddr 3 session_id 771
libusb:debug [enumerate_device] allocating new device for 3/3 (session
771)
libusb:debug [sysfs_scan_device] scan 1-5.1
libusb:debug [sysfs_scan_device] bus=1 dev=5
libusb:debug [enumerate_device] busnum 1 devaddr 5 session_id 261
libusb:debug [enumerate_device] allocating new device for 1/5 (session
261)
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_active_config_descriptor]
libusb:debug [sysfs_get_active_config_descriptor] active configuration 1
libusb:debug [sysfs_get_active_config_descriptor] active configuration 1
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_active_config_descriptor]
libusb:debug [sysfs_get_active_config_descriptor] active configuration 1
libusb:debug [sysfs_get_active_config_descriptor] active configuration 1
libusb:debug [libusb_get_device_descriptor]
libusb:debug [libusb_get_active_config_descriptor]
libusb:debug [sysfs_get_active_config_descriptor] active configuration 1
libusb:debug [sysfs_get_active_config_descriptor] active configuration 1
libusb:debug [parse_endpoint] skipping descriptor 25
libusb:debug [libusb_open] open 1.5
libusb:debug [op_open] opening /dev/bus/usb/001/005
libusb:debug [usbi_add_pollfd] add fd 9 events 4
Speicherzugriffsfehler

The python code is attached.

Volker

On Sat, Apr 7, 2012 at 4:21 PM, Volker S. [email protected] wrote:

Hi all,

I’m just using the gr-fcd block with an funcube dongle on a gentoo linux
system.

When I try to change the frequency of the dongle by an slider I get the
following segfault:

Hi Volker,

Although using a slider to tune hardware pll is a bad idea, I don’t
think the crash you see is because of that. It sounds more like an
issue some people have seen on debian with libusb 1.0.9-pre-something

Which version of libusb do you have? Can you run the included examples
and qthid without crash?

PS: The slider in your example isn’t doing much as it has only one step
:wink:

Alex

Hi Alex,
thank you for the quick response.

Hi Volker,

Although using a slider to tune hardware pll is a bad idea, I don’t
think the crash you see is because of that. It sounds more like an
issue some people have seen on debian with libusb 1.0.9-pre-something

Which version of libusb do you have? Can you run the included examples
and qthid without crash?
I’m using libusb-1.0.9_rc3. I get a similar problem using qthid. qthid
crashes before showing up the gui.
I think, libusb has a problem multiple open and closing the device. So I
just changed the code of qthid to open the device only at the beginning
and keep it open. Then qthid works.
PS: The slider in your example isn’t doing much as it has only one step :wink:
I know, but it was the easiest way to show the problem.

Perhaps I should downgrade libusb.

Volker

Downgrading to libusb-1.0.8 solved the problem. I only see some messages
like

libusb:error [libusb_cancel_transfer] cancel transfer failed error -5
libusb:error [libusb_cancel_transfer] cancel transfer failed error -5
libusb:error [libusb_cancel_transfer] cancel transfer failed error -5
aUaUaUaUaUaUaUaUlibusb:error [libusb_cancel_transfer] cancel transfer
failed error -5
aUaUaUaUlibusb:error [libusb_cancel_transfer] cancel transfer failed
error -5
libusb:error [libusb_cancel_transfer] cancel transfer failed error -5
libusb:error [libusb_cancel_transfer] cancel transfer failed error -5
libusb:error [libusb_cancel_transfer] cancel transfer failed error -5

But no segfault anymore.

Am 07.04.2012 17:38, schrieb Volker S.:

Hi All,

As mentioned, could this be a libusb problem (conflict)? When running
F14 I
could not run any USB gadget many minutes. I got error “Disconnected”
Tried the same gadgets on Fedora 16 and all works infinitely (wont
disconnect).

My libusb versions are shown by executing $ rpm -qa | grep -i libusb

Fedora 14
libusb-devel-0.1.12-23.fc14.i686
libusb1-1.0.8-1.fc14.i686
libusb-0.1.12-23.fc14.i686

Fedora 16
libusb-0.1.3-9.fc16.i686
libusb-devel-0.1.3-9.fc16.i686
libusb1-1.0.9-0.3.rc1.fc16.i686

Patrik

----- Original Message -----
From: “Alexandru C.” [email protected]
To: [email protected]
Sent: Saturday, April 07, 2012 18:20
Subject: Re: [Discuss-gnuradio] segfault and gr-fcd

Interesting, because it seems to be the other way around with the
funcube dongle, i.e. 1.0.8 works and 1.0.9-rc crashes.
Note though that when you compile yourself you will use 0.1

Alex

Glad to hear yo have better luck with libusb 1.0.8.
Concerning the errors you see, I don’t know how severe they are. There
are two layers between gr-fcd and libusb and I have knowledge only
with the higher levels.

Alex

Oh, tricky…

Patrik

----- Original Message -----
From: “Alexandru C.” [email protected]
To: “Patrik T.” [email protected]
Cc: [email protected]
Sent: Saturday, April 07, 2012 20:37
Subject: Re: [Discuss-gnuradio] segfault and gr-fcd