upstream-bugs.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <head lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="Author" content="Eric Raymond">
  6. <meta name="Description" content="Links to Open User-Visible Problems in other software">
  7. <meta name="Keywords" content="GPS, gpsd, bugs">
  8. <meta name="Revised" content="9 April 2015">
  9. <meta name="robots" content="index,follow">
  10. <title>Bugs GPSD Exposes In Other Software</title>
  11. <link rel="stylesheet" href="main.css" type="text/css">
  12. </head>
  13. <body>
  14. <div id="Header">Bugs GPSD Exposes In Other Software</div>
  15. <div id="Menu">
  16. <img src="gpsd-logo-small.png" alt="Small gpsd Logo" height="126"
  17. width="105"><br>
  18. <a href="index.html">Home</a><br>
  19. <a href="index.html#news">News</a><br>
  20. <a href="index.html#downloads">Downloads</a><br>
  21. <a href="index.html#mailing-lists">Mailing lists</a><br>
  22. <a href="index.html#documentation">Documentation</a><br>
  23. <a href="faq.html">FAQ</a><br>
  24. <a href="xgps-sample.html">Screenshots</a><br>
  25. <a href="index.html#recipes">Recipes</a><br>
  26. <a href="index.html#others">Other GPSDs</a><br>
  27. <a href="hardware.html">Hardware</a><br>
  28. <a href="for-vendors.html">For GPS Vendors</a><br>
  29. <a href="wishlist.html">Wish List</a><br>
  30. <a href="hall-of-shame.html">Hall of Shame</a><br>
  31. <a href="troubleshooting.html">Troubleshooting Guide</a><br>
  32. <a href="hacking.html">Hacker's Guide</a><br>
  33. <a href="protocol-transition.html">Application Compatibility</a>
  34. <a href="references.html">References</a><br>
  35. <a href="history.html">History</a><br>
  36. <a href="future.html">Future</a><br>
  37. <div>&nbsp;</div>
  38. <a href="http://www.catb.org/hacker-emblem/"><img
  39. src="glider.png" alt="hacker emblem" height="55" width="55"></a><br>
  40. <script src="https://www.openhub.net/p/3944/widgets/project_thin_badge.js"></script>
  41. <hr>
  42. <script><!--
  43. google_ad_client = "pub-1458586455084261";
  44. google_ad_width = 160;
  45. google_ad_height = 600;
  46. google_ad_format = "160x600_as";
  47. google_ad_type = "text";
  48. google_ad_channel = "";
  49. //--></script>
  50. <script src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
  51. </script>
  52. <hr>
  53. <a href="https://validator.w3.org/check/referer"><img
  54. src="https://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"
  55. height="31" width="88"></a>
  56. </div>
  57. <div id="Content">
  58. <p>This page used to be part of the to-do list in our source
  59. distribution, until we realized it would be useful for the rest of the
  60. Web to see these bug reports. Where we can identify a responsible
  61. maintainer, we've tried to kick these upstream.</p>
  62. <h1>Links to Open User-Visible Problems</h1>
  63. <ul>
  64. <li><a href="#osx-pl2303">Unknown osx-pl2303 driver issues on Mac OS X</a></li>
  65. <li><a href="#tiocmwait">PPS fails: ioctl(TIOCMIWAIT) hangs after tcsetattr()</a></li>
  66. <li><a href="#pps-gpio">The pps-gpio driver only reports on one edge</a></li>
  67. <li><a href="#bluetooth">Firmware problems in some Bluetooth and USB devices can hang them</a></li>
  68. <li><a href="#pl2303">Linux pl2303 driver on openwrt 2.4 kernel can hang when device is read at unexpected speed</a></li>
  69. <li><a href="#pthread_create">pthread_create() fails to return when called in background</a></li>
  70. <li><a href="#shm_damage">NTPSHM clobbers altitude under 2.4 Linux</a></li>
  71. <li><a href="#udev">Linux kernel doesn't generate udev close events</a></li>
  72. </ul>
  73. <h1>Links to Open Toolchain Bugs</h1>
  74. <ul>
  75. <li><a href="#pyinstall">Defective Python installation in SuSE 10.3rc</a></li>
  76. <li><a href="#gcc421">Compiler optimizer bugs can produce error-modeling errors</a></li>
  77. <li><a href="#sconscxx">scons doesn't honor parse_flags in a Program() using C++</a></li>
  78. <li><a href="#mfence">Illegal-instruction errors near fence operations</a></li>
  79. <li><a href="#netbsd-curses">gpsmon won't build with the curses
  80. library on NetBSD 6</a></li>
  81. </ul>
  82. <h1>Links to Fixed Bugs</h1>
  83. <ul>
  84. <li><a href="#startup">Distro-dependent problems with gpsd startup</a></li>
  85. <li><a href="#pysocket">Python socket library barfs on IPV6 notation in the /etc/hosts file</a></li>
  86. <li><a href="#isgps">isgps.c triggers an optimizer bug in older gcc versions</a></li>
  87. <li><a href="#fc5_64bit">gpsd build may break on 64-bit systems running Fedora Core 5</a></li>
  88. <li><a href="#floats">Incorrect generation of floating-point code in embedded toolchains</a></li>
  89. </ul>
  90. <hr>
  91. <h1>Open User-Visible Problems</h1>
  92. <h2 id="osx-pl2303">Unknown osx-pl2303 driver issues on Mac OS X</h2>
  93. <p>The osx-pl2303 driver appears not to work, at least under 10.9.
  94. Specifically, the combination of gpsd, OS X, osx-pl2303, and a
  95. GR601-W usually fails. With the official Prolific drivers, this
  96. receiver works reliably. The source code of this driver no longer
  97. appears to be available. While the facts so far do not prove that
  98. the bug is in the osx-pl2303 driver, the evidence points that way,
  99. and no one has dug in enough to figure out what's wrong. Therefore
  100. we recommend against using the osx-pl2303 driver and consider it
  101. unsupported</p>
  102. <p>Previously, there were problems with the osx-pl2303 driver that
  103. caused select not to return even when input was available. It is
  104. not clear if the above issue is the same or not.</p>
  105. <h2 id="tiocmwait">PPS fails: ioctl(TIOCMIWAIT) hangs after tcsetattr()</h2>
  106. <p>Due to a kernel bug in some versions of Linux 2.6 (recent as of
  107. 2011 - the bug was <a
  108. href="http://kerneltrap.org/mailarchive/linux-kernel/2010/11/13/4645043">referenced
  109. in 2010</a>) the tcsetattr() used in our autobauding hunt loop
  110. prevents any thread(s) currently suspended in ioctl(TIOCMIWAIT) for
  111. the same device from ever resuming. This interferes with PPS support</p>
  112. <p>This bug has apparently persisted in some 3.x kernels.</p>
  113. <p>The workaround is to use stty to pre-set the serial port to the right
  114. baud rate so tcsetattr is never called.</p>
  115. <h2 id="bluetooth">Firmware problems in some Bluetooth and USB devices can hang them</h2>
  116. <p>The baudrate-hunting code in <code>gpsd</code> tickles a serious
  117. firmware bug on some some Bluetooth devices; these are flagged on our
  118. <a href="hardware.html">Hardware</a> page. This bug may render these
  119. GPSes catatonic. The problem seems to be that buggy firmware inside
  120. these receivers doesn't necessarily keep the Bluetooth serial-port
  121. emulation and the GPS chip talking at the same baud rate. This problem
  122. is not unique to <code>gpsd</code> &mdash; Windows users are warned
  123. against using SiRFdemo's "Synchronize Protocol/Baud Rate" option on
  124. Bluetooth devices.</p>
  125. <p>If this happens, you can sometimes recover by repeatedly sending
  126. reset messages using <code>gpsctl</code>. Otherwise, power-cycling the
  127. GPS The only guaranteed fix is to drain the battery backing up the
  128. GPS's settings; in extreme cases, you may have to open the case and
  129. unsolder the backup battery so the chip forgets its configuration
  130. settings.</p>
  131. <p>To check whether you have this bug:</p>
  132. <ol>
  133. <li><p>Reset your GPS to a usable state.</p></li>
  134. <li><p>Launch gpsd with the Bluetooth device on the command line and
  135. the -b option to prevent autobauding.</p></li>
  136. <li><p>Observe it operating.</p></li>
  137. <li><p>Power down the device and terminate gpsd.</p></li>
  138. <li><p>Launch with -b again and see if it still works.</p></li>
  139. </ol>
  140. <p>If you find the device comes up on the last step, then you know
  141. that -b is an effective workaround and can finger bad Bluetooth
  142. firmware as the cause of the problem.</p>
  143. <p>A separate bug with less severe symptoms afflicts some USB devices.
  144. The probe strings <code>gpsd</code> sends in order to determine device
  145. type and subtype may be more than a device can handle, causing it to
  146. hang; power-cycling should fix this. Newer versions of <code>gpsd</code>
  147. break up the probe writes into smaller pieces, interleaving them with
  148. the first few packet reads, so they are far less likely to trigger
  149. this bug.</p>
  150. <p>You can use the -b option of gpsd to prevent it from trying to
  151. reconfigure your GPS; this will avoid both problems.</p>
  152. <h2 id="pl2303">Linux pl2303 driver on openwrt 2.4 kernel can hang when device is read at unexpected speed</h2>
  153. <p>Michael R. Davis reports "If you read from the device at the wrong
  154. rate (e.g. cat /dev/xxx) it will lock up. On openwrt it required a
  155. hard reboot." Details <a
  156. href='https://marc.info/?l=gpsd-dev&amp;m=115940539029940&amp;w=2'>here</a>. This
  157. bug was reported in 2006 with an old kernel version and may since have
  158. been fixed.</p>
  159. <h2 id="pthread_create">pthread_create() fails to return when called in background</h2>
  160. There is a call to pthread create in libgpsd_core.c::link_activate():
  161. <pre><code>
  162. /*@i1@*/(void)pthread_create(&amp;pt,NULL,gpsd_ppsmonitor,(void *)session);
  163. </code></pre>
  164. <p>If this is called when gpsd is in the foreground then the thread is
  165. created fine and pthread_create() returns right away. If this is
  166. called when gpsd is in the background then the thread is created fine,
  167. but it may return! That freezes the main loop of gpsd. There is a <a
  168. href="https://marc.info/?l=gpsd-dev&amp;m=120124952704634&amp;w=2">workaround</a>,
  169. but the nature of the workaround only makes their bug more
  170. mysterious.</p>
  171. <h2 id="shm_damage">NTPSHM clobbers altitude under 2.4 Linux</h2>
  172. <p>We've had one report (in march 2009) of the NTPSHM feature
  173. clobbering altitude reports, on a Technologic TS-5500 board running a
  174. customized 2.4.34 kernel using a <code>gpsd</code> built with GCC 2.95.3.
  175. When NTPSHM was disabled, altitude was reported correctly.</p>
  176. <p>Shared memory was bug-plagued on older Linux kernels; one notorious
  177. symptom of this was that the emulation of System V IPC worked poorly,
  178. and we suspect our corruption bug is another symptom. No such
  179. misbehavior has been reported from our NTPSHM-using developers under
  180. 2.6. It is also possible that this is due to some obscure bug in GCC
  181. or elsewhere in Technologic's cross-development toolchain.</p>
  182. <h2 id="udev">Linux kernel doesn't generate udev close events</h2>
  183. <p>One user has reported that the GPSD hotplug wrapper is not being
  184. invoked on unplug of a USB receiver, because the kernel never actually
  185. generates a remove event when closing an open serial device.
  186. Apparently this is a <a
  187. href="https://www.linuxquestions.org/questions/programming-9/udev-not-called-to-remove-open-usb-serial-device-585603/">well-known
  188. bug</a> that will <a href="http://lkml.indiana.edu/hypermail/linux/kernel/0907.2/01845.html">not be easily fixed</a>.</p>
  189. <h1>Open Toolchain Bugs</h1>
  190. <p><code>gpsd</code> is distressingly good at tickling bugs in
  191. development toolchains. Most of these, thankfully, are non-issues
  192. if you keep your toolchain up to date.</p>
  193. <h2 id="pyinstall">Defective Python installation in SuSE 10.3rc</h2>
  194. <p>The Python 2.5 installed with SuSE 10.3rc is missing a needed
  195. Makefile. This prevents the <code>gpsd</code> Python components from
  196. building correctly.</p>
  197. <h2 id="gcc421">Compiler optimizer bugs can produce error-modeling errors</h2>
  198. <p>The floating-point code in the daemon's error modeler (the logic
  199. that produces uncertainty estimates in the sensor doesn't supply them)
  200. is sensitive to optimizer bugs. If the optimizer is flaky, different
  201. levels of operation can cause the speed calculation to either converge
  202. or blow up in FP operations; the effect is that when it is actually
  203. reported seems to vary randomly with level of optimization.</p>
  204. <p>Under GCC 4.2.1, -O2 diverges from what GCC 4.4.1 reports, causing
  205. regression-test failures. Dropping back to -O1 or going up to -O3
  206. restores behavior like GCC 4.4.1's.</p>
  207. <h2 id="scons_cpp">scons doesn't honor parse_flags in a Program() using C++</h2>
  208. <p>In building test_gpsmm, we should get libgps_dump_state() from the
  209. client library, but scons 1.2.0 has a bug; we can't get it to add
  210. -lgps to the link lime, apparently because it doesn't honor
  211. parse_flags on a Program() build of a C++ .cpp file.</p>
  212. <h2 id="mfence">Illegal-instruction errors near fence operations</h2>
  213. <p>The shared-memory export relies on being able to generate some
  214. fence instructions that are processor-specfic. We have a report that
  215. under Ubuntu 10.04 running on a 32-bit Athlon processor the daemon
  216. dies with an illegal instruction error when attempting the fence
  217. operation.</p>
  218. <p>To work around this, disable the shared-memory export by building
  219. with "scons shm_export=no".</p>
  220. <h2 id="#netbsd-curses">gpsmon won't build with the curses library on NetBSD 6</h2>
  221. <p>The base NetBSD install (netBSD 6, anyway) includes curses, but
  222. it's an old version that lacks the "syncok" function used by gpsmon. A
  223. simple '-lcurses' is sufficient to make cgps work, but not gpsmon.</p>
  224. <p>It's possible to install a reasonably current ncurses on NetBSD as
  225. a package, but the package setup doesn't include pkg-config data, so
  226. the ability to use it doesn't get discovered automatically.</p>
  227. <p>It's possible to check the existence of the package with the
  228. NetBSD-specific "pkg_info -E", and then fake the options that one
  229. would expect to be supplied by pkg-config, but the resulting setup
  230. still doesn't build, for an as-yet-undetermined reason.</p>
  231. <h1>Fixed Problems</h1>
  232. <p>We document these here in case you're running on an older system.
  233. They will be removed as they become sufficiently ancient.</p>
  234. <h2 id="startup">Distro-dependent problems with gpsd startup</h2>
  235. <p>See <a href='https://bugs.gentoo.org/show_bug.cgi?id=132288'>this
  236. Gentoo bug</a>. This shows up on other distributions as well, but
  237. not under Fedora Core. The Gentoo problem can be fixed by creating a
  238. /var/run/usb directory; this fix may apply to other distributions as
  239. well.</p>
  240. <h2 id="pysocket">Python socket library barfs on IPV6 notation in the /etc/hosts file</h2>
  241. <p>Robert J.Berger &lt;rberger@ibd.com&gt; reports:
  242. Until I changed the line in /etc/hosts from:</p>
  243. <pre class='code'>
  244. ::1 localhost.localdomain localhost
  245. </pre>
  246. to:<br>
  247. <pre class='code'>
  248. 127.0.0.1 localhost.localdomain localhost
  249. </pre>
  250. <p>gps.py would fail when trying to open the socket connection to the gpsd:</p>
  251. <pre class='code'>
  252. File "/usr/local/bin/spGps.py", line 198, in __init__
  253. self.connect(host, port)
  254. File "/usr/local/bin/spGps.py", line 237, in connect
  255. raise socket.error, msg
  256. socket.error: (111, 'Connection refused')
  257. </pre>
  258. <p>and gpsprof would fail with:</p>
  259. <pre class='code'>
  260. # gpsprof | gnuplot -persist
  261. gpsprof: gpsd unreachable.
  262. </pre>
  263. <p>This is with Python 2.4.4 under Red Hat Linux, kernel version 2.6.18.
  264. This was filed upstream as Python bug 1603527 on their old tracker, and
  265. is no longer open on their new one.</p>
  266. <h2 id="isgps">isgps.c triggers an optimizer bug in older gcc versions</h2>
  267. <p>The isgps.c file confuses the gcc-3.4.[23] optimizer at -O2 level,
  268. making it generate incorrect code. Removing -O2 from the
  269. compilation flags works around the problem. Details are in the
  270. isgps.c source file.</p>
  271. <p>Compiling with --enable-max-devices=1 may trigger a gcc
  272. optimizer bug</p>
  273. <p>At gpsd revision level 3365, compiling with
  274. --enable-max-devices=1 has been observed to trigger an
  275. optimizer bug in gcc 4.1.0 20060304 (Red Hat 4.1.0-3). The symptom is
  276. a for-loop termination condition not causing an exit, leading to a
  277. core dump. Removing -O2 from the compilation flags works around the
  278. problem; upgrading to gcc 4.1.1 20060525 (Red Hat 4.1.1-1) solves it.
  279. Other reports indicate this bug was introduced sometime after gcc
  280. 4.0.2 20051125 (Red Hat 4.0.2-8).</p>
  281. <h2 id="fc5_64bit">gpsd build may break on 64-bit systems running Fedora Core 5</h2>
  282. <p>The problem may be be caused by the old ld (binutils-2.15.92.0.2-18)
  283. being incompatible with gcc 4.1.0 on a 64-bit system. Updating to
  284. binutils 2.16.1 or later avoids it.</p>
  285. <h2 id="floats">Incorrect generation of floating-point code in embedded toolchains</h2>
  286. <p>One problem area is errors in generation of floating-point code. A
  287. number of trouble reports have been received indicating erroneous
  288. results on embedded platforms, most notably ARM systems. These have
  289. all been traced back to the toolchain; when appropriate corrective
  290. action was taken, <code>gpsd</code> functioned correctly. Source code
  291. for a simple test program (<code>floattest.c</code>) is in the
  292. project repository; if <code>gpsd</code> seems to be producing
  293. incorrect output, please use this tool to validate your toolchain
  294. before filing a bug report.</p>
  295. <h2 id="macxlibs">Mac OS 10.5 X library packaging problem</h2>
  296. <p>Building <code>xgpsspeed</code> will fail under MacOS 10.5.6
  297. because the X SDK libraries and include files are not installed to the
  298. canonical places. This was <a
  299. href="https://openradar.appspot.com/6498632">filed as a bug</a> with
  300. Apple and is reported fixed.</p>
  301. <hr>
  302. <script src="datestamp.js"></script>
  303. </div>
  304. </body>
  305. </html>