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

Add realloc support #712

Merged
merged 16 commits into from
May 4, 2022
Merged

Add realloc support #712

merged 16 commits into from
May 4, 2022

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Apr 29, 2022

Closes #701.

Also includes a couple of blob and pointer casting changes that were necessary to get chrony's array.c to work soundly (i.e. not going to VD.top) while not breaking any other tests (particularly with calloc).

TODO

  • Tasks from Complete realloc support #701.
  • Figure out what to do about cast_addr changing alloc variable type from void. Had to disable to get chrony array.c to work (otherwise a cast to char* screwed up the type and any following casts to a larger struct type were considered not ok, so supertop got introduced).
  • Adapt realloc accesses to free type after Add option for ignoring races from free #695 merge.

@sim642 sim642 self-assigned this Apr 29, 2022
@sim642
Copy link
Member Author

sim642 commented Apr 29, 2022

The small cast_addr change of not changing varinfo types exposes a profound amount of trouble. So many things seem to be based on types (which we don't have for allocated memory) instead of on the structure of the abstract value. These mismatching for alloc variables (and possibly other cases) cause countless operations to just fall all the way back to their default supertop-returning case and transitively spreading those supertops everywhere else as well.

@sim642
Copy link
Member Author

sim642 commented May 2, 2022

I got all tests to pass again by hacking the varinfo type-change hack even further: avoid it when casting to char* because that's a special pointer cast by the standard and used for byte-based access to memory (like chrony's array.c is doing).

@sim642 sim642 marked this pull request as ready for review May 2, 2022 08:49
src/analyses/base.ml Outdated Show resolved Hide resolved
@michael-schwarz michael-schwarz self-requested a review May 4, 2022 13:50
@sim642 sim642 merged commit fbf61bc into master May 4, 2022
@sim642 sim642 deleted the realloc branch May 4, 2022 16:52
@sim642 sim642 added this to the v2.0.0 milestone Aug 12, 2022
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.

Complete realloc support
2 participants