-
Notifications
You must be signed in to change notification settings - Fork 2k
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
core/panic: don't use LOG_ functions in panic handler #20790
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Any specific reason you opted for printf
rather than puts
?
It uses format strings and the default |
Maybe it would have made sense to add a comments somewhere in that file that |
For clarification: How is LOG_ more reliable than stdout? Just like logging can be redirected, stdio can be, eg. by going through BLE or to the VFS, and that'd just run into the same issue. |
For reference, this creates a hard dependency on libc stdio formatting code. |
I'm not so concerned about minimal binary size with I agree that stdio can have the same problem, but we could introduce a flag field to That could also solve the issue brought up in #20364 (comment) |
This is independent of |
That's just by chance - any module using stdio would void that again - lets rather solve the problem properly by turning all calls to |
Contribution description
The LOG_ functions can be overwritten to log e.g. to network or file system.
Calling them in the panic handler will just lead to another panic, obfuscating the original source of the panic.
Testing procedure
Issues/PRs references