Closed GoogleCodeExporter closed 8 years ago
...a bit more info...
Please ignore the Type.a(null, 0) values above, they're wrong (post-exception).
The
char array (b[]) definitely has the poison value: This value is just a string
in
a .class. But apparently while doing mapPath(), the type is created as an
ARRAY
sort, and it's not, it's a string. Then mapType() is called, tries to get the
element type descriptor for the internal name, and barfs.
So in a nutshell, having a String in a class that happens to start with "[" and
also
contains something that looks like a RESOURCE causes the problem.
Original comment by psych...@gmail.com
on 7 Aug 2007 at 1:53
I'm experiencing the same Exception while bundling Objectweb asm-3.0.jar to a
jar.
Tried 1.0rc3 and 1.0rc5
Original comment by toom...@gmail.com
on 8 Aug 2007 at 8:52
FYI, I've temporarily added an ugly hack around the problem in my local
com.tonicsystems.jarjar.PackageRemapper.mapPath(). Given the current impl of
ASM,
it looks like this method is especially dangerous before and after the hack -
it
could easily still fail: there are an infinite number of poison values that
will
throw or cause other havoc. I changed this section (look at the original code
and
it'll be obvious):
boolean absolute = s.startsWith("/");
if (absolute)
s = s.substring(1);
boolean array = s.startsWith("[");
if (array)
s = s.substring(1);
String after = mapType(s);
s = after;
if (array)
s = "[" + s;
if (absolute)
s = "/" + s;
Original comment by psych...@gmail.com
on 8 Aug 2007 at 5:53
The jarjar task is working again after making this change.
Original comment by toom...@gmail.com
on 9 Aug 2007 at 6:51
New JarJar release coming soon with this fix in it? JRuby is pushing a release
in a
couple weeks and we need to update JarJar to handle our annotation-based classes
correctly; but we ship ASM.
Original comment by head...@gmail.com
on 22 Oct 2007 at 1:25
FYI, here's the JRuby issue that's prompted us to upgrade JarJar:
http://jira.codehaus.org/browse/JRUBY-1456. Hopefully this is fixed already?
Original comment by head...@gmail.com
on 22 Oct 2007 at 1:29
This issue also appears when repackaging Rhino 1.6 R7.
Original comment by christop...@gmail.com
on 22 Oct 2007 at 10:16
The hack (downloadable from http://jira.codehaus.org/browse/JRUBY-1456)
repackages
Rhino 1.6 R7 without failing to build, however, the new version of Rhino still
creates class files using the old types. Presumably jarjar would have to
change the
behaviour of org.mozilla.javascript.optimizer.Codegen as well.
Original comment by christop...@gmail.com
on 22 Oct 2007 at 10:28
I had the named problem directly after downloading jarjar and trying to apply
it to a
project where Groovy (groovy-all-1.0.jar) is involved.
I think that AsmClassGenerator.class causes the problem (the next one expected
to be
listed but missing in the 'adding'-list below).
The hack provided by psychesy in Comment No 3 seems to have solved it.
--------------------------------------------------------------------------------
-----
[...]
[jarjar] adding entry org/codehaus/groovy/bsf/GroovyEngine.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$1.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$2.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$3.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$4.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$5.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$6.class
[jarjar] adding entry org/codehaus/groovy/classgen/AsmClassGenerator$7.class
BUILD FAILED
D:\Sdegui\build.xml:74: java.lang.ArrayIndexOutOfBoundsException: 20
at org.apache.tools.ant.Task.perform(Task.java:373)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1220)
at org.apache.tools.ant.Project.executeTarget(Project.java:1189)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1072)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 20
at com.tonicsystems.jarjar.asm.Type.a(Unknown Source)
at com.tonicsystems.jarjar.asm.Type.getElementType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.PackageRemapper.mapPath(PackageRemapper.java:82)
at com.tonicsystems.jarjar.PackageRemapper.mapValue(PackageRemapper.java:104)
at
com.tonicsystems.jarjar.asm.commons.RemappingMethodAdapter.visitLdcInsn(Unknown
Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at
com.tonicsystems.jarjar.ext_util.JarTransformer.process(JarTransformer.java:35)
at
com.tonicsystems.jarjar.ext_util.JarProcessorChain.process(JarProcessorChain.jav
a:31)
at com.tonicsystems.jarjar.MainProcessor.process(MainProcessor.java:83)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.zipFile(AntJarProcessor.java:55
)
at org.apache.tools.ant.taskdefs.Zip.zipFile(Zip.java:1146)
at org.apache.tools.ant.taskdefs.Zip.addResources(Zip.java:681)
at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:481)
at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:350)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.execute(AntJarProcessor.java:42
)
at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:50)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
... 10 more
--- Nested Exception ---
java.lang.ArrayIndexOutOfBoundsException: 20
at com.tonicsystems.jarjar.asm.Type.a(Unknown Source)
at com.tonicsystems.jarjar.asm.Type.getElementType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.asm.commons.Remapper.mapType(Unknown Source)
at com.tonicsystems.jarjar.PackageRemapper.mapPath(PackageRemapper.java:82)
at com.tonicsystems.jarjar.PackageRemapper.mapValue(PackageRemapper.java:104)
at
com.tonicsystems.jarjar.asm.commons.RemappingMethodAdapter.visitLdcInsn(Unknown
Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at com.tonicsystems.jarjar.asm.ClassReader.accept(Unknown Source)
at
com.tonicsystems.jarjar.ext_util.JarTransformer.process(JarTransformer.java:35)
at
com.tonicsystems.jarjar.ext_util.JarProcessorChain.process(JarProcessorChain.jav
a:31)
at com.tonicsystems.jarjar.MainProcessor.process(MainProcessor.java:83)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.zipFile(AntJarProcessor.java:55
)
at org.apache.tools.ant.taskdefs.Zip.zipFile(Zip.java:1146)
at org.apache.tools.ant.taskdefs.Zip.addResources(Zip.java:681)
at org.apache.tools.ant.taskdefs.Zip.executeMain(Zip.java:481)
at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:350)
at
com.tonicsystems.jarjar.ext_util.AntJarProcessor.execute(AntJarProcessor.java:42
)
at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:50)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1220)
at org.apache.tools.ant.Project.executeTarget(Project.java:1189)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1072)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Original comment by dirk.det...@googlemail.com
on 7 Nov 2007 at 11:21
Sorry, for some reason I was not getting notification of issues posted here.
I'll
investigate the problem and get a new release out ASAP.
Original comment by chris.no...@gmail.com
on 7 Nov 2007 at 8:57
Fixes checked into SVN. Please give it a go. I'll put out a new release later
this week.
Sorry for the delay! The project was configured to send issue updates to the
mailing
list but something must have gone wrong.
Original comment by chris.no...@gmail.com
on 8 Nov 2007 at 6:21
Original issue reported on code.google.com by
psych...@gmail.com
on 31 Jul 2007 at 12:35Attachments: