-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TempBuffer memory allocation failure should not use Serial.printf() #822
Comments
Have you been able to confirm that this is indeed the problem. If an alloc() fails, nothing bad happens. The memory is simply not acquired. There should still be plenty of heap for printf to produce the output. Note that serial monitors are not fully stable. If I leave mine up for a while and my MAC goes to sleep I often need to close and re-open the serial monitor for it to re-establish a USB connection. |
Not yet.
well, stalling the whole program in a
Ideally, I agree, yes.
That, I tried. No luck, no wake up, power still in D0. My only suspicion right now was these |
The new
TempBuffer
class will useSerial.printf()
if memory allocation fails, then get into an infinite loop to stall the program.The method
Serial.printf()
actually requires a mix of stack and heap memory, so there is a chance that theSerial.printf()
text logged by HomeSpan may never get logged.Back-to-back
Serial.print()
should be used instead.This may be the reason why I posted the comment at #791 (comment) about HomeSpan's CLI becoming fully unresponsive even though nothing got logged to the serial console.
The text was updated successfully, but these errors were encountered: