-
Couldn't load subscription status.
- Fork 8.1k
Labels
area: Segger RTTSEGGER RTT (Real Time Transfer)SEGGER RTT (Real Time Transfer)bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bugMedium impact/importance bug
Description
Describe the bug
Calling LOG_PANIC() in an exception handler when RTT is the logging backend will deadlock due to triggering its own assertion. This is due to SEGGER_RTT_LOCK not being suitable for use in IRQ's:
zephyr/modules/segger/SEGGER_RTT_zephyr.c
Lines 35 to 38 in 7773fe8
| void zephyr_rtt_mutex_lock(void) | |
| { | |
| k_mutex_lock(&rtt_term_mutex, K_FOREVER); | |
| } |
While mutex locking is explicitly not permitted in ISRs:
zephyr/include/zephyr/kernel.h
Line 3066 in 7773fe8
| * Mutexes may not be locked in ISRs. |
Expected behavior
LOG_PANIC should never deadlock.
Impact
System lockup on exception unless a hardware watchdog that automatically reboots is enabled.
Logs and console output
Metadata
Metadata
Assignees
Labels
area: Segger RTTSEGGER RTT (Real Time Transfer)SEGGER RTT (Real Time Transfer)bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bugMedium impact/importance bug
