Skip to content

--stop-on-fail generates a trace even though --trace is omitted #5654

Closed
@lou1306

Description

@lou1306

If I run cbmc --unwind 2 --unwinding-assertions count_by_1.i I only get a summary of the results, as expected:

** Results:
count_by_1.i function main
[main.unwind.0] line 26 unwinding assertion loop 0: FAILURE

count_by_1.i function reach_error
[reach_error.assertion.1] line 12 assertion 0: SUCCESS

** 1 of 2 failed (2 iterations)
VERIFICATION FAILED

However, if I add --stop-on-fail, CBMC will also generate a counterexample trace, even though I did not specify --trace. Is this expected behaviour? I would expect to see a summary similar to the one above, containing only the failed assertion.

Please find attached a copy of count_by_1.i. This program is part of the sv-benchmarks library and can also be found at this URL: https://github.com/sosy-lab/sv-benchmarks/blob/master/c/loop-new/count_by_1.i


Details about my setup:

CBMC version: 5.20.1
Operating system: Ubuntu 20.04
Exact command line resulting in the issue: cbmc --stop-on-fail --unwind 2 --unwinding-assertions count_by_1.i
What behaviour did you expect: CBMC reports an assertion failure and exits
What happened instead: CBMC also prints a counterexample, even though I didn't specify --trace

Program: count_by_1.i.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions