Closed ghost closed 7 years ago
Keeping an eye out to see if c77cb92 changes anything.
Hasn't been observed for a long time.
Aaand it's back.
You wouldn't believe what we found. (It wasn't our fault!)
In the LedDisplay library packaged with teensyduino. In LedDisplay.cpp
, in the LedDisplay
constructor:
char stringBuffer[displayLength+1];
...
this->setString(stringBuffer);
setString()
sets a char*
member to the given value. So what was happening here is the pointer was being set to an array on the stack. And then the array on the stack was going away when the constructor exited. And then our code was using that memory. And then the library code was writing to what they thought was that array but was actually our memory.
Thank you @amiller27 and @aftersomemath for debugging!! @amiller27 is going to submit a change to upstream.
Sometimes the menu does not return from an option but instead hangs. Sometimes the selection wheel ends up spinning endlessly, which probably means a motor speed was written, and then the hang prevented further speed settings.