Skip to content

Fix graphml output of concurrency witnesses #1511

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
Oct 24, 2017
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
Fix graphml output of concurrency witnesses
The START_THREAD instruction may induce a number of assignments, which end up as
assignment in the symex_target_equation while the corresponding pc still points
to a START_THREAD instruction. Hence testing assignments must be done
consistently either within the symex_target_equation or within the goto program
level.
  • Loading branch information
tautschnig committed Oct 24, 2017
commit 444d8244c9694b58c96ba63bf45f0cec2e9d1793
8 changes: 8 additions & 0 deletions regression/cbmc-concurrency/graphml_witness1/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int global;

int main()
{
__CPROVER_ASYNC_1: global=1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest // Create thread to set global to 1 then exit

global=2;
Copy link
Contributor

Choose a reason for hiding this comment

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

// Runs in main thread only ?

assert(global==2); // to fail
Copy link
Contributor

Choose a reason for hiding this comment

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

// Fails if the spawned thread runs after the main

}
10 changes: 10 additions & 0 deletions regression/cbmc-concurrency/graphml_witness1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE
main.c
--graphml-witness -
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</graphml>
--
^warning: ignoring
2 changes: 1 addition & 1 deletion src/goto-programs/graphml_witness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static bool filter_out(
goto_tracet::stepst::const_iterator &it)
{
if(it->hidden &&
(!it->is_assignment() ||
(!it->pc->is_assign() ||
to_code_assign(it->pc->code).rhs().id()!=ID_side_effect ||
to_code_assign(it->pc->code).rhs().get(ID_statement)!=ID_nondet))
return true;
Expand Down