gpsd udev devices includes a common USB Serial adapter. Collisions occur.

Bug #2012207 reported by Kristopher Setnes
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gpsd (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

The following USB device has been erroneously added to 60-gpsd.rules.

  ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303"

There is a comment about this Prolific Technology, Inc. device at the top of the file matching too many other (non-GPS) devices. But, towards the bottom of 60-gpsd.rules, it has been added back in for a u-blox 8 receiver.

In my case this chipset is also used in an astrophotography mount (SkyWatcher EQ6-R Pro). This udev rule causes gpsd to erroneously connect to a telescope rig... and prevents other software from using it. The root cause was completely non-obvious to the end user.

Ubuntu 22.04.2 LTS

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for taking the time to report this bug and trying to make Ubuntu better.

This rule at the end of the file was added by upstream 4 years ago:

https://gitlab.com/gpsd/gpsd/-/commit/c0c0e53d7fe400cde49398bdcce024fb9eb1d51b

So in Ubuntu 20.04 (a.k.a Focal) we already had that in place, were you using Focal before and upgraded to Jammy (22.04)? Or is this a new installation? If you upgraded, had you experienced this issue before?

There is a patch (d/p/gpsd_hotplug_rules_disable_generic_serial_converters) in the debian package disabling a similar udev rule at the top of the file indeed:

-ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", @UDEVCOMMAND@
+# rule disabled in Debian as it matches too many other devices
+# ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", @UDEVCOMMAND@

It seems to be created before they added the other udev rule at the bottom at the file, someone might have forgotten to update the patch. I believe we should address it in the debian package and update the patch.

I also believe this is an issue to be discussed with upstream anyway. Could you try to report a bug upstream here [1]? If you do so, could you please link it here so we can track it?

[1] https://gitlab.com/gpsd/gpsd/-/issues/new

Changed in gpsd (Ubuntu):
status: New → Triaged
Revision history for this message
Kristopher Setnes (kristopher-n) wrote :

Yes, this is a somewhat new install, but I had used it successfully before. There is a bit of a race condition between gpsd and a telescope service. The first one to connect to the device wins. I found it when I made a change where the telescope service started later after boot. After that change GPSD was able to take control of the device before the correct software had a chance.

I have reconfigured gpsd to not auto connect (using a network GPS device anyway), and I have overridden the entire 60-gpsd.rules file to comment out the one problem line. That should prevent this from happening again on my systems. It is too bad I can't selectively undo system udev rules without overriding the entire file. I'm not going to go anywhere near that flame war with LP on the udev override issue though. :|

The GPSD bug was logged here...
https://gitlab.com/gpsd/gpsd/-/issues/235

Revision history for this message
Paride Legovini (paride) wrote :

There is really no perfect solution here. I blame the manufacturers for not changing the idVendor/idProduct of the usb-to-serial converters in their products.

Anyway, my take on this bug is: this is actually a bug in the d/p/gpsd_hotplug_rules_disable_generic_serial_converters Debian patch [0]. Rationale:

1. Debian patched away the udev rule that covers pl2303 serial converters, see [1, 2]. This happened about 8 years ago.

2. Four years ago gpsd upstream added another pl2303 udev rule meant to start a service when a pl2303 usb device is detected. This is [3], the change Lucas found. This is not covered by the patch [0].

3. Either the patch fully comments out the pl2303 udev rules, or it leaves both of them active (as upstream intended). The pl2303 is extremely common, so I think it's correct to patch it out.

Ideally this should be fixed in Debian by expanding [0].

@Kristopher are you interested in filing a gpsd Debian bug with this information to help the bug fixing process? There is a similar bug already filed [4].

I doubt this is SRU material, as some production systems may rely on the udev rule [3] for starting up the gpsdctl service.

[0] https://salsa.debian.org/debian-gps-team/pkg-gpsd/-/blob/master/debian/patches/gpsd_hotplug_rules_disable_generic_serial_converters
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696020
[2] https://salsa.debian.org/debian-gps-team/pkg-gpsd/-/commit/72a6a4af
[3] https://gitlab.com/gpsd/gpsd/-/commit/c0c0e53d7fe400cde49398bdcce024fb9eb1d51b
[4] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884744

Changed in gpsd (Ubuntu):
importance: Undecided → Low
Revision history for this message
Robie Basak (racb) wrote :

This is similar to bug 1958224. It might be worth considering the outcome of that bug here. Although in that case, what made the issue far more significant was that it affected default installations (since brltty is installed by default in Ubuntu, so that Braille readers work out of the box).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gpsd - 3.25-2ubuntu2

---------------
gpsd (3.25-2ubuntu2) mantic; urgency=medium

  * Mark strlcat strlctpy as optional

 -- Gianfranco Costamagna <email address hidden> Tue, 12 Sep 2023 09:40:59 +0200

Changed in gpsd (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.