[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-commit-watch] [SCM] GPSD branch, master, updated. release-3.15-68-
From: |
Eric S. Raymond |
Subject: |
[gpsd-commit-watch] [SCM] GPSD branch, master, updated. release-3.15-68-g3b66e6c |
Date: |
Mon, 04 Jan 2016 19:55:59 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GPSD".
The branch, master has been updated
via 3b66e6cb486b157aad6a65b22caae65e10b8b4e5 (commit)
from 753b96619a490369e3c73ea55eca571f64d1b935 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3b66e6cb486b157aad6a65b22caae65e10b8b4e5
Author: Fred Wright <address@hidden>
Date: Mon Jan 4 14:55:29 2016 -0500
Address bug #46802: AIVDM to CSV is broken in some weird cases
While trying the regression tests on a MacBook (PowerPC), I ran across
some failures in the "Testing AIVDM decoding w/ CSV format" test. The
failing type/dac/fid cases were as follows:
6,1,14
6,1,18
6,1,30
6,1,32
8,200,10
The proximate cause is endian dependence in the CSV output, but the
real problem turns out to be that the code is broken on all platforms,
but only fails on big-endian platforms because the
incorrect-but-presumed-correct output was captured on a little-endian
processor.
The problem arises when the type 6 or type 8 case is supported by the
AIVDM parser but not by the CSV formatter. When the parser doesn't
support the case, it falls back to capturing the raw binary
bitdata. When the formatter doesn't support the case, it falls back to
dumping the raw binary bitdata. But in the offending cases, the raw
data was never correctly captured, and is instead an overlaid view of
the structured data, which is incorrect (as raw data) in all cases as
well as being endian-sensitive due to the presence of multibyte
quantities in host byte order.
The only way to make the CSV fallback work as intended would be to
change the struct ais_t type6 and type8 substructure definitions to
move the bitdata field out of the union and populate it
unconditionally. But this would increase the memory footprint and add
to the core code for the sole purpose of providing more useful output
in these cases of missing CSV formatting support, which doesn't seem
very justifiable.
The alternative is simply not to report the unavailable raw bitdata at
all in these cases, but instead to report something indicating that
the raw data is unknown. I've implemented a version of this where the
formatting remains the same (including the bit count) but the hex data
is replaced by "x" characters (which seemed safer than using "?",
given the absence of the latter in any existing cases.
After implementing the code change and before updating the test data,
I saw one additional miscompare that I'd not seen on the PPC. This was
for the 6,1,12 case, where the existing test data is too incomplete to
populate the endian-sensitive fields in the decoded form, but which
would have failed with a better version of the test case.
After updating the test data as well as the code, the test passes on
both x86_64 and PPC.
P.S.:
There are three additional uses of gpsd_hexdump in the CSV output, for
types 17, 25, and 26, but those all seem to populate the bidata field
unconditionally (and type 17 doesn't even have a "structured" flag),
so I left them alone.
Clearly the right fix would be to implement the missing CSV formatting
cases, which would render the fallback code unreachable, but it could
become reachable again if new cases were implemented in the parser and
not in the CSV formatter, so having a well-behaved fallback seems like
a good idea.
-----------------------------------------------------------------------
Summary of changes:
gpsdecode.c | 34 ++++++++++++++++++++++++++++------
test/sample.aivdm.chk | 18 +++++++++---------
2 files changed, 37 insertions(+), 15 deletions(-)
hooks/post-receive
--
GPSD
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gpsd-commit-watch] [SCM] GPSD branch, master, updated. release-3.15-68-g3b66e6c,
Eric S. Raymond <=