-
Notifications
You must be signed in to change notification settings - Fork 27
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
Consider more JDK Types to be Instantiated when Building Call Graphs #230
Comments
I'm currently looking into this issue. For RTA, it's actually an easy fix, as we thought we just need to add some types to the BR However, for all I'll try and see what can be done to improve this, just leaving this comment here for documentation purposes. |
Thanks for your investigation! For RTA: Question is, do we want this. These types are instantiated by the JDK, but on other system, e.g., on Android, they might not be. We could of course decide that this is the default and everyone analyzing a different system should reconfigure their analysis then. At least we should document it though and perhaps provide an AndroidProject.conf that overrides this suitably. For propagation-based: You are right and the current state of affairs is probably already incorrect. InitialInstantiatedTypesFinder always produces at least |
I have to be honest, i don't know much about Android, but we could ofc just leat the current Regarding the propagation-based instantiated analysis i do have a question: I understood that there is a TypeSetEntity called |
I think we should deal with this in OPAL, we should just be sure where to properly deal with it. I suppose at least for the types that we already model in the configured native methods, it makes sense to add them to the initially instantiated types. We could also try to get a dynamic analysis result for current JDKs with empty or Hello-World programs to see which types we might have to consider. I'm not deeply into the propagation-based code right now. If this already registers a dependency between fields and ExternalWorld, then that should already do what you describe, right? Since "any type in the type set that is a subtype of the field type" is the propagation-based rule for field reads. For method returns, are they also already connected to the external world? I'm not sure they should be, but maybe? |
Regarding the preconfiguration: I'll look into it, maybe find a suitable analysis to gather such types and post a PR! 🤓 Regarding the propagation-based analysis: I looked into this a little more, and i am fairly sure what happens is the following:
Since there will never be an update that marks |
Oh, now I understand your suggestion. I don't think we can just use any subtype of the field's type even if that type is not in the ExternalWorld set, since that would essentially degenerate the algorithm to CHA (at least for the case of virtual fields). In turn, precision would not be guaranteed to be higher than RTA in all cases anymore. However, if we add types as instantiated for RTA, we should probably add them to the ExternalWorld, too. |
Problem
In #229 we found that calls to
java/io/PrintStream.println
are not found for CG-Algorithms besides CHA when loading the JDK as interfaces. The reason is that the type iterator will not consider the typePrintStream
to be instantiated, as any code instantiating it is not actually loaded.Solution
There might / could already be some handling for this in place that either does not work anymore or does not cover
PrintStream
- see discussion in #229. Look into the issue and fix it, so that calls toprintln
are actually found when loading the JDK as interfaces.The text was updated successfully, but these errors were encountered: