#463 Java 7 obfuscation VerifyError: Bad return type

v4.8
open
None
6
2014-11-04
2013-02-20
No

I'm getting the following error with Proguard 4.8
JVM and Compiler is Java 1.7 Update 11 with Java 7 compliance.
Our code runs fine without the obfuscation.
The method is private and AbstractOperation is not obfuscated whereas PropertySource is.
AbstractOperation is a Java 7 class file.
The code runs fine with -Xverify:none

Options are
-dontshrink
-dontoptimize
-defaultpackage obClasses
-allowaccessmodification
-useuniqueclassmembernames
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontnote
-dontwarn
-ignorewarnings
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable,Signature,Deprecated,InnerClasses,Exceptions,RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,AnnotationDefault

java.lang.VerifyError: Bad return type in method xxxxxxxx.prop.model.PropertySource.e([Ljava/lang/String;)Lorg/eclipse/core/commands/operations/AbstractOperation; at offset 155)

I'm guessing the verify code is not properly rewritten in case of Java 7.
Any suggestion would help.
Class files may be supplied on request for reference.

Discussion

  • Eric Lafortune

    Eric Lafortune - 2013-02-20

    Thanks for your report. Could you check if the problem also occurs with ProGuard 4.9 beta2? If you mail me a small project that allows me to reproduce the problem, I'll look into it.

     
  • Eric Lafortune

    Eric Lafortune - 2013-02-20
    • assigned_to: Eric Lafortune
    • priority: 5 --> 6
     
  • Jens Kübler

    Jens Kübler - 2013-02-20

    I will check with ProGuard 4.9 B2.
    The class file has way to many references to isolate it. I can only give you the priori and post obfuscate class files if that helps.

     
  • Jens Kübler

    Jens Kübler - 2013-03-11

    This problem is not being solved by 4.9 Beta 2.

     
  • Eric Lafortune

    Eric Lafortune - 2013-03-20

    If you could mail me your processed (invalid) PropertySource.class file, I'll look into it.

     
  • Jens Kübler

    Jens Kübler - 2013-04-05

    Have you had some time to look at this issue?

     
  • Tobias Geyer

    Tobias Geyer - 2014-01-10

    Sorry to bring this issue up again but I'm facing the same "VerifyError: Bad return type" problem with version 4.9
    Since there has been no update on the issue I assume the problem isn't fixed yet, right?
    Any chances you can look into it?

     
    • Eric Lafortune

      Eric Lafortune - 2014-01-16

      I have identified the problem. I'm hoping to implement a solution as soon as I have some time. The fix will be available in ProGuard 4.12 beta1.

       
      • Tobias Geyer

        Tobias Geyer - 2014-01-17

        Thanks a lot, that's great to hear.

        For everyone else struggling with this, here's a workaround we found.
        Our error message stated "Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'org/jmock/Mockery' (from method signature)"

        Broken:
        public Mockery createMockery(final Object testInst, final Class<?> clazz) throws Exception {
        Mockery mockery = null;
        for (final Field field : getPossibleFields(clazz)) {
        if (Mockery.class.isAssignableFrom(field.getType())) {
        if (Mockery.class.equals(field.getType())) {
        mockery = new JUnit4Mockery();
        } else {
        mockery = (Mockery) field.getType().newInstance(); // broke here
        }
        break;
        }
        }
        return mockery;
        }

        Fixed:
        public Mockery createMockery(final Object testInst, final Class<?> clazz) throws Exception {
        Object mockery = null;
        for (final Field field : getPossibleFields(clazz)) {
        if (Mockery.class.isAssignableFrom(field.getType())) {
        if (Mockery.class.equals(field.getType())) {
        mockery = new JUnit4Mockery();
        } else {
        mockery = field.getType().newInstance();
        }
        break;
        }
        }
        return (Mockery) mockery;
        }

         
      • Tobias Geyer

        Tobias Geyer - 2014-03-28

        Sorry to bother you again - is it possible to try out a preliminary version of ProGuard 4.12?
        As far as I can see no commits happend to the publicly available source code since the release of 4.11.

        This problem is happening a lot in our unit tests which lowers the trust we have in them. Applying the workarounds is quite brittle so we'd be really happy if we could get our hands on a fixed version of Proguard.

         
        • Eric Lafortune

          Eric Lafortune - 2014-03-30

          I'm still working on version 4.12 beta1, internally. I'm aiming for this beta release within the coming few weeks. The Mercurial repository only contains the final releases, for the sake of the artifacts in Maven Central.

           
  • Jens Kübler

    Jens Kübler - 2014-11-04

    Is this fixed in any newer release ?
    Is this something that may happen in Java 8 as well ?

     
    • Eric Lafortune

      Eric Lafortune - 2014-11-04

      If I'm not mistaking, the problem has been fixed in recent versions. We are currently at ProGuard 5.1. Could you try this version on your project and let me know?

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks