Skip to content

Single-path symex must not fail an invariant when verification succeeds #6650

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 1 commit into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion regression/cbmc/Address_of1/test.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CORE
main.c

--stop-on-fail
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
--
Adding "--stop-on-fail" should not make a difference for successful
verification, but previously caused an invariant failure when running CBMC with
"--paths."
8 changes: 7 additions & 1 deletion src/goto-checker/single_path_symex_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ operator()(propertiest &properties)
return result;
}

// leave the last worklist item in place for the benefit of output_proof
if(worklist->size() == 1)
break;

worklist->pop();
}

Expand All @@ -83,7 +87,7 @@ operator()(propertiest &properties)

final_update_properties(properties, result.updated_properties);

// Worklist is empty: we are done.
// Worklist just has the last element left: we are done.
return result;
}

Expand Down Expand Up @@ -182,6 +186,8 @@ void single_path_symex_checkert::output_error_witness(
void single_path_symex_checkert::output_proof()
{
// This is incorrect, but the best we can do at the moment.
// operator()(propertiest &properties) leaves in place the last worklist item
// just for this purpose.
const path_storaget::patht &resume = worklist->peek();
output_graphml(resume.equation, ns, options);
}