Open SaswatPadhi opened 3 years ago
We already add such an assignment: https://github.com/diffblue/cbmc/blob/f76d7fa90fe48c4fa6f6d98fba7485f0de78401c/src/ansi-c/goto_check_c.cpp#L2059
It's just not visible in the plain-text trace, as it arises from a function marked as hidden. The XML and JSON traces will report this assignment (an assignment to __CPROVER_memory_leak
), but we should perhaps just stop marking __CPROVER__start
as hidden (currently done in generate_ansi_c_start_function
).
CBMC version: 5.29.0 Operating system: Mac OS 10.15.7
Testcase:
Exact command line resulting in the issue:
cbmc --trace --memory-leak-check test.c | tail -n 21
What behaviour did you expect: The trace would show the object that was not
free
d.What happened instead: The trace just reports that the assertion
__CPROVER_memory_leak == NULL
failedWorkaround: If I manually track the
__CPROVER_memory_leak
variable, like:then I see the
leaked
object in the trace:cbmc --trace --memory-leak-check new-test.c | tail -n 21
Would it be possible to automatically insert a variable like this so that the leaked object would be visible in the generated trace?