Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2896 closed defect (invalid)

ShrinkSafe does not work for very large inputs

Reported by: guest Owned by: alex
Priority: high Milestone:
Component: BuildTools Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

When running the dojo compressor on large inputs, I get strange exceptions.

On my 1.2Mb input, running JDK 1.5.0_10, 32bit on Gentoo linux, I get the following stack trace (I get the same stack trace on Win32 JDK 1.6.0_01):

Exception in thread "main" java.lang.IllegalArgumentException?: out of range index

at org.mozilla.classfile.ClassFileWriter?.add(ClassFileWriter?.java:541) at org.mozilla.classfile.ClassFileWriter?.addLoadConstant(ClassFileWriter?.java:601) at org.mozilla.classfile.ClassFileWriter?.addPush(ClassFileWriter?.java:837) at org.mozilla.javascript.optimizer.BodyCodegen?.visitSpecialCall(Codegen.java:2571) at org.mozilla.javascript.optimizer.BodyCodegen?.generateExpression(Codegen.java:1763) at org.mozilla.javascript.optimizer.BodyCodegen?.visitSetProp(Codegen.java:3743) at org.mozilla.javascript.optimizer.BodyCodegen?.generateExpression(Codegen.java:2118) at org.mozilla.javascript.optimizer.BodyCodegen?.generateStatement(Codegen.java:1660) at org.mozilla.javascript.optimizer.BodyCodegen?.generateStatement(Codegen.java:1510) at org.mozilla.javascript.optimizer.BodyCodegen?.generateBodyCode(Codegen.java:1181) at org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:285) at org.mozilla.javascript.optimizer.Codegen.compileToClassFile(Codegen.java:157) at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:67) at org.mozilla.javascript.Context.compileImpl(Context.java:2327) at org.mozilla.javascript.Context.compileString(Context.java:1323) at org.mozilla.javascript.Context.compileString(Context.java:1312) at org.mozilla.javascript.tools.shell.Main.loadScriptFromSource(Main.java:500) at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:439) at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:406) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:397) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:181) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:102) at org.mozilla.javascript.Context.call(Context.java:540) at org.mozilla.javascript.ContextFactory?.call(ContextFactory?.java:447) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:164) at org.mozilla.javascript.tools.shell.Main.main(Main.java:142)

One user on the compressor documentation page reports the following exception for his 636Kb input file:

Exception in thread "main" java.lang.ClassFormatError?: Invalid method Code length 66140 in class file org/mozilla/javascript/gen/c1 at java.lang.ClassLoader?.defineClass1(Native Method) at java.lang.ClassLoader?.defineClass(ClassLoader?.java:620) at java.lang.ClassLoader?.defineClass(ClassLoader?.java:465) at org.mozilla.javascript.DefiningClassLoader?.defineClass(DefiningClassLoader?.java:57) at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:122) at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:77) at org.mozilla.javascript.Context.compileImpl(Context.java:2346) at org.mozilla.javascript.Context.compileString(Context.java:1323) at org.mozilla.javascript.Context.compileString(Context.java:1312) at org.mozilla.javascript.tools.shell.Main.loadScriptFromSource(Main.java:500) at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:439) at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:406) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:397) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:181) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:102) at org.mozilla.javascript.Context.call(Context.java:540) at org.mozilla.javascript.ContextFactory?.call(ContextFactory?.java:447) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:164) at org.mozilla.javascript.tools.shell.Main.main(Main.java:142)

Change History (3)

comment:1 Changed 13 years ago by guest

You can reach me at prat@… with questions!

comment:2 Changed 13 years ago by alex

Resolution: invalid
Status: newclosed

you need to give java more space. See: http://dojotoolkit.org/node/188

comment:3 Changed 13 years ago by guest

Thanks a lot. Sorry that didn't occur to me on my own!

Note: See TracTickets for help on using tickets.