zephyr/tests/lib
Yong Cong Sin 1a578eb72c lib: os: mpsc_pbuf: do not wait when spinlock is held
Check if the spinlock is held before attempting to wait by
taking the semaphore, as that would cause a context switch which
isn't allowed and will trigger an assertion error when
`CONFIG_SPIN_VALIDATE` is enabled.

Logging in spinlock-held context when the log buffer is full can lead
to an infinite assertion error loop, as the logging subsys attempts to
allocate buffer when there's none available, it will try to wait for
one and thus triggers the assertion error, the error message will be
printed through the logging sybsys but there's no buffer available,
so it will try to wait for one and triggers another assertion error..
This loop just goes on and on forever, and nothing gets printed to
the terminal.

Added a test to validate the fix.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Maxim Adelman <imax@meta.com>
2025-01-06 06:53:52 +01:00
..
acpi
c_lib tests: lib: c_lib: add the proper dependency for asctime_r and ctime_r 2024-11-23 20:12:02 -05:00
cbprintf_fp
cbprintf_package tests: lib: cbprintf_package: Extend test coverage 2024-11-01 09:56:03 -05:00
cmsis_dsp manifest: update cmsis-dsp to v1.16.2 2024-11-25 14:42:07 +01:00
cmsis_nn tests: cmsis_nn: reduce architecture scope 2024-11-16 15:01:55 -05:00
cpp tests: lib: cpp: cxx: Exclude Renesas RZ in cpp98 2024-12-12 11:12:22 +01:00
devicetree tests: fix zephyr/drivers/gpio.h usage 2024-12-20 03:17:25 +01:00
fdtable
gui/lvgl tests: lib: gui: lvgl: Add testcase for OSAL implementation 2025-01-04 14:17:10 +01:00
hash_function
hash_map
heap boards: rename qemu_xtensa to qemu_xtensa/dc233c 2024-10-02 09:58:36 +02:00
heap_align
json json: support parsing and serializing 'uint64_t' 2024-10-05 14:04:48 -04:00
linear_range
lockfree tests: remove misnamed platforms from platform_exclude 2024-09-16 10:07:51 +02:00
math/interpolation tests: lib: interpolation: added 2024-08-29 16:12:36 -04:00
mem_alloc
mem_blocks
mem_blocks_stats
mpsc_pbuf lib: os: mpsc_pbuf: do not wait when spinlock is held 2025-01-06 06:53:52 +01:00
multi_heap multi_heap: introduce support for realloc() 2024-11-16 14:02:07 -05:00
net_buf tests: lib: net_buf: move network buffer tests to tests/lib/net_buf 2024-09-07 11:19:05 -05:00
newlib
notify
onoff
p4workq Revert "tests: disable NRF5 entropy driver on some bsim/qemu tests" 2024-12-12 00:15:39 +00:00
ringbuffer
shared_multi_heap
smf
sprintf
spsc_pbuf
sys_util
time