The strange thing is that looking at the code when this crash happens, the loop has just started and the index is ZERO and the DispBuffer has not even been written to at this point. The SensorData.Calculated is indeed a float so this is OK. Afer a few hours of posting on here the system crashed with the same Faulted PC location. My comment on one system working was false. A lot of this code was ported from an older project running on the Rabbit so is generally all C code. Is just taking time to redo and learn not to use the old ways and your Wiki is most helpful. Unfortunately (despite my mini-rant above) it affects both the C and C++ versions of the library. One of the versions in the recent past had a re-entrancy bug with floating point io operations. The reason (in their case) that this was relevant was because the machine that was causing the crash had an older version of the NNDK installed. Is this possibly the case with you as well? I remember this issue coming up with someone else and they eventually yielded the vital piece of information that while the source code was the same it had been compiled on different development machines. The interesting thing you said was that one system works and one doesn't and both have the same source code. OK now that I have that out of my system. See the wiki article on moving from C to C++ and for this topic scroll down to the sprintf is to misery as ostringstream is to happiness section Maybe someone from NetBurner will chime in here, but I can't see any reason not to use the more modern (yet tested over 20 years) versions from the C++ lib. Using the c++ libs instead of the old c libs will ALWAYS avoid both of these potential crashes. Why not just use the much safer ostringstream? In your example if SensorData.Calculated is not a float it will cause a crash, if you overflow DispBuffer it will cause a crash. Sprintf and all its relations are type unsafe. First let me put on my broken record (and this isn't directed directly at Dave)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |