Open thinrope opened 8 years ago
Just looking at the dates, 40325908 lines were extracted, 475066 of them are invalid dates (including before 3/11 and after today), or that gives 1.17% of corrupt data only due to date problems. Looking at the top number of invalid dates, all have "00-00" in the month-day section and those represent 446908 or 94% of the bad dates by number.
So may be not memory corruption after all, but bad logic somewhere :-|
Hi Kalin, part of the explanation (the last magic) is that the GPS year is given on two digits (god know why) that start at 80 (1980). Some of the GPS modules default to 80 before they first acquire a date. I am guessing that another part of the explanation is that different modules default to different year (just maybe). For the rest, maybe a memory leak ? I wouldn't be surprised given how packed the firmware is.
Yes, I know the NMEA mis-design ;-) I also thought something like memory corruption, but seeing that 94% of the cases we end up with 00 in month/day, I am 94% sure it is a logical mistake, possibly not checking error or something, since we initialize those values to 0, before passing by reference. If I had to debug that, I'd initialize them to 99 or 33 instead and look to catch such value, as well as 00.
Looking at the raw log files from Nanos, in many places there is the invalid date string of "2000-00-00T" ... About 244K lines of 40.5M or 0.6% is corrupt. It is present in a variety of firmware versions (numbers are number of on-off log segments), showing top 3 of 17 affected versions:
It affects 99 devices, some more than others, those are top 10:
I looked at the code, but couldn't spot anything obvious and no literal string 2000. However, there is quite a lot of "magic hackery" with the years, e.g.: https://github.com/Safecast/bGeigieNanoKit/blob/8559e91d1eb2793db86053bf9c1ec2a5935b57e2/bGeigieNano.ino#L78 https://github.com/Safecast/bGeigieNanoKit/blob/8559e91d1eb2793db86053bf9c1ec2a5935b57e2/bGeigieNano.ino#L852 And finally https://github.com/Safecast/bGeigieNanoKit/blob/8559e91d1eb2793db86053bf9c1ec2a5935b57e2/TinyGPS.cpp#L422
Recent drives with this problem (from May 2016) are 22969,22975,22980 (devices 1207 and 2001). Both run "format=1.3.4nano" firmware. For those 3 drives, this is the number of points on a given date:
While there is a higher percentage of 2000-00-00 bug, it really smells like memory corruption to me.