You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2019/07/06 15:14:00 UTC
[jira] [Commented] (BCEL-303) AssertionViolatedException in Pass 3A
Verification of invoke instructions
[ https://issues.apache.org/jira/browse/BCEL-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16879699#comment-16879699 ]
Gary Gregory commented on BCEL-303:
-----------------------------------
The {{A}} class file you provided is not in a Java package, therefore I cannot add it along with all of your other classes with the exact same unpackaged class name :( to our {{src/test/resources}} folder.
It would be great if you could provide class files in a package named after _something_ like jqf_0, jqf_1, and son on. This would allow us to add these files as {{src/test/resources/jqf_0/Hello.class}}, {{src/test/resources/jqf_1/A.class}}, and so on.
> AssertionViolatedException in Pass 3A Verification of invoke instructions
> -------------------------------------------------------------------------
>
> Key: BCEL-303
> URL: https://issues.apache.org/jira/browse/BCEL-303
> Project: Commons BCEL
> Issue Type: Bug
> Components: Verifier
> Affects Versions: 6.2
> Reporter: Rohan Padhye
> Priority: Major
> Attachments: A.class
>
>
> The verifier throws an assertion violation / INTERNAL ERROR in pass 3A when verifying a malformed class file.
> As I understand it, the issue is that if class A implements interface B, then class A can be pass stage 1 verification even if class B is not resolved. However, pass 3A verification of code that invokes a method defined on class A assumes that the receiver type and all its interfaces are fully resolved.
> h1. Steps to reproduce:
>
> Save the attached file as "example/A.class" and run:
> java -cp <classpath> org.apache.bcel.verifier.Verifier example.A
>
> The file A.class was generated automatically by the fuzzer JQF (https://github.com/rohanpadhye/jqf).
> h2. Expected output:
> VERIFIED_REJECTED
> h2. Observed output:
> JustIce by Enver Haase, (C) 2001-2002.
> <http://bcel.sourceforge.net>
> <http://commons.apache.org/bcel>
>
> Now verifying: example.A
>
> Pass 1:
> VERIFIED_OK
> Passed verification.
>
> Pass 2:
> VERIFIED_OK
> Passed verification.
>
> Exception in thread "main" org.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL ERROR: Missing class: java.lang.ClassNotFoundException: Exception while looking for class example.I0: java.io.IOException: Couldn't find: example/I0.class
> at org.apache.bcel.verifier.statics.Pass3aVerifier$InstOperandConstraintVisitor.visitINVOKEVIRTUAL(Pass3aVerifier.java:1315)
> at org.apache.bcel.generic.INVOKEVIRTUAL.accept(INVOKEVIRTUAL.java:89)
> at org.apache.bcel.generic.InstructionHandle.accept(InstructionHandle.java:302)
> at org.apache.bcel.verifier.statics.Pass3aVerifier.pass3StaticInstructionOperandsChecks(Pass3aVerifier.java:443)
> at org.apache.bcel.verifier.statics.Pass3aVerifier.do_verify(Pass3aVerifier.java:208)
> at org.apache.bcel.verifier.PassVerifier.verify(PassVerifier.java:71)
> at org.apache.bcel.verifier.Verifier.doPass3a(Verifier.java:89)
> at org.apache.bcel.verifier.Verifier.main(Verifier.java:216)
> Caused by: java.lang.ClassNotFoundException: Exception while looking for class example.I0: java.io.IOException: Couldn't find: example/I0.class
> at org.apache.bcel.util.MemorySensitiveClassPathRepository.loadClass(MemorySensitiveClassPathRepository.java:97)
> at org.apache.bcel.classfile.JavaClass.getInterfaces(JavaClass.java:847)
> at org.apache.bcel.verifier.statics.Pass3aVerifier$InstOperandConstraintVisitor.getMethodRecursive(Pass3aVerifier.java:1181)
> at org.apache.bcel.verifier.statics.Pass3aVerifier$InstOperandConstraintVisitor.visitINVOKEVIRTUAL(Pass3aVerifier.java:1304)
> ... 7 more
> Caused by: java.io.IOException: Couldn't find: example/I0.class
> at org.apache.bcel.util.ClassPath.getClassFile(ClassPath.java:279)
> at org.apache.bcel.util.ClassPath.getInputStream(ClassPath.java:209)
> at org.apache.bcel.util.ClassPath.getInputStream(ClassPath.java:188)
> at org.apache.bcel.util.MemorySensitiveClassPathRepository.loadClass(MemorySensitiveClassPathRepository.java:95)
> ... 10 more
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)