Opened 11 years ago

Closed 11 years ago

#5296 closed defect (wontfix)

shrinksafe exception when parsing a large file

Reported by: guest Owned by: alex
Priority: high Milestone: 1.1
Component: ShrinkSafe Version: 1.0
Keywords: Cc: sjs@…
Blocked By: Blocking:

Description

Shrinksafe dies on a particular file:

stsmith@stsmith-ws02:/tmp/js$ cat break_custom_rhino.sh
#!/bin/bash

JSFILE="break_custom_rhino.js"
CMD="java -jar custom_rhino.jar $JSFILE"
NFUNCS=2854

rm -f "$JSFILE"
for ((i=1; i<=NFUNCS+1; ++i))
do
        echo "function f$i() {}" >> "$JSFILE"
        if [ $i -ge $NFUNCS ]
        then
                echo "running ($CMD) on $i functions"
                $CMD > /dev/null
        fi
done

exit
stsmith@stsmith-ws02:/tmp/js$ ./break_custom_rhino.sh
running (java -jar custom_rhino.jar break_custom_rhino.js) on 2854 functions
running (java -jar custom_rhino.jar break_custom_rhino.js) on 2855 functions
Exception in thread "main" java.lang.ClassFormatError: Invalid method Code length 65549 in class file org/mozilla/javascript/gen/c1
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62)
        at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:126)
        at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:81)
        at org.mozilla.javascript.Context.compileImpl(Context.java:2415)
        at org.mozilla.javascript.Context.compileString(Context.java:1374)
        at org.mozilla.javascript.Context.compileString(Context.java:1363)
        at org.mozilla.javascript.tools.shell.Main.loadScriptFromSource(Main.java:516)
        at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:454)
        at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:421)
        at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:412)
        at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:184)
        at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:105)
        at org.mozilla.javascript.Context.call(Context.java:576)
        at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:497)
        at org.mozilla.javascript.tools.shell.Main.exec(Main.java:167)
        at org.mozilla.javascript.tools.shell.Main.main(Main.java:145)
stsmith@stsmith-ws02:/tmp/js$

-Stephen

Change History (2)

comment:1 Changed 11 years ago by Adam Peller

Component: BuildToolsShrinkSafe
Owner: changed from James Burke to alex

comment:2 Changed 11 years ago by alex

Milestone: 1.1
Resolution: wontfix
Status: newclosed

just give java more memory:

java -Xmx500 -jar ...

Wontfix.

Note: See TracTickets for help on using tickets.