I've uncovered a few (3) old GPS receivers and might be able to recreate this:
Is that how it looks for you?

$ gpsmon
tcp://localhost:2947          JSON slave driver>
(82) 
{"class":"VERSION","release":"3.25","rev":"3.25","proto_major":3,"proto_minor":15}
(313) 
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB0","activated":"2024-12-04T13:01:52.547Z","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00},{"class":"DEVI
CE","path":"/dev/ttyUSB1","activated":"2024-12-04T13:01:53.473Z","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]}
(122) 
{"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":2,"scaled":false,"timing":false,"split24":false,"pps":true}
Segmentation fault (core dumped)


With the fix in the PPA for noble it works for me.
it is slightly confused by me having more than one GPS receivers attached and 
configured into gpsd, but I consider this a stress test :-)
Tell me if things work for you as well.

** Description changed:

  [ Impact ]
  
-  * There are two bugs in gpsd that break gpsmon on noble. On one hand a 
re-use 
-     of freed resources and on the other a compile issue with fortify source.
-     One leads to a crash, the other to an assertion.
-  
-  * Upstream has fixes for that, and some refactor that should be no-op
-    but helps to keep patches comparable. Together they fix the crash
-    on the systems using gpsmon.
+  * There are two bugs in gpsd that break gpsmon on noble. On one hand a re-use
+     of freed resources and on the other a compile issue with fortify source.
+     One leads to a crash, the other to an assertion.
+ 
+  * Upstream has fixes for that, and some refactor that should be no-op
+    but helps to keep patches comparable. Together they fix the crash
+    on the systems using gpsmon.
  
  [ Test Plan ]
  
-  * Disclaimer: needs a system with a gps device (and that might be limited
-    to some kinds of them)
+  * Disclaimer: needs a system with a gps device (and that might be limited
+    to some kinds of them)
  
-  * # 1 - start gpsd either via the service or directly like e.g.:
-    $ /usr/sbin/gpsd -D5 -N -b -n -p -s 9600 /dev/loraGPS
+  * # 1a - start gpsd either directly like e.g.:
+    $ /usr/sbin/gpsd -D5 -N -b -n -p -s 9600 /dev/loraGPS
+    # 1b - start the service that comes with the package
+    # configure your devices, in my case two via usb
+    $ sudo vim /etc/default/gpsd
+      DEVICES="/dev/ttyUSB0 /dev/ttyUSB1"
+    # With that start the service and check it runs
+    $ sudo systemctl restart gpsd
+    $ sudo systemctl status gpsd
  
-    # 2 start gpsmon to monitor local gps'es
-    /usr/bin/gpsmon
+    # Then as step 2 start gpsmon to monitor local gps'es
+    $ gpsmon
  
-  * In the bad case this runs into a buffer overflow detect and crash
-  * Good case should display whatever the gps receives so far
+  * In the bad case this runs into a buffer overflow detect and crash
+    looks like that after a few seconds:
  
+ $ gpsmon
+ tcp://localhost:2947 JSON slave driver>
+ (82) 
{"class":"VERSION","release":"3.25","rev":"3.25","proto_major":3,"proto_minor":15}
+ (313) 
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB0","activated":"2024-12-04T13:01:52.547Z","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00},{"class":"DEVI
+ 
CE","path":"/dev/ttyUSB1","activated":"2024-12-04T13:01:53.473Z","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]}
+ (122) 
{"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":2,"scaled":false,"timing":false,"split24":false,"pps":true}
+ Segmentation fault (core dumped)
+ 
+  * Good case should display whatever the gps receives so far.
+    I realized posting that example might show my position quite accurately, 
so I skip that :-)
  
  [ Where problems could occur ]
  
-  * I needed to backport some more context changes, tried to keep
-    them style only, but mistakes could happen.
-    But on the other hand the impact is gladly limited,
-    changes are isolated to gpsmon/monitor_nmea0183.c
-    and a minimal one in gpsmon/gpsmon.c
-    Therefore breakage should be
-     a) only in gpsmon and not gpsd
-     b) almost only for NMEA type devices
-    
+  * I needed to backport some more context changes, tried to keep
+    them style only, but mistakes could happen.
+    But on the other hand the impact is gladly limited,
+    changes are isolated to gpsmon/monitor_nmea0183.c
+    and a minimal one in gpsmon/gpsmon.c
+    Therefore breakage should be
+     a) only in gpsmon and not gpsd
+     b) almost only for NMEA type devices
  
  [ Other Info ]
  
-  * n/a
+  * n/a
  
  ---  original bug ---
  
  Ubuntu 24.04 LTS
  
  ii  gpsd-tools     3.25-3ubuntu3 amd64        Global Positioning System
  - tools
  
  Calling the gpsmon utility from this package, it should show the current GPS 
status
  of the connected GPS (LEA 6M). Instead it segfaults and is therefore unusable.
  
  Tracing this, the problem is a double delwin(), ie. double-free of
  devicewin, in lines 517 and 521 of gpsmon.c
  
  Apparently this bug has been fixed upstream in
  https://gitlab.com/gpsd/gpsd/-/commit/bc840b0d3ba65d3d8fe2b7faeadd5af5ed2b5e60
  
  I have tested this patch indeed solves the problem, at least in my case.
  
  Regards,
  Mario

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2076191

Title:
  gpsmon crashes (segfault)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gpsd/+bug/2076191/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to