| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fred Wright <fhgwright> writes:
While trying the regression tests on a MacBook (PowerPC), I ran across
some failures in the JSON unit test. Although this is ostensibly an
endian issue, it turns out that the code for parsing satellite view
data is actually incorrect for all processors, albeit more so for
big-endian processors.
The problem is that the three "integer" fields in struct satellite_t
are defined as shorts, but parsed as ints by the JSON parser. On a
big-endian processor, this causes the values to be misaddressed and
hence have incorrect values, but even on a little-endian processor
this is incorrect since it's storing four-byte values into two-byte
fields. The unit tests don't catch this aspect, since the fields are
favorably ordered such that the clobbered fields are clobbered before
being written pseudo-correctly.
I was able to demonstrate the "buffer overflow" misbehavior by
modifying the test data for the last satellite to provide the fields
in the reverse order from their order in the structure.
The simple fix for this would be just to change the shorts to ints in
the definition of struct satellite_t. On most processors, this doesn't
even cost any memory, since the presence of the double forces
eight-bye alignment, so the padded structure is 24 bytes regardless of
whether the three fields in question are shorts or ints. However,
there might be some processors with less strict alignment requirements
where using shorts would actually be helpful.
With the existing layout, the only possible fix is to add support for
shorts to the JSON parser, and adjust the satellite-view parsing
accordingly. The attached patch does that, as well as adding u_short
support for completeness (though it's not currently used). It also
provides the aforementioned change in the test data, in keeping with
the philosophy of "create a test for what just failed, so it doesn't
happen again".
Note that using shorts for these fields would be more effective if the
"used" field were also reduced to a short, instead of inheriting "int"
from "bool". That would shrink the structure to 16 bytes. It could be
further reduced to 12 bytes by using a float instead of a double for
the "ss" field (and even a float is gross overkill for this
purpose). This could all be more significant when MAXCHANNELS needs to
be increased (again) to accommodate the deployment of the newer
GNSSes.
|
| |
|
| |
|
|
|
|
| |
Still need a place for PPS precision.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The proximate cause was that we've been seing emission of error
messages that were randomly and disturbingly variable across different
environments - notably Raspbian and Gentoo splint gave nontrivially
different results than Ubuntu 14.10 splint. And this was *not* due to
Ubuntu patches! A pristine splint built from the 3.1.2 tarball on
Ubuntu didn't match the Raspbian and Gentoo results either.
But this has been coming for a while. Easy access to more modern
static analyzers such as coverity, scan-build and cppcheck has been
decreasing the utility of splint, which is unmaintained and somewhat
buggy and not easy to use.
Only file not cleaned is ppsthread.c, because Gary has been working
on it during this cleanup.
All regression tests pass. PPS observed live on GR601-W.
|
|
|
|
| |
This allow scons test_json clientdebug=off to compile
|
| |
|
|
|
|
| |
We were missing the last test case every time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
...from a set of parallel arrays. This change flushed out a
longstanding bug in the computation of DOPs for estimated error bars.
Some test-load rebuilds were required:
geostar-geos1m-binary.log.chk: With this change error
estimates are computed and reported.
trimble-lassen_iq-3dfix.log, trimble-lassen_iq-3dfix.log: the
change revealed a bug in the computation of satellite-seen bits.
Error estimates did not change.
navcom.log: Error estimates changed.
With these rebuilds, all regression tests pass.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
|
| |
Now supported: JSON arrays with int, unit, bool, and real elements.
All regressiion tests pass.
|
|
|
|
|
|
|
| |
Required a regression-test rebuild, of course. The field is still set by
the TSIP and SiRF drivers; the SiRF driver actually uses it. It may be
possible to eliminate the TSIP uses, but so far attempting this has
produced odd regression-test failures.
|
| |
|
| |
|
| |
|
|
|
|
| |
Note there are some exit(2) instances we bneed to decide what to do with.
|
| |
|
|
|
|
| |
All regression tests pass. Livetesting with cgps looks good.
|
|
|
|
|
|
|
|
| |
Protocol version number is bumped. Python and C test clients are known
to work; interfaces of the C and Python client bindings are
unchanged. Third-party client-side bindings which rely on naively
copying JSON members will break (implementers have been repeatedly
warned not to do this).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
All regression tests pass.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
|
|
| |
That is, instead of sectioning out two little config defines and
putting them in. This makes gpsd.h self-copntained (e.g. in case it
gets installed as a library header) and means we can get rid of most
inclusions of it.
|
| |
|
|
|
|
|
|
| |
...about the number of visible satellites. (Yes, there was an actual
bug there.) Required removing a field from the JSON dumps on the
regression tests.
|
| |
|
|
|
|
| |
...and will announce them in the banner.
|
|
|
|
|
| |
All regression tests pass.
Everything splints clean.
|
|
|
|
|
|
| |
...but still report eph by re-mixing them in the JSON dumper. This was
worth doing because all regression tests still pass, showing that
visible behavior for old-protocol users gas not changed.
|
| |
|
|
|
|
| |
Also add a unit test for this.
|
|
|
|
| |
so that string lengths won't step on offsets.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Add JSON unit test to default test sequence.
|
| |
|