CROSSINGTUD / SPDS

Efficient and Precise Pointer-Tracking Data-Flow Framework
Eclipse Public License 2.0
41 stars 37 forks source link

Imprecise Results using getAllAliases() #65

Closed ufarooq closed 4 years ago

ufarooq commented 5 years ago

I am using almost same classes as BoomerangExampleTarget example provides, except fields are non-static. When I query results I get imprecise results. These results don't even match to Class hierarchy. When I query on last line, results include l0[a, b, nested, field] and $stack4[b, nested, field] that doesn't make sense at all.

a = new ClassWithField();
a.field = new ObjectOfInterest();
b = (ClassWithField)identity(a);
n = new NestedClassWithField();
n.nested = b;
n.nested.field.poi = x*y; // query here for  n.nested.field
johspaeth commented 5 years ago

That is the reason why the method getAllAliases is deprecated. It does not properly extract the fields. As we have not been using this method actively so far, we haven't fixed it.

ufarooq commented 5 years ago

Thanks @johspaeth for quick reply. In that case, What is a good alternative? Also, you might want to fix the Example so people don't use this API.

zepalmer commented 5 years ago

We've just run into this issue as well. As mentioned above, the getAllAliases method is used in the example file which is linked from the repo documentation. The Boomerang unit tests also appear to make use of this method; should we avoid using that testing framework as well?

Is there another method we should be calling on the analysis result to find out which variables alias the one we want to know about? Any advice on how to use the artifact would be appreciated!

johspaeth commented 5 years ago

@zepalmer Thanks a lot for reporting.

I still want to fix the method, it is an implementation issues that needs some refactoring but it is not conceptually. I hope to get it done soon (and hence did not delete occurrences of the method). However, the results the method returns are definitely incorrect. As @ufarooq pointed out the getAllAliases method still builds access path that do not even match in the class hierarchy.

You can use the testing framework except the tests that rely on the getAllAliases method. Unfortunately, there is no alternative to the getAllAliases method.

johspaeth commented 4 years ago

I am working on version 3 of Boomerang which will be merged to this repo from time to time. In version 3 the issue is solved.