Skip to content

Conversation

@zephyrbot
Copy link

@zephyrbot zephyrbot commented Jan 6, 2025

Backport 1a578eb from #83355.

Fixes #83354

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 <[email protected]>
Signed-off-by: Yong Cong Sin <[email protected]>
Signed-off-by: Maxim Adelman <[email protected]>
(cherry picked from commit 1a578eb)
@zephyrbot zephyrbot added Backport Backport PR and backport failure issues area: Logging labels Jan 6, 2025
@ycsin
Copy link
Member

ycsin commented Jan 31, 2025

Not sure why the doc build failed last time ¯\(ツ)

@ycsin ycsin added this to the v4.0.1 milestone Jan 31, 2025
@github-actions
Copy link

github-actions bot commented Apr 2, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Apr 2, 2025
@github-actions github-actions bot closed this Apr 16, 2025
@github-project-automation github-project-automation bot moved this from To do to Done in Backports Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Logging Backport Backport PR and backport failure issues Stale

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants