Skip to content

L1 renaming at each declaration #3980

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
Mar 7, 2019
Merged

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Jan 28, 2019

I still need to review why the second commit is necessary, thus marking work-in-progress.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig
Copy link
Collaborator Author

Actually marking this RFC: the second commit makes perfect sense, it's odd that previously the suffix was not included. Could TG people (@thk123, @allredj, @peterschrammel, or anyone else) let me know whether this breaks anything on your end?

@smowton
Copy link
Contributor

smowton commented Jan 28, 2019

Would you mind elaborating briefly what kind of thing previously went wrong? I get the vague idea but just want to check my understanding. Some of that explanation might usefully make its way into comments in symex_decl.

Also am I right in thinking the symex_dead changes are purely cleanup and don't change behaviour?

@tautschnig
Copy link
Collaborator Author

Yes, I need to add a lot more documentation here/in the commit message. The (observable) problem is that objects declared in loops got the same L1 name, which implies they had the same address. Thus objects were spuriously reported as dead when their address was taken, because a pointer to the latest (live) object would be the same as one to an earlier (genuinely dead) object. A problem not yet fully fixed is regression/cbmc/vla3, which still fails despite the work here.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 205baa8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98894303
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@tautschnig
Copy link
Collaborator Author

I have cleaned up the changes a bit and made the commit messages clearer.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: ed73813).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99232393

@tautschnig tautschnig removed the RFC Request for comment label Jan 31, 2019
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 953e2d0).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99247250

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 1bab7c1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99321819

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 83e58f3).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/99759647

auto entry = unique_index_map.emplace(id, minimum_index);

if(!entry.second)
entry.first->second = std::max(entry.first->second + 1, minimum_index);
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we could avoid the if condition if the function is always called with the same minimum index, I don't know if that's always the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, even right now we (intentionally) use 0 for L1 indices when setting up new threads, but elsewhere use 1. And also that facility is rather general, we could as well use it for non-det counters any maybe others.

@tautschnig tautschnig added the Needs TG approval 🦉 Only merge with explicit approval from test-gen maintainers label Feb 21, 2019
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 9806ccd).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102906311

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 9f9c8b8).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102972059
Status will be re-evaluated on next push.
Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)

  • the author is not in the list of contributors (e.g. first-time contributors).

  • the compatibility was already broken by an earlier merge.

@tautschnig tautschnig force-pushed the block-scope branch 2 times, most recently from 2777f85 to a382218 Compare March 4, 2019 07:48
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 2777f85).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102999251
Status will be re-evaluated on next push.
Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)

  • the author is not in the list of contributors (e.g. first-time contributors).

  • the compatibility was already broken by an earlier merge.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: a382218).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/103000236
Status will be re-evaluated on next push.
Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)

  • the author is not in the list of contributors (e.g. first-time contributors).

  • the compatibility was already broken by an earlier merge.

@tautschnig tautschnig force-pushed the block-scope branch 2 times, most recently from 3885343 to 3dbd7ba Compare March 4, 2019 10:28
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 3dbd7ba).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/103022135
Status will be re-evaluated on next push.
Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)

  • the author is not in the list of contributors (e.g. first-time contributors).

  • the compatibility was already broken by an earlier merge.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: d165461).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/103065221
Status will be re-evaluated on next push.
Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)

  • the author is not in the list of contributors (e.g. first-time contributors).

  • the compatibility was already broken by an earlier merge.

Try to make clearer what we can(not) remove from renaming maps. Also do small
cleanups of the code.
This was done up until c8f0f7b. The
(observable) problem tackled here is that objects declared in loops got the same
L1 name, which implies they had the same address. Thus objects were spuriously
reported as dead when their address was taken, because a pointer to the latest
(live) object would be the same as one to an earlier (genuinely dead) object.

A side effect of this change is objects generated for test suites now have L1
indices, as witnessed in the pointer-function-parameters test.
@tautschnig tautschnig merged commit 28dc3d7 into diffblue:develop Mar 7, 2019
@tautschnig tautschnig deleted the block-scope branch March 7, 2019 00:21
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: a397a58).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/103457649

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Needs TG approval 🦉 Only merge with explicit approval from test-gen maintainers Symbolic Execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants