Skip to content

CBMC verification failure with --lazy-methods, brace-initialized static array #846

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

Closed
reuk opened this issue Apr 19, 2017 · 2 comments
Closed

Comments

@reuk
Copy link
Contributor

reuk commented Apr 19, 2017

Using the current tip of test-gen-support (7cbe566), the following program fails verification when invoked with --lazy-methods and succeeds otherwise. The full command-line is cbmc Main.class (--lazy-methods).

class Problem {
  private static final Object[] DEFAULT = {};
  private Object data;

  Problem() {
    this.data = DEFAULT;
  }

  void checkInvariant() {
    assert data != null;
  }
}

public class Main {
  public static void main(String[] args) {
    new Problem().checkInvariant();
  }
}

@smowton, do you know why this might be?

@smowton
Copy link
Contributor

smowton commented Apr 20, 2017

Yep, the initialisation takes place in a static initialiser, and they currently aren't picked up by lazy method elaboration. Will put a patch together tomorrow morning.

@smowton
Copy link
Contributor

smowton commented Apr 21, 2017

@reuk I can't assign reviewers, but you should probably look at #855

kroening pushed a commit that referenced this issue Apr 27, 2017
Lazy loading: load static initializers for needed classes. Fixes #846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants