Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: stackwalk: fix jl_thread_suspend_and_get_state race (#56047) #192

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

kpamnany
Copy link
Collaborator

@kpamnany kpamnany commented Oct 17, 2024

PR Description

There was a missing re-assignment of old = -1; at the end of that loop which means in the ABA case, we accidentally actually acquire the lock on the thread despite not actually having stopped the thread; or in the counter-case, we try to run through this logic with old==-1 on the next iteration, and that isn't valid either (jl_thread_suspend_and_get_state should return failure and the loop will abort too early).

Checklist

Requirements for merging:

There was a missing re-assignment of old = -1; at the end of that loop
which means in the ABA case, we accidentally actually acquire the lock
on the thread despite not actually having stopped the thread; or in the
counter-case, we try to run through this logic with old==-1 on the next
iteration, and that isn't valid either (jl_thread_suspend_and_get_state
should return failure and the loop will abort too early).

Fix JuliaLang#56046
@github-actions github-actions bot added port-to-v1.10 This change should apply to Julia v1.10 builds port-to-master This change should apply to all future Julia builds labels Oct 17, 2024
@kpamnany kpamnany removed the port-to-master This change should apply to all future Julia builds label Oct 17, 2024
@kpamnany kpamnany requested a review from d-netto October 17, 2024 18:00
Copy link
Member

@d-netto d-netto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kpamnany kpamnany merged commit 01980b3 into v1.10.2+RAI Oct 17, 2024
4 checks passed
@kpamnany kpamnany deleted the kp-backport-56047 branch October 17, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-to-v1.10 This change should apply to Julia v1.10 builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants