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

VerifyError: Inconsistent stackmap frames #147

Closed
koral-- opened this issue Jun 13, 2016 · 5 comments
Closed

VerifyError: Inconsistent stackmap frames #147

koral-- opened this issue Jun 13, 2016 · 5 comments

Comments

@koral--
Copy link

koral-- commented Jun 13, 2016

What steps will reproduce the problem?

Execute test using EqualsVerifier with Intellij code coverage on OSX.

What is the code that triggers this problem?

All usages of EqualsVerifier.forClass() are failing. Eg:

        EqualsVerifier.forClass(MediaDescriptor.class)
                .suppress(Warning.ALL_FIELDS_SHOULD_BE_USED)
                .verify();

What error message or stack trace does EqualsVerifier give?

java.lang.VerifyError: Inconsistent stackmap frames at branch target 71
Exception Details:
  Location:
    javafx/collections/FXCollections.observableList(Ljava/util/List;Ljavafx/util/Callback;)Ljavafx/collections/ObservableList; @71: areturn
  Reason:
    Type 'com/sun/javafx/collections/ObservableListWrapper' (current frame, stack[0]) is not assignable to 'javafx/collections/ModifiableObservableListBase' (stack map, stack[0])
  Current Frame:
    bci: @59
    flags: { }
    locals: { 'java/util/List', 'javafx/util/Callback', 'java/lang/Object' }
    stack: { 'com/sun/javafx/collections/ObservableListWrapper' }
  Stackmap Frame:
    bci: @71
    flags: { }
    locals: { 'java/util/List', 'javafx/util/Callback', 'java/lang/Object' }
    stack: { 'javafx/collections/ModifiableObservableListBase' }
  Bytecode:
    0x0000000: 1241 b800 474d 2c11 007a b800 4b2a c600
    0x0000010: 072b c700 122c 1100 7bb8 004b bb00 5359
    0x0000020: b700 54bf 2c11 007d b800 4b2a c100 5699
    0x0000030: 000f bb00 5859 2a2b b700 64a7 000c bb00
    0x0000040: 5d59 2a2b b700 65b0                    
  Stackmap Table:
    append_frame(@21,Object[#4])
    same_frame(@36)
    same_frame(@62)
    same_locals_1_stack_item_frame(@71,Object[#96])


    at javafx.beans.binding.ListExpression.<clinit>(ListExpression.java:59)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at nl.jqno.equalsverifier.internal.Util.classForName(Util.java:31)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addJavaFxProperty(JavaApiPrefabValues.java:438)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addJavaFxClasses(JavaApiPrefabValues.java:304)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addJavaClasses(JavaApiPrefabValues.java:87)
    at nl.jqno.equalsverifier.JavaApiPrefabValues.addTo(JavaApiPrefabValues.java:75)
    at nl.jqno.equalsverifier.EqualsVerifier.<init>(EqualsVerifier.java:113)
    at nl.jqno.equalsverifier.EqualsVerifier.forClass(EqualsVerifier.java:124)
    at com.test.media.MediaDescriptorTest.testEquals(MediaDescriptorTest.java:37)

What did you expect?

There should be no failure. The same test works in all other known configurations executions eg. in Android Studio without code coverage, from commadline (without IDE), on the same JDK version on Linux.

Which version of EqualsVerifier are you using?

2.1

Please provide any additional information below.

The latest Oracle JDK 8:

$ java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

The latest stable Android Studio:
Android Studio 2.1.2 Build#AI-143.2915827

I'm not sure if bug is located in EqualsVerifier, but according to this SO post it may be, so I'm first reporting it here. Indeed adding -noverify JVM argument works.

@jqno
Copy link
Owner

jqno commented Jun 13, 2016

Thanks for reporting this. However, I can't reproduce it. I've downloaded Android Studio 2.1.2, but I still get a green bar without error when I run a test that uses EV with coverage.

Can you provide me a small but complete project that reproduces this issue?

@koral--
Copy link
Author

koral-- commented Jun 13, 2016

Here it is: https://github.com/koral--/equalsverifiertest
You have to execute all the unit tests. If only one using EV is executed then error is not thrown. Error occurs when test without EV is executed first. I haven't checked what happens if test order is different.

@jqno
Copy link
Owner

jqno commented Jun 13, 2016

Thanks, I was able to reproduce the issue with this project. I'll let you know when I know more :).

@jqno
Copy link
Owner

jqno commented Jun 14, 2016

It probably has to do with the fact that EqualsVerifier compiles for Java 7, but it does interact with classes of the Java 8 APIs if they're available (in this case, it failed on JavaFX's ObservableList). I have a fix, and I'll make a release tonight.

@jqno
Copy link
Owner

jqno commented Jun 14, 2016

Released in version 2.1.1!

@jqno jqno closed this as completed Jun 14, 2016
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