0106059ff0
A CPU fault occurs when sys_k_event_logger_get_wait() api invoked with config KERNEL_EVENT_LOGGER_THREAD enabled. sys_k_event_logger_get_wait() supposed to pend on a semaphore when all the events from kernel event logger are read.But when sys_k_event_logger_get_wait() inovked with config KERNEL_EVENT_LOGGER_THREAD(i.e captures thread events) subsquent call inside this function will write to kernel event log buffer to capture pend event.This will release the semaphore on which sys_k_event_logger_get_wait() was pending hence thread gets unpend before swap gets called. Which in other words a thread which is invoking sys_k_event_logger_get_wait()(i. e sem_count = 0) get pends and unpends in single function flow when KERNEL_EVENT_LOGGER_THREAD enabled. This would cause overlapping of the stack address where return address of "_pend_current_thread" stored with esp of callee saved(i. e thread->callee_saved.esp). Thus return adrress of "_pend_current_thread" would be overwitten with zero. Which in turn causes CPU fault. The thread invoking sys_k_event_logger_get_wait() supposed to only read the events of the threads which logged to kernel event logger buffer. But it should not write to kernel event logger buffer. Otherwise it would cause the race condition explained above. Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com> |
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
event_logger.c | ||
kernel_event_logger.c | ||
sys_log.c |