[JBoss JIRA] (JASSIST-125) Compilation fails with "javassist.bytecode.BadBytecode: jsr at 406" WebLogic 10.3 JTA data source class
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-125?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-125.
---------------------------------
> Compilation fails with "javassist.bytecode.BadBytecode: jsr at 406" WebLogic 10.3 JTA data source class
> -------------------------------------------------------------------------------------------------------
>
> Key: JASSIST-125
> URL: https://issues.jboss.org/browse/JASSIST-125
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.12.0.GA
> Environment: Reproduced on Linux x86 and Windows XP (x86).
> Reporter: Mooky Grand
> Assignee: Shigeru Chiba
> Fix For: 3.13.0.GA
>
>
> Trying to add code at the beginning of the method getConnection in the class weblogic.jdbc.jta.DataSource I got the following error:
> Exception in thread "main" javassist.CannotCompileException: by javassist.bytecode.BadBytecode: jsr at 399
> at javassist.CtBehavior.insertBefore(CtBehavior.java:728)
> at javassist.CtBehavior.insertBefore(CtBehavior.java:685)
> at Test.main(Test.java:26)
> Caused by: javassist.bytecode.BadBytecode: jsr at 399
> at javassist.bytecode.stackmap.Tracer.throwBadBytecode(Tracer.java:144)
> at javassist.bytecode.stackmap.Tracer.visitJSR(Tracer.java:133)
> at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:563)
> at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:101)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
> at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:213)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:175)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:141)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:96)
> at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:416)
> at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:398)
> at javassist.CtBehavior.insertBefore(CtBehavior.java:719)
> ... 2 more
> I've created a small program that simulates this problem outside the Weblogic container.
> The class can be found inside <Weblogic home>\modules\com.bea.core.datasource6_1.4.0.0.jar.
> And additional dependency which is required in order to load this class (although it is not needed in order to modify the byte codes) is <Weblogic home>\modules\com.bea.core.transaction_2.5.0.0.jar.
> Both of these files are available when installing Weblogic 10.3.
> I suspect this might be some sort of collision with WebLogic's Diagnostic framework. I'm not sure how calls to WLDF are added, but it is possible they were added by some other tool for manipulating byte codes (at compile time), in which case this issue is a bit more interesting (could indicate collisions with certain other AOP tools).
> Just for the sake of pin pointing the source of the problem, I also used AspectJ to add code to the method. It worked fine with no errors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JASSIST-129) getRefClasses() fails for some of the inner classes defined in java.util
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-129?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-129.
---------------------------------
> getRefClasses() fails for some of the inner classes defined in java.util
> ------------------------------------------------------------------------
>
> Key: JASSIST-129
> URL: https://issues.jboss.org/browse/JASSIST-129
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.13.0.GA
> Reporter: Maciej Kokocinski
> Assignee: Shigeru Chiba
> Fix For: 3.14.0.GA
>
>
> CtClass.getRefClasses() reports not existing classes in some cases.
> One out of many examples is "java.util.LinkedList$DescendingIterator". getRefClasses() for this class returns, as one of the resulting list elements, "istItr" which is obviously wrong as there is no such class.
> There is a field inside this class named itr of type 'java.util.LinkedList$ListItr". If we get fieldInfo for this field its descriptor is "Ljava/util/LinkedList$ListItr;", however if we take its SignatureAttribute, then its signature is "Ljava/util/LinkedList<TE;>.ListItr;". When this string is parsed during AttributeInfo.renameClass(List, ClassMap) then a class named "istItr" is 'found'.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JASSIST-123) Explicit class import support for compiler (not whole packages)
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-123?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-123.
---------------------------------
> Explicit class import support for compiler (not whole packages)
> ---------------------------------------------------------------
>
> Key: JASSIST-123
> URL: https://issues.jboss.org/browse/JASSIST-123
> Project: Javassist
> Issue Type: Patch
> Reporter: Ivan Prisiazhnyy
> Assignee: Shigeru Chiba
> Labels: compiler, import
> Fix For: 3.14.0.GA
>
>
> This is patch for MemberResolver class for Javassist 3.12.GA
> It adds support for compiler to understand importing of certain classes in packages, not the whole packages.
> With this patch the following code will do its job:
> ClassPool x = ClassPool.getDefault();
> x.importPackage("java.io.File");
> Patch it self:
> *** MemberResolver.java 2010-04-04 02:21:30.000000000 +0300
> --- MemberResolver.java 2010-06-10 14:38:03.000000000 +0300
> ***************
> *** 429,434 ****
> --- 429,445 ----
> }
> catch (NotFoundException e) {
> classPool.recordInvalidClassName(fqName);
> +
> + try {
> + if (pac.endsWith(orgName)) {
> + CtClass cc = classPool.get(pac);
> + // if the class is found,
> + classPool.recordInvalidClassName(orgName);
> + return cc;
> + }
> + } catch (NotFoundException ee) {
> + classPool.recordInvalidClassName(pac);
> + }
> }
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JASSIST-145) erroneous "bad array type for AALOAD: null" when verifying
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-145?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-145.
---------------------------------
> erroneous "bad array type for AALOAD: null" when verifying
> ----------------------------------------------------------
>
> Key: JASSIST-145
> URL: https://issues.jboss.org/browse/JASSIST-145
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.15.0-GA
> Reporter: Shigeru Chiba
> Assignee: Shigeru Chiba
> Fix For: 3.16.0-GA
>
>
> (reported by Johannes Schindelin)
> When verifying bytecode compiled for Java 1.6+ where we need to provide a
> StackMapTable attribute which we verify ourselves first, the sequence
> ACONST_NULL
> ASTORE_0
> ...
> ALOAD_0
> ICONST_0
> AALOAD
> triggers the verifier to add NullType as an equivalent type for the
> ArrayType. Since that code might be unreachable after instrumenting or the
> local variable might have been set otherwise before jumping back to this
> code, we really need ArrayType's isNullType() method to report the correct
> result.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (JASSIST-146) ClassFile.compact mangles large class files
by Shigeru Chiba (JIRA)
[ https://issues.jboss.org/browse/JASSIST-146?page=com.atlassian.jira.plugi... ]
Shigeru Chiba closed JASSIST-146.
---------------------------------
> ClassFile.compact mangles large class files
> -------------------------------------------
>
> Key: JASSIST-146
> URL: https://issues.jboss.org/browse/JASSIST-146
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.15.0-GA
> Environment: Fedora Linux 14 x86_64, Java 1.6.0_27
> Reporter: Paul Rupe
> Assignee: Shigeru Chiba
> Fix For: 3.16.0-GA
>
>
> I have a large .class file (1307829 bytes). Simply reading it in using javassist, calling ClassFile.compact(), then writing it out to a new file creates an invalid class file that is substantially larger (1996560 bytes).
> javap -c throws an EOFException:
> java.io.EOFException
> at java.io.DataInputStream.readFully(DataInputStream.java:197)
> at java.io.DataInputStream.readFully(DataInputStream.java:169)
> at sun.tools.javap.AttrData.read(AttrData.java:54)
> at sun.tools.javap.FieldData.read(FieldData.java:91)
> at sun.tools.javap.ClassData.readFields(ClassData.java:211)
> at sun.tools.javap.ClassData.read(ClassData.java:114)
> at sun.tools.javap.ClassData.<init>(ClassData.java:70)
> at sun.tools.javap.JavapPrinter.<init>(JavapPrinter.java:48)
> at sun.tools.javap.Main.displayResults(Main.java:208)
> at sun.tools.javap.Main.perform(Main.java:79)
> at sun.tools.javap.Main.entry(Main.java:67)
> at sun.tools.javap.Main.main(Main.java:52)
> javassist throws an exception trying to read back the class file it just created:
> java.lang.ClassCastException: javassist.bytecode.FieldrefInfo cannot be cast to javassist.bytecode.Utf8Info
> at javassist.bytecode.ConstPool.getUtf8Info(ConstPool.java:615)
> at javassist.bytecode.AttributeInfo.read(AttributeInfo.java:76)
> at javassist.bytecode.FieldInfo.read(FieldInfo.java:253)
> at javassist.bytecode.FieldInfo.<init>(FieldInfo.java:63)
> at javassist.bytecode.ClassFile.read(ClassFile.java:783)
> at javassist.bytecode.ClassFile.<init>(ClassFile.java:109)
> at Test.compact(Test.java:21)
> at Test.main(Test.java:12)
> Attempting to use the new class file in an application results in
> java.lang.ClassFormatError: Invalid this class index 537 in constant pool in class file WorldGenCreateGuild
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months