Skip to content

goto-harness: use __CPROVER_(de)?allocate, not malloc/free #8684

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

Conversation

tautschnig
Copy link
Collaborator

Do not use C-specific functions when amending GOTO programs.

Fixes: #8681

  • 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.

We can compile __CPROVER_allocate, but wouldn't be able to handle
ALLOCATE(type, size, bool).
@tautschnig tautschnig force-pushed the bugfixes/goto-harness-allocate branch from 402ebc3 to c6270fe Compare July 15, 2025 19:48
@kroening kroening removed their assignment Jul 15, 2025
@tautschnig tautschnig force-pushed the bugfixes/goto-harness-allocate branch from c6270fe to fe673e6 Compare July 15, 2025 20:19
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.39%. Comparing base (d148ae6) to head (f06afc4).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/ansi-c/expr2c.cpp 90.00% 1 Missing ⚠️
src/goto-harness/recursive_initialization.cpp 96.29% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8684      +/-   ##
===========================================
- Coverage    80.39%   80.39%   -0.01%     
===========================================
  Files         1688     1688              
  Lines       207392   207383       -9     
  Branches        73       73              
===========================================
- Hits        166739   166731       -8     
+ Misses       40653    40652       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Do not use C-specific functions when amending GOTO programs.

Fixes: diffblue#8681
@tautschnig tautschnig force-pushed the bugfixes/goto-harness-allocate branch from fe673e6 to f06afc4 Compare July 15, 2025 21:14
--harness-type call-function --function test_fn
^\[test_fn.assertion.1\] line 11 assertion \(a == \(int \*\)0\) \|\| \(\*a != 5\): FAILURE$
^\*\* 1 of \d+ failed
VERIFICATION FAILED

Choose a reason for hiding this comment

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

Shouldn't this test pass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not in this restricted setting of that particular regression test as we don't actually do contracts instrumentation. The full workflow now does pass.

@tautschnig tautschnig merged commit 062962c into diffblue:develop Jul 16, 2025
40 of 41 checks passed
@tautschnig tautschnig deleted the bugfixes/goto-harness-allocate branch July 16, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

goto-harness results in no body for function 'free'
4 participants