Skip to content

Mysterious Java symbolic execution #209

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
vladrich opened this issue Aug 21, 2016 · 4 comments
Closed

Mysterious Java symbolic execution #209

vladrich opened this issue Aug 21, 2016 · 4 comments

Comments

@vladrich
Copy link
Contributor

In the following (distilled) program, xx is assigned only once. In the trace that CBMC generates, xx is assigned multiple times with different values. I suspect this causes problems in the full benchmark.

public final class MySecureRandom {

public static void main(String[] argv) {
    int index = 0;

    while (index < 20) {

        for (int i = 0; i < 20; i++) {
            index++;
        }
    }

    int xx = index;
    assert(xx==1);

}

}

@kroening
Copy link
Member

Can you check wether pull requests #185 or #193 fix this?

@vladrich
Copy link
Contributor Author

Not sure how to merge this with the fix for bug #197.

@mgudemann
Copy link
Contributor

This is an instance of the error fixed in #185

    LocalVariableTable:
      Start  Length  Slot  Name   Signature
            10      15     2     i   I
             0      50     0  argv   [Ljava/lang/String;
             2      48     1 index   I
            30      20     2    xx   I

in the local variable table, xx has the same slot index as i and "shadows" it without the PR.

@kroening
Copy link
Member

This now works.

smowton added a commit to smowton/cbmc that referenced this issue May 9, 2018
…on_dump

Add LVSA domain JSON dump support
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

3 participants