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

Fix symbol resolution race #872

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

folded
Copy link
Contributor

@folded folded commented Aug 22, 2022

If two threads attempt to resolve the same symbol at the same time,
then both may test the symbol dictionary before the other has a chance
to insert a wrapper object, leading to both threads creating their
own wrapper.

Add double checked locking to avoid this possibility.

This simplifies the process of supporting multiple paths for native
code loading and allows cleanup to occur on non-windows platforms when
the libllvmlite shared library is extracted to a temporary directory.
If two threads attempt to resolve the same symbol at the same time,
then both may test the symbol dictionary before the other has a chance
to insert a wrapper object, leading to both threads creating their
own wrapper.

Add double checked locking to avoid this possibility.
@gmarkall
Copy link
Member

Note for reviewers: prior discussions on #829

@gmarkall gmarkall requested a review from esc August 23, 2022 14:51
@gmarkall gmarkall added this to the v0.40.0 milestone Aug 23, 2022
@esc esc removed their assignment Jan 16, 2023
@esc esc removed their request for review January 16, 2023 14:36
@gmarkall gmarkall modified the milestones: v0.40.0, v0.41.0 Mar 28, 2023
@esc esc removed this from the v0.41.0rc1 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants