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

Exclude multithreaded main-main races by threadflag #1589

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Oct 2, 2024

This is a bit silly but the threadflag analysis may_race did not exclude main-main races even though it has all the information to do so.
It almost never makes a difference because threadflag answers the MustBeUniqueThread query based on its flag still, and the threadid analysis uses that information in its may_race.

The more notable thing is the unexpected cram test (change). Usually accesses while single-threaded aren't even added to allglobs, but apparently the thread ID variable write in pthread_create is added although as if single-threaded. This is odd for two reasons:

  1. As single-threaded it shouldn't even be in allglobs.
  2. It's actually ambiguous whether it should be written before or after the thread is created. Maybe it should be done after, thus in multi-threaded mode altogether to over-approximate the possibility.

This was always in the cram test but went unnoticed until I played around with this.

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.

1 participant