Skip to content

Why can't some competitions be detected? #26

@bupt01

Description

@bupt01

Below is a simple program that violates atomicity, but I'm curious why it hasn't been successfully fixed. Is there a problem with my configuration?

package test1;
public class D {
    int x = 0;
    void m1() {
        x++;
    }
    void m2() {
        x *= 2;
    }
    void test() throws Exception{
        final D d = new D();
        Thread d1 = new Thread() {
            public void run() {
                d.m1();
            }
        };
        Thread d2 = new Thread() {
            public void run() {
                d.m2();
            }
        };
        d1.start();
        d2.start();
        d1.join();
        d2.join();
        if(d.x < 1){
            throw new Exception();
        }
    }
    public static void main(String[] args) throws Exception {
        D d= new D();
        d.test();
    }
}

my cofigure is:
{
"infer": "infer",
"options": [ "--racerdfix-only", "--starvation" ],
"json_path": "./infer-out/",
"target_options": [ "--", "javac", "-cp", "/usr/local/hippodromeDockerFiles-main/annotation.jar", "D.java" ],
"prio_files": [],
"iterations": 1
}

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