Menu

#529 Getting crash on optimization - Null Pointer Exception and then Stack error

v4.11
closed-fixed
None
6
2014-10-27
2014-06-23
Joel Hirsh
No

Getting crash on optimization. The error identifies a particular method, but there is nothing unusual I can see in that method other than that it has 16 arguments. The class itself also has nothing unusual, no java warnings. Also, that class and method are used in three other builds that are quite similar and those optimize without any errors. Those other builds have all the same proguard options, and approximately 90% the same code. That makes we wonder if its even possible to simplify the problem.

This error has been occurring for quite some time, but it used to get one unexpected error and then skip over optimizing that method. After recent changes (some of which were in the identified class) it now gets a second unexpected error and then terminates. Same issue in V5 beta. Turning off optimization does prevent any errors.

Verbose output is as follows:

Ignoring unused library classes...
Original number of library classes: 19683
Final number of library classes: 707
Shrinking...
Removing unused program classes and class elements...
Original number of program classes: 189
Final number of program classes: 74
Inlining subroutines...
Optimizing...
Unexpected error while shrinking instructions after partial evaluation:
Class = [com/qiftools/conv/OFXWriter]
Method = [writeInvestment(Lcom/qiftools/util/QDate;Ljava/lang/String;Lcom/qiftools/conv/QIFInvActions$Action;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lja
va/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DDDDLjava/lang/String;)V]

Exception = [java.lang.NullPointerException] (null)
Not optimizing this method
Unexpected error while performing partial evaluation:
Class = [com/qiftools/conv/OFXWriter]
Method = [writeInvestment$1f219bf2(Lcom/qiftools/util/QDate;Ljava/lang/String;Lcom/qiftools/conv/QIFInvActions$Action;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/S
tring;Ljava/lang/String;Ljava/lang/String;DDDDLjava/lang/String;)V]

Exception = [java.lang.IllegalArgumentException] (Stacks have different current sizes [0] and [1])
java.lang.IllegalArgumentException: Stacks have different current sizes [0] and [1]
at proguard.evaluation.Stack.generalize(Stack.java:125)
at proguard.evaluation.TracedStack.generalize(TracedStack.java:148)
at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:683)
at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:602)
at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:560)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:264)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
at proguard.optimize.evaluation.LivenessAnalyzer.visitCodeAttribute(LivenessAnalyzer.java:205)
at proguard.optimize.evaluation.VariableOptimizer.visitCodeAttribute(VariableOptimizer.java:105)
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
at proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:95)
at proguard.classfile.util.SimplifiedVisitor.visitProgramMethod(SimplifiedVisitor.java:91)
at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:504)
at proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
at proguard.classfile.ClassPool.classesAccept(ClassPool.java:124)
at proguard.optimize.Optimizer.execute(Optimizer.java:926)
at proguard.ProGuard.optimize(ProGuard.java:306)
at proguard.ProGuard.execute(ProGuard.java:115)
at proguard.ProGuard.main(ProGuard.java:483)

===================
Running ProGuard v4.11, Windows 64, Java 1.7.0_45
If there is anything else I can provide to trace it down, will be happy to do that.

Related

Bugs: #529

Discussion

  • Eric Lafortune

    Eric Lafortune - 2014-06-25

    Thanks for your report. This will be tricky to figure out, since the problem is caused in some different location. If you ever have a small sample project to reproduce the problem, that would be great. Otherwise, would it be possible to mail me the compiled class file that contains the mentioned method 'writeInvestments'?

     
    • Joel Hirsh

      Joel Hirsh - 2014-06-25

      Attached is the class file.

      Also the project that causes this is actually pretty small. The attached
      zip file has the pre-optimized jar file, the included jars (other than the
      main java libs) which are all open source, and the .pro file that will
      create the error. BTW, there is one undefined reference (intentional) in
      the build.

      Thanks

      On Wed, Jun 25, 2014 at 7:02 AM, Eric Lafortune lafortune@users.sf.net
      wrote:

      Thanks for your report. This will be tricky to figure out, since the
      problem is caused in some different location. If you ever have a small
      sample project to reproduce the problem, that would be great. Otherwise,
      would it be possible to mail me the compiled class file that contains
      the mentioned method 'writeInvestments'?


      Status: open
      Group: v4.11
      Created: Mon Jun 23, 2014 10:04 PM UTC by Joel Hirsh
      Last Updated: Mon Jun 23, 2014 10:04 PM UTC
      Owner: nobody

      Getting crash on optimization. The error identifies a particular method,
      but there is nothing unusual I can see in that method other than that it
      has 16 arguments. The class itself also has nothing unusual, no java
      warnings. Also, that class and method are used in three other builds that
      are quite similar and those optimize without any errors. Those other builds
      have all the same proguard options, and approximately 90% the same code.
      That makes we wonder if its even possible to simplify the problem.

      This error has been occurring for quite some time, but it used to get one
      unexpected error and then skip over optimizing that method. After recent
      changes (some of which were in the identified class) it now gets a second
      unexpected error and then terminates. Same issue in V5 beta. Turning off
      optimization does prevent any errors.

      Verbose output is as follows:

      Ignoring unused library classes...
      Original number of library classes: 19683
      Final number of library classes: 707
      Shrinking...
      Removing unused program classes and class elements...
      Original number of program classes: 189
      Final number of program classes: 74
      Inlining subroutines...
      Optimizing...
      Unexpected error while shrinking instructions after partial evaluation:
      Class = [com/qiftools/conv/OFXWriter]
      Method =
      [writeInvestment(Lcom/qiftools/util/QDate;Ljava/lang/String;Lcom/qiftools/conv/QIFInvActions$Action;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lja

      va/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DDDDLjava/lang/String;)V]
      Exception = [java.lang.NullPointerException] (null)
      Not optimizing this method
      Unexpected error while performing partial evaluation:
      Class = [com/qiftools/conv/OFXWriter]
      Method =
      [writeInvestment$1f219bf2(Lcom/qiftools/util/QDate;Ljava/lang/String;Lcom/qiftools/conv/QIFInvActions$Action;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/S
      tring;Ljava/lang/String;Ljava/lang/String;DDDDLjava/lang/String;)V]

      Exception = [java.lang.IllegalArgumentException] (Stacks have different
      current sizes [0] and [1])
      java.lang.IllegalArgumentException: Stacks have different current sizes
      [0] and [1]
      at proguard.evaluation.Stack.generalize(Stack.java:125)
      at proguard.evaluation.TracedStack.generalize(TracedStack.java:148)
      at
      proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:683)
      at
      proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:602)
      at
      proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:560)
      at
      proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:264)
      at
      proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
      at
      proguard.optimize.evaluation.LivenessAnalyzer.visitCodeAttribute(LivenessAnalyzer.java:205)
      at
      proguard.optimize.evaluation.VariableOptimizer.visitCodeAttribute(VariableOptimizer.java:105)
      at
      proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
      at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
      at
      proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:95)
      at
      proguard.classfile.util.SimplifiedVisitor.visitProgramMethod(SimplifiedVisitor.java:91)
      at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
      at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:504)
      at
      proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
      at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
      at proguard.classfile.ClassPool.classesAccept(ClassPool.java:124)
      at proguard.optimize.Optimizer.execute(Optimizer.java:926)
      at proguard.ProGuard.optimize(ProGuard.java:306)
      at proguard.ProGuard.execute(ProGuard.java:115)
      at proguard.ProGuard.main(ProGuard.java:483)

      ===================
      Running ProGuard v4.11, Windows 64, Java 1.7.0_45
      If there is anything else I can provide to trace it down, will be happy to
      do that.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/proguard/bugs/529/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #529

      • Eric Lafortune

        Eric Lafortune - 2014-08-10

        I can't seem to find the attachments, Could you attach them or mail them to me? Thanks.

         
        • Joel Hirsh

          Joel Hirsh - 2014-08-19

          Sorry for the delay.

          Those files are attached to this email

          On Sun, Aug 10, 2014 at 4:05 AM, Eric Lafortune lafortune@users.sf.net
          wrote:

          I can't seem to find the attachments, Could you attach them or mail them
          to me? Thanks.


          Status: open
          Group: v4.11
          Created: Mon Jun 23, 2014 10:04 PM UTC by Joel Hirsh
          Last Updated: Wed Aug 06, 2014 12:19 AM UTC
          Owner: Eric Lafortune

          Getting crash on optimization. The error identifies a particular method,
          but there is nothing unusual I can see in that method other than that it
          has 16 arguments. The class itself also has nothing unusual, no java
          warnings. Also, that class and method are used in three other builds that
          are quite similar and those optimize without any errors. Those other builds
          have all the same proguard options, and approximately 90% the same code.
          That makes we wonder if its even possible to simplify the problem.

          This error has been occurring for quite some time, but it used to get one
          unexpected error and then skip over optimizing that method. After recent
          changes (some of which were in the identified class) it now gets a second
          unexpected error and then terminates. Same issue in V5 beta. Turning off
          optimization does prevent any errors.

          Verbose output is as follows:

          Ignoring unused library classes...
          Original number of library classes: 19683
          Final number of library classes: 707
          Shrinking...
          Removing unused program classes and class elements...
          Original number of program classes: 189
          Final number of program classes: 74
          Inlining subroutines...
          Optimizing...
          Unexpected error while shrinking instructions after partial evaluation:
          Class = [com/qiftools/conv/OFXWriter]
          Method =
          [writeInvestment(Lcom/qiftools/util/QDate;Ljava/lang/String;Lcom/qiftools/conv/QIFInvActions$Action;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lja

          va/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DDDDLjava/lang/String;)V]
          Exception = [java.lang.NullPointerException] (null)
          Not optimizing this method
          Unexpected error while performing partial evaluation:
          Class = [com/qiftools/conv/OFXWriter]
          Method =
          [writeInvestment$1f219bf2(Lcom/qiftools/util/QDate;Ljava/lang/String;Lcom/qiftools/conv/QIFInvActions$Action;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/S
          tring;Ljava/lang/String;Ljava/lang/String;DDDDLjava/lang/String;)V]

          Exception = [java.lang.IllegalArgumentException] (Stacks have different
          current sizes [0] and [1])
          java.lang.IllegalArgumentException: Stacks have different current sizes
          [0] and [1]
          at proguard.evaluation.Stack.generalize(Stack.java:125)
          at proguard.evaluation.TracedStack.generalize(TracedStack.java:148)
          at
          proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:683)
          at
          proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:602)
          at
          proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:560)
          at
          proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:264)
          at
          proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
          at
          proguard.optimize.evaluation.LivenessAnalyzer.visitCodeAttribute(LivenessAnalyzer.java:205)
          at
          proguard.optimize.evaluation.VariableOptimizer.visitCodeAttribute(VariableOptimizer.java:105)
          at
          proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
          at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
          at
          proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:95)
          at
          proguard.classfile.util.SimplifiedVisitor.visitProgramMethod(SimplifiedVisitor.java:91)
          at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
          at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:504)
          at
          proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
          at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
          at proguard.classfile.ClassPool.classesAccept(ClassPool.java:124)
          at proguard.optimize.Optimizer.execute(Optimizer.java:926)
          at proguard.ProGuard.optimize(ProGuard.java:306)
          at proguard.ProGuard.execute(ProGuard.java:115)
          at proguard.ProGuard.main(ProGuard.java:483)

          ===================
          Running ProGuard v4.11, Windows 64, Java 1.7.0_45
          If there is anything else I can provide to trace it down, will be happy to
          do that.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/proguard/bugs/529/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs: #529

  • Eric Lafortune

    Eric Lafortune - 2014-08-06
    • assigned_to: Eric Lafortune
    • Priority: 5 --> 6
     
  • Eric Lafortune

    Eric Lafortune - 2014-09-25

    This bug has now been fixed for the upcoming ProGuard 5.0.1.

     
  • Eric Lafortune

    Eric Lafortune - 2014-09-25
    • status: open --> open-fixed
     
  • Eric Lafortune

    Eric Lafortune - 2014-10-27
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB