-
Notifications
You must be signed in to change notification settings - Fork 274
Concurrency: treat updates to an unknown field as atomic #6123
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
Concurrency: treat updates to an unknown field as atomic #6123
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #6123 +/- ##
===========================================
+ Coverage 78.38% 78.48% +0.09%
===========================================
Files 1686 1686
Lines 192915 192926 +11
===========================================
+ Hits 151215 151412 +197
+ Misses 41700 41514 -186
☔ View full report in Codecov by Sentry. |
// We may end up reading (and writing) all components of an object composed | ||
// of multiple fields. In such cases, we must do so atomically to avoid | ||
// overwriting components modified by another thread. Note that this also | ||
// implies multiple shared reads on the rhs being treated as atomic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment that makes this clear but ... I am a little concerned about this because now
struct s = t;
and
struct s;
s.x = t.x;
s.y = t.y;
can have different behaviour. I guess there is a very valid question about what the atomic
actions in the CPROVER concurrency model are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this case shouldn't arise for structs and mainly affects arrays: you are absolutely right that this is questionable either way. Without this patch, we'll have spurious results (as documented in the regression test). With this patch, we may miss some behaviour, depending on what exactly we otherwise consider to be atomic.
7177fc4
to
aee96fc
Compare
aee96fc
to
a0485f2
Compare
a6b0363
to
0d6eb2e
Compare
0d6eb2e
to
fe8b401
Compare
Writing to an object that is composed of multiple fields is generally treated in a field-sensitive (and thus: single-field) manner, which had fixed several issues in handling shared arrays or structs. When the specific field being updated cannot be determined during symbolic execution (as is the case with non-const indices into arrays), we update all fields that make up the full object. Such a full-object update must then be treated as an atomic operation to avoid losing intermittent writes performed by other threads. Fixes: diffblue#123
fe8b401
to
f5b35b4
Compare
Writing to an object that is composed of multiple fields is generally
treated in a field-sensitive (and thus: single-field) manner, which had
fixed several issues in handling shared arrays or structs. When the
specific field being updated cannot be determined during symbolic
execution (as is the case with non-const indices into arrays), we update
all fields that make up the full object. Such a full-object update must
then be treated as an atomic operation to avoid losing intermittent
writes performed by other threads.
Fixes: #123