Logging: Using asserts with LOG in high pri ISR context blocks output #30418
Labels
area: Logging
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Describe the bug
When using log_panic() in a high pri ISR context, this call hangs in https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/serial/uart_nrfx_uarte.c#L1131
To Reproduce
although that is not strictly relevant
4. https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c#L37
log_panic();
Step 5 is of course artificial. However, it is meant to simulate that an ASSERT is triggered here, which is then transferred to the user-defined error handler. In this handler, we wish to print some relevant information using LOG_ERR, call log_panic() to flush and then enter an infinite loop.
Expected behavior
This is a chicken-and-egg situation. We are trying to get UART output whilst calling log_panic() in a high priority ISR (>UART).
This likely causes the https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/serial/uart_nrfx_uarte.c#L1133 flag to never become ready.
It may be challenging, but there should be some call to terminate the calling ISR and transfer execution to the logger thread in fault situations.
Impact
The impact is rather severe in that all ASSERTS/calls to error handler originating from high-pri ISRs cannot print anything. The user is left in the blind as to what has happened on console.
Additional context
Related to #30353
The text was updated successfully, but these errors were encountered: