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

[Bug]: java.lang.IllegalStateException: Class Information Should not be null #1066

Open
sahilagichani14 opened this issue Sep 13, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sahilagichani14
Copy link
Collaborator

What happened?

Check #958

Version

Latest develop branch

Relevant log output

Exception in thread "main" java.lang.IllegalStateException: Class Information Should not be null
	at sootup.apk.frontend.dexpler.DexClassSource.resolveSuperclass(DexClassSource.java:114)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
	at sootup.core.model.SootClass.getSuperclass(SootClass.java:158)
	at sootup.java.core.JavaSootClass.getSuperclass(JavaSootClass.java:129)
	at java.base/java.util.Optional.flatMap(Optional.java:289)
	at sootup.interceptors.typeresolving.AugEvalFunction.getExceptionPath(AugEvalFunction.java:253)
	at sootup.interceptors.typeresolving.AugEvalFunction.getLeastCommonExceptionType(AugEvalFunction.java:281)
	at sootup.interceptors.typeresolving.AugEvalFunction.evaluate(AugEvalFunction.java:199)
	at sootup.interceptors.typeresolving.TypeResolver.applyAssignmentConstraint(TypeResolver.java:216)
	at sootup.interceptors.typeresolving.TypeResolver.resolve(TypeResolver.java:75)
	at sootup.interceptors.TypeAssigner.interceptBody(TypeAssigner.java:42)
	at sootup.apk.frontend.dexpler.DexMethodSource.resolveBody(DexMethodSource.java:65)
	at sootup.apk.frontend.dexpler.DexMethodSource.makeSootMethod(DexMethodSource.java:76)
	at sootup.apk.frontend.main.DexBody.makeSootMethod(DexBody.java:360)
	at sootup.apk.frontend.dexpler.DexMethod.makeSootMethod(DexMethod.java:55)
	at sootup.apk.frontend.dexpler.DexClassSource.loadMethod(DexClassSource.java:144)
	at sootup.apk.frontend.dexpler.DexClassSource.lambda$resolveMethods$0(DexClassSource.java:69)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at sootup.apk.frontend.dexpler.DexClassSource.resolveMethods(DexClassSource.java:70)
	at sootup.core.model.SootClass.lazyMethodInitializer(SootClass.java:78)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
	at sootup.core.model.SootClass.getMethods(SootClass.java:95)
	at sootup.java.core.JavaSootClass.getMethods(JavaSootClass.java:68)
	at sootupexport.FactGenerator.generate(FactGenerator.java:28)
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
	at sootupexport.FactGenerator.run(FactGenerator.java:22)
	at sootupexport.Main.main(Main.java:32)
@HanweiLi-cqu
Copy link

When I built callgraph for the apk, I also hit this bug.
I did some debugging and I found that sootup finds the dex file from the apk and builds a mapping for it: class sig->dex file.

When sootup goes to parse the code, it will find that some classes are not in the map. And this bug occurs.
sootup currently just finds a target android-x folder under the android platform path, but does not resolve android-x/android.jar. And the missing class file is in the android-x/android.jar. I think that's why the problem arises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants