commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sarah Murray (JIRA)" <>
Subject [jira] [Commented] (BCEL-187) Verification error when an invoke references a method defined in superclass
Date Sat, 07 Mar 2015 00:11:39 GMT


Sarah Murray commented on BCEL-187:

[~jejecool] [Mark Thomas said on the mailing list that the following would help him commit
this patch|]:

After looking at [BCEL-187] for a minute or two I can see a whole pile of work that needs
to be done before I'd even think about committing anything. Just from that quick look:
1. Review the svn history to see if there are any pointers to which part of the JVM spec defines
the restriction.
2. Review the JVM spec to see if I can see the restriction
3. Look at the byte code for the provided example to see which class the invoke opcode references.
Better yet, write a disabled BCEL unit test to show this.
4. The structure of the test case looks odd. I suspect it aligns with other patches for other
issues but nowhere is that explained.
5. The class files provided do not have any attached source. Without the source code, we have
no idea (OK I could fire up a decompiler but that is another task) what is actually in those

To put it another way, the current code asserts one behaviour. The bug report asserts another.
No evidence is provided to support either position. Given that most (all?) the current committers
likely to work on BCEL don't have a deep knowledge of the JVM specs some research is required
to figure out which is correct. I've set out above how I'd do the research. I'm sure there
are other, better approaches. 

> Verification error when an invoke references a method defined in superclass
> ---------------------------------------------------------------------------
>                 Key: BCEL-187
>                 URL:
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Verifier
>    Affects Versions: 5.2
>            Reporter: Jérôme Leroux
>             Fix For: 6.0
>         Attachments: BCEL-187.patch,
> Assuming a class A with a method foo() and a class B subclass of A. If an invoke opcode
references the method then the bytecode verifier raises an error with the following
error message:
> {quote}
> Referenced method 'foo' with expected signature '()void' not found in class 'B'. The
native verifier does allow the method to be declared in some superinterface, which the Java
Virtual Machine Specification, Second Edition does not.
> {quote}
> I can't find where in the _Java Virtual Machine Specification, Second Edition_ this restriction
is defined.
> The verification of the bytecode generated by the following code fails:
> {code:java}
> public class TestLegalInvokeInterface01{
>     public static void test1(Interface01 t){
>     }
> }
> interface Interface01 extends Runnable {
> }
> {code}

This message was sent by Atlassian JIRA

View raw message