Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#641138: gpsbabel: Command line option "-f usb:1" causes segmentation fault.

61 views
Skip to first unread message

Konrad Schöbel

unread,
Sep 10, 2011, 1:50:02 PM9/10/11
to
Package: gpsbabel
Version: 1.4.2-3
Severity: normal

Dear Maintainer,

* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?

# gpsbabel -t -i garmin -f usb:1 -o gpx -F test.gpx
Speicherzugriffsfehler
# gpsbabel -i garmin -f usb:1
Speicherzugriffsfehler
# gpsbabel -f usb:1
No valid input type specified
# gpsbabel -i garmin -f usb:0
Claim interfaced failed: could not claim interface 0: Device or resource busy
# gpsbabel -i garmin -f usb:
Claim interfaced failed: could not claim interface 0: Device or resource busy

# tail /var/log/syslog
Sep 10 19:04:50 localhost kernel: usb 6-2: USB disconnect, device number 7
Sep 10 19:04:50 localhost kernel: garmin_gps ttyUSB1: Garmin GPS usb/tty converter now disconnected from ttyUSB1
Sep 10 19:04:50 localhost kernel: garmin_gps 6-2:1.0: device disconnected
Sep 10 19:04:59 localhost kernel: usb 6-2: new full speed USB device number 8 using uhci_hcd
Sep 10 19:05:00 localhost kernel: usb 6-2: New USB device found, idVendor=091e, idProduct=0003
Sep 10 19:05:00 localhost kernel: usb 6-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Sep 10 19:05:00 localhost kernel: garmin_gps 6-2:1.0: Garmin GPS usb/tty converter detected
Sep 10 19:05:00 localhost kernel: usb 6-2: Garmin GPS usb/tty converter now attached to ttyUSB1
Sep 10 19:05:00 localhost kernel: usb 6-2: USB disconnect, device number 8
Sep 10 19:05:00 localhost kernel: garmin_gps ttyUSB1: Garmin GPS usb/tty converter now disconnected from ttyUSB1
Sep 10 19:05:00 localhost kernel: garmin_gps 6-2:1.0: device disconnected
Sep 10 19:05:10 localhost kernel: usb 6-2: new full speed USB device number 9 using uhci_hcd
Sep 10 19:05:10 localhost kernel: usb 6-2: New USB device found, idVendor=091e, idProduct=0003
Sep 10 19:05:10 localhost kernel: usb 6-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Sep 10 19:05:10 localhost kernel: garmin_gps 6-2:1.0: Garmin GPS usb/tty converter detected
Sep 10 19:05:10 localhost kernel: usb 6-2: Garmin GPS usb/tty converter now attached to ttyUSB1
....
Sep 10 19:39:48 localhost kernel: gpsbabel[17737]: segfault at 0 ip 00007f1d10eb6594 sp 00007fff7ce42470 error 4 in libusb-0.1.so.4.4.4[7f1d10eb3000+7000]
Sep 10 19:41:04 localhost kernel: gpsbabel[17787]: segfault at 0 ip 00007f15b0724594 sp 00007fff81cc4ba0 error 4 in libusb-0.1.so.4.4.4[7f15b0721000+7000]

* What was the outcome of this action?

Speicherzugriffsfehler = Segmentation fault

* What outcome did you expect instead?

Download of track data or a proper error message.


-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to de_DE.utf8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gpsbabel depends on:
ii libc6 2.13-18
ii libexpat1 2.0.1-7
ii libusb-0.1-4 2:0.1.12-19
ii zlib1g 1:1.2.3.4.dfsg-3

Versions of packages gpsbabel recommends:
pn gpsbabel-doc <none>

gpsbabel suggests no packages.

-- no debconf information

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Bernd Zeimetz

unread,
Sep 12, 2011, 4:00:02 AM9/12/11
to
Hi,

On 09/10/2011 07:44 PM, Konrad Schöbel wrote:
[..]
> # tail /var/log/syslog
> Sep 10 19:04:50 localhost kernel: usb 6-2: USB disconnect, device number 7
> Sep 10 19:04:50 localhost kernel: garmin_gps ttyUSB1: Garmin GPS usb/tty converter now disconnected from ttyUSB1
> Sep 10 19:04:50 localhost kernel: garmin_gps 6-2:1.0: device disconnected
> Sep 10 19:04:59 localhost kernel: usb 6-2: new full speed USB device number 8 using uhci_hcd
> Sep 10 19:05:00 localhost kernel: usb 6-2: New USB device found, idVendor=091e, idProduct=0003
> Sep 10 19:05:00 localhost kernel: usb 6-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> Sep 10 19:05:00 localhost kernel: garmin_gps 6-2:1.0: Garmin GPS usb/tty converter detected

please try the following:
- unplug your gps
- run
rmmod garmin_gps
- attach your gps again
- try the commands you've used again
- also try to use /dev/ttyUSB0 as input device.


Thanks and cheers,

Bernd

--
Bernd Zeimetz Debian GNU/Linux Developer
http://bzed.de http://www.debian.org
GPG Fingerprints: ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F

Konrad Schöbel

unread,
Oct 23, 2011, 10:40:01 AM10/23/11
to
Dear Bernd,

2011/9/12 Bernd Zeimetz <be...@bzed.de>:
> please try the following:
> - unplug your gps
> - run
>   rmmod garmin_gps
> - attach your gps again
> - try the commands you've used again
> - also try to use /dev/ttyUSB0 as input device.

sorry for the delay. Here are my results:

--------------------------------------8<--------------------------------------
# # gps unplugged
# rmmod garmin_gps
ERROR: Module garmin_gps does not exist in /proc/modules
# # attaching gps
# gpsbabel -t -i garmin -f usb:0 -o gpx -F test.gpx
Claim interfaced failed: could not claim interface 0: Device or resource busy
# gpsbabel -t -i garmin -f usb:1 -o gpx -F test.gpx
Speicherzugriffsfehler
# gpsbabel -i garmin -f usb:1
Speicherzugriffsfehler
# gpsbabel -f usb:1
No valid input type specified
# gpsbabel -i garmin -f usb:0
Claim interfaced failed: could not claim interface 0: Device or resource busy
# gpsbabel -i garmin -f usb:
Claim interfaced failed: could not claim interface 0: Device or resource busy
# gpsbabel -t -i garmin -f /dev/ttyUSB0 -o gpx -F test.gpx
[ERROR] GPS_Packet_Read: Timeout. No data received.
GARMIN:Can't init /dev/ttyUSB0
# gpsbabel -t -i garmin -f /dev/ttyUSB1 -o gpx -F test.gpx
[ERROR] INIT: No table entry for ID 694

GARMIN:Can't init /dev/ttyUSB1
# gpsbabel -i garmin -f /dev/ttyUSB1
[ERROR] GPS_Packet_Read: Timeout. No data received.
[ERROR] INIT: No table entry for ID 254

GARMIN:Can't init /dev/ttyUSB1
--------------------------------------8<--------------------------------------

I hope this helps you any further. Do not hesitate to contact me again if you
need more information.

After playing around with plugging and unplugging the GPS device and putting
it in different modes I finally managed to get the GPS data out of the device
with the command:

# gpsbabel -t -i garmin -f /dev/ttyUSB1 -o gpx -F test.gpx


Cheers,

Konrad

Robert Lipe

unread,
Jun 15, 2021, 3:00:04 AM6/15/21
to
The OP doesn't mention what hardware they have, which makes this hard to say much about, but it looks like it's mixing two different use cases.

For "real" USB Garmins, as opposed to serial Garmins attached via a USB/Serial adapters, there are basically two different models for using Garmins with GPSBabel on Linux.

1) There is a Linux kernel module that grabs the USB interface, does "USB Garmin stuff", and then presents the device as /dev/ttyUSBwhatever to any apps that spoke the Garmin serial protocol.  This was neat for compatibility, but this driver never actually worked very well. (Sorry.)  To use this, you'd load the kernel module and then use serial driver name in the -f argument.
2) Let GPSBabel (almost) speak directly with the USB hardware. GPSBabel communicates via libusb directly to the hardware and is cognizant of all the (many, many) Garmin USB quirks and models. To use this, we'd use the name "usb" instead of a /dev node.   usb:-1 would list device names and usb:0 or usb:1 or whatever would handle the extremely uncommon case (unless you were me) of having multiple USB Garmins.

The problem with #1 is that it didn't actually work very well and didn't benefit from the wide exposure to Garmin hardware that GPSBabel natively did. In particular, it had problems with tracks and routes, IIRC. It also "hogged" the device and made it impossible for our libusb layer (the "-f usb:" stuff) to actually speak the device. This problem was so common that for a long time, we special cased the error message:

fatal("usb_set_configuration failed, probably because kernel driver '%s'\n is blocking our access to the USB device.\n"
"For more information see https://www.gpsbabel.org/os/Linux_Hotplug.html\n", drvnm);

The code still peeks through at https://github.com/GPSBabel/gpsbabel/blob/master/jeeps/gpslibusb.cc

Suggestion: mark this as closed. the error message was improved and the fixes were deliver a long, long time ago. No devices using Garmin comm protocol (current ones mount as mass storage devices and you basically copy GPX files to/from them) since about 2008 or so. The libusb path is so inconsequential it's being strongly considered for removal upstream because of disuse and churn at the libusb api level.

Please close this issue.
0 new messages