Skip to content

System.exit in finally hides a failing assertion (false SAFE) #60

Closed

Description

@nils-loose

If the program calls System.exit inside a finally block while an AssertionError is propagating, SWAT reports SAFE although the assertion fails.

Reproducer:

int x = Verifier.nondetInt();
try {
  assert x != 7;
} finally {
  if (x == 7) System.exit(3);
}

Expected: VIOLATION (or UNKNOWN). Actual: [VERDICT valid-assert.prp] == OK.

The JVM exits before the assertion failure is recorded as a target. No current sv-benchmarks Java task calls System.exit.

Activity

  1. added this to the SV-COMP 2027 milestone on Oct 15, 2026
  2. nils-loose commented on Oct 20, 2026

    @nils-loose
    ContributorAuthor

    Fixed in #67, merged into dev through #92.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions