Skip to content

Fix witnesses excluding the rf edges they enforce. #771

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

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

xeren
Copy link
Collaborator

@xeren xeren commented Nov 5, 2024

Should fix issue #767. When validating a witness, the Relation Analysis extracts rf edges, that must occur. Because rf is (usually) functional, any other candidate in-edge for the participating load event is disabled by the witness. The extraction code disabled even the extracted rf edge. The Extended Relation Analysis then inferred mutual exclusiveness between those events. Even without XRA, such loads always read 0, because of uninitialized memory.
The bug should affect all violation witnesses with at least one rf edge.

@xeren xeren added the bug label Nov 5, 2024
Comment on lines 877 to 880
for (Event r : g.getRange()) {
may.removeIf((e1, e2) -> e2 == r);
}
may.addAll(g);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would change this code to do may.removeIf((e1, e2) -> e2 == r && !g.contains(e1, e2)).
The reason is that this way, if we actually do add an rf-edge between events that may not read from each other, we get the desired mutual exclusion.
Your solution, in some sense, introduces back imprecision in such cases (must-not may suddently become may).

@hernanponcedeleon
Copy link
Owner

The bug should affect all violation witnesses with at least one rf edge.

Based on the large number of witnesses we manage to validate, I was initially surprised about this claim. However, I checked a few cases and the number of must edges in rf was always #threads+1 (i.e. those coming from pthread_create) meaning we were not getting a single rf-edge from the witness

@hernanponcedeleon hernanponcedeleon merged commit d2ccf4f into development Nov 6, 2024
1 check passed
@hernanponcedeleon hernanponcedeleon deleted the fix-xra-witness branch November 6, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants