Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AProfTransformer - java.lang.ArrayIndexOutOfBoundsException: 15 #10

Open
egorlitvinenko opened this issue Sep 8, 2017 · 4 comments
Open

Comments

@egorlitvinenko
Copy link

egorlitvinenko commented Sep 8, 2017

java.lang.ArrayIndexOutOfBoundsException: 15
at org.objectweb.asm.ClassReader.readLabel(Unknown Source)
at org.objectweb.asm.ClassReader.a(Unknown Source)
at org.objectweb.asm.ClassReader.a(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.devexperts.aprof.transformer.AProfTransformer.transformImpl(AProfTransformer.java:107)
at com.devexperts.aprof.transformer.AProfTransformer.transform(AProfTransformer.java:68)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Unfortunately, I can not show you the code, it is commercial.
Java: 1.8.144
Tomcat: 8.5.16
Aprof: 32

@tsitelov
Copy link
Member

tsitelov commented Sep 8, 2017

It seems to be an issue of ASM handling for some classes with type annotations:

And they consider it as a problem of javac - https://bugs.openjdk.java.net/browse/JDK-8144185

@Godin
Copy link

Godin commented Sep 8, 2017

FWIW The root cause is clearly in javac as you can see from comments and discussions referenced in https://bugs.openjdk.java.net/browse/JDK-8144185 Also Eclipse Compiler for Java doesn't cause this problem.
And here is one more thread in ASM with potential workaround - http://forge.ow2.org/tracker/?func=detail&atid=100023&aid=317789&group_id=23

@egorlitvinenko
Copy link
Author

egorlitvinenko commented Sep 8, 2017

I confirm there are javax.annotation.Nonnull, javax.annotation.Nullable in that class. Thanks.

@tsitelov
Copy link
Member

tsitelov commented Sep 8, 2017

@egorlitvinenko
could you please check that following patch is fixing the issue:
https://gist.github.com/tsitelov/e1d492e47166fe829b5a7cc21aa8c0a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants