[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] Shared memory interface with gpsd restart results in no dat

From: Michael Lum
Subject: [gpsd-users] Shared memory interface with gpsd restart results in no data for client
Date: Thu, 14 Jun 2018 11:47:26 -0700

I'm using the source from gpsd 3.17 on CentOS 7, Ublox NEO 7 GPS receiver, shared memory interface.
If I send a SIGSEGV to the gpsd or just do a quick stop/start my client program does not "see" any data
for a long time.
The shared memory segment is the old one because the client is still attached.
Code executing in gpsd:
'tick' that goes into the bookends is a static (initialized to zero, correct?).
Incremented immediately and used in the bookends.
So everytime gpsd starts the tick value in the bookend will start at '1'.
Code executing in client:
gps_shm_open() uses malloc() to allocate memory for privdata_t.
This contains the pointer to the shared memory segment and a
int tick
(Shouldn't 'tick' have been zeroed?)
gps_shm_waiting() checks that the bookend1 value is greater than the 'tick' in the privdata.
But the privdata->tick could be very large depending on how long the original gpsd instance was running.
In addition I believe there will be a wrap around problem when the bookend1 value wraps to a negative.
Best regards,
Michael Lum
Michael Lum (address@hidden) | STAR SOLUTIONS | Principal Software Engineer
4600 Jacombs Road, Richmond BC, Canada V6V 3B1 | +1.604.303.2315

reply via email to

[Prev in Thread] Current Thread [Next in Thread]