core/panic: don't use LOG_ functions in panic handler#20790
core/panic: don't use LOG_ functions in panic handler#20790Teufelchen1 merged 1 commit intoRIOT-OS:masterfrom
Conversation
Teufelchen1
left a comment
There was a problem hiding this comment.
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