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]: Sootup crashed when reading a JAR file. #1127

Open
subramanya-shetty opened this issue Nov 5, 2024 · 1 comment
Open

[Bug]: Sootup crashed when reading a JAR file. #1127

subramanya-shetty opened this issue Nov 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@subramanya-shetty
Copy link

What happened?

Version: 1.3.0
Scenario: Trying to extract class, method and field-level details from a JAR file
Expected: Get relevant details (worked for most other JARs).
observed: Crash when reading a particular JAR file.

Interface.zip

Version

Latest develop branch

Relevant log output

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
	at org.objectweb.asm.ClassReader.readUtf(ClassReader.java:3684)
	at org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:3671)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:604)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
	at sootup.java.bytecode.frontend.AsmUtil.initAsmClassSource(AsmUtil.java:76)
	at sootup.java.bytecode.frontend.AsmJavaClassProvider.createClassSource(AsmJavaClassProvider.java:62)
	at sootup.java.bytecode.inputlocation.PathBasedAnalysisInputLocation.lambda$walkDirectory$3(PathBasedAnalysisInputLocation.java:178)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at sootup.java.bytecode.inputlocation.PathBasedAnalysisInputLocation.walkDirectory(PathBasedAnalysisInputLocation.java:182)
	at sootup.java.bytecode.inputlocation.ArchiveBasedAnalysisInputLocation.getClassSources(ArchiveBasedAnalysisInputLocation.java:115)
	at sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation.getClassSources(JavaClassPathAnalysisInputLocation.java:182)
	at sootup.java.core.views.JavaView.lambda$getClasses$1(JavaView.java:94)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
	at java.util.Collections$2.tryAdvance(Collections.java:4719)
	at java.util.Collections$2.forEachRemaining(Collections.java:4727)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at sootup.java.core.views.JavaView.getClasses(JavaView.java:98)
	at BenchmarkWithSootup.toRequiredFormat(BenchmarkWithSootup.java:106)
	at BenchmarkWithSootup.extractDataFromBytecode(BenchmarkWithSootup.java:574)
	at BenchmarkWithSootup.main(BenchmarkWithSootup.java:816)

Process finished with exit code 1
@subramanya-shetty subramanya-shetty added the bug Something isn't working label Nov 5, 2024
@swissiety
Copy link
Collaborator

Hi @subramanya-shetty ,
It seems the asm library failed to read a given .class file.. but maybe we are not feeding it a valid .class file.
Can you set a breakpoint before it fails and share the filename?

@sahilagichani14 sahilagichani14 self-assigned this Dec 8, 2024
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