Skip to content
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

A bug about the class hierarchy #1376

Open
kitty-1998 opened this issue Mar 19, 2024 · 1 comment
Open

A bug about the class hierarchy #1376

kitty-1998 opened this issue Mar 19, 2024 · 1 comment

Comments

@kitty-1998
Copy link

kitty-1998 commented Mar 19, 2024

I use Wala to construct a call graph via CHA algorithm, but the call graph is empty (without nodes and edges). After an investgation, I find it may be caused by an incomplete class hierarchy.

Input file

The jar file is from Maven: https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp/4.11.0

Wala setup

AnalysisScope scope = AnalysisScopeReader.instance.makeJavaBinaryAnalysisScope("Path/to/jar", walaExclusionFile);
scope.addToScope(javaScope);  // JDK jar
IClassHierarchy hierarchy = ClassHierarchyFactory.makeWithRoot(scope);
Iterable<Entrypoint> entryPoints = generateEntryPoints(hierarchy); // We involve many entry methods in this library, but the generateEntryPoints is too long to show here 
AnalysisOptions options = new AnalysisOptions(scope, entryPoints);
CallGraph cg = new CHACallGraph(hierarchy);
try {
    ((CHACallGraph) cg).init(entryPoints);
} catch (CancelException e) {
    throw new RuntimeException(e);
}

How to reproduce

Analyze the jar file with the setup above.

Expected behavior

Finish analysis with correct graph.

Stacktrace

There is no exception, but the hierarchy didn't contain any class in the jar to be analyzed. See the figuare below, I debugged the program, but found no ok-http related classes in the hierarchy.
image

@msridhar
Copy link
Member

@kitty-1998 I'm really sorry for my slow response here. If this is still an issue for you, can you confirm that with your same driver code you are able to successfully construct a CHA call graph for other jar files? In other words, is this an issue specifically with the okhttp jar? Thanks and sorry again for the delay.

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