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.
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'?
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:
Related
Bugs:
#529I can't seem to find the attachments, Could you attach them or mail them to me? Thanks.
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:
Related
Bugs:
#529This bug has now been fixed for the upcoming ProGuard 5.0.1.