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

memLeak analysis is affected by __goblint_check #1678

Open
sim642 opened this issue Feb 13, 2025 · 1 comment
Open

memLeak analysis is affected by __goblint_check #1678

sim642 opened this issue Feb 13, 2025 · 1 comment
Labels
good first issue sv-comp SV-COMP (analyses, results), witnesses testing

Comments

@sim642
Copy link
Member

sim642 commented Feb 13, 2025

@karoliineh found that our SV-COMP valid-memsafety verdict is impacted by inserting a __goblint_check into the program.
That is supposed to not impact the analysis at all (only output), so this behavior is wrong.

The offending code is here:

| Assert { exp; _ } ->
begin match man.ask (Queries.EvalInt exp) with
| a when Queries.ID.is_bot a -> M.warn ~category:Assert "assert expression %a is bottom" d_exp exp
| a ->
begin match Queries.ID.to_bool a with
| Some true -> ()
| Some false ->
(* If we know for sure that the expression in "assert" is false => need to check for memory leaks *)
warn_for_multi_threaded_due_to_abort man;
check_for_mem_leak man
| None ->
warn_for_multi_threaded_due_to_abort man;
check_for_mem_leak man ~assert_exp_imprecise:true ~exp:(Some exp)
end
end;
state

In particular, it should probably only be handled when Assert has refine = true or something.

@sim642 sim642 added good first issue sv-comp SV-COMP (analyses, results), witnesses testing labels Feb 13, 2025
@michael-schwarz
Copy link
Member

Yeah, this is to handle the case of program execution ending at an assert (because then the memory is usually not cleaned up). Only invoking this in case refine = true sounds reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue sv-comp SV-COMP (analyses, results), witnesses testing
Projects
None yet
Development

No branches or pull requests

2 participants