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 FFI cache race condition #452

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

jakelamberson
Copy link
Contributor

The race condition exists in the following circumstance:

  1. PyVEX process 1 parses ffi and opens a new cache file but has not written to it
  2. PyVEX process 2 goes to parse ffi, sees the existing (empty) cache file, opens it, then fails when it attempts to read an empty file

This commit makes cache writing atomic, preventing the race condition.

Closes #418

The race condition exists in the following circumstance:

1. PyVEX process 1 parses ffi and opens a new cache file but has not
   written to it
2. PyVEX process 2 goes to parse ffi, sees the existing (empty) cache
   file, opens it, then fails when it attempts to read an empty file

This commit makes cache writing atomic, preventing the race condition.
@ltfish ltfish merged commit 6baf2c4 into angr:master Jan 30, 2025
2 checks passed
@ltfish
Copy link
Member

ltfish commented Jan 30, 2025

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermittent CI _parse_ffi_str failure
2 participants