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

First approximation of pthread_setspecific by escaping things reachable from the argument and invalidating all globals #877

Merged
merged 3 commits into from
Nov 2, 2022

Conversation

michael-schwarz
Copy link
Member

Our analysis currently is sound here, as the second argument to the function is considered escaped, and treated flow-insensitively from there on. Also, it is invalidated when sem.unknown_function.invalidate.globals is set.

Any later writes thus do not lead to the value being changed back from T and thus all writes through the pointer obtained back from pthread_getspecific are also accounted for.

This adds an assert that fails if the code makes use of pthread_setspecific and ``sem.unknown_function.invalidate.globals` is disabled, leading to unsound results.

This a temporary measure before #876 is attacked.

…t if program contains `pthread_setspecific`
@michael-schwarz michael-schwarz changed the title Add sanity check that sem.unknown_function.invalidate.globals is set if program contains pthread_setspecific First approximation of pthread_setspecific by escaping things reachable from the argument and invalidating all globals Nov 2, 2022
@michael-schwarz michael-schwarz merged commit 25e6c34 into master Nov 2, 2022
@michael-schwarz michael-schwarz deleted the pthread_setspecific_sanity branch November 2, 2022 11:39
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.

2 participants