roterdam / jchord

Automatically exported from code.google.com/p/jchord
3 stars 0 forks source link

instrumentation can cause class file size to go over 65535 #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Heavy instrumentation of class files that are already large (e.g. 
containing large arrays being initialized with constant String values) can 
cause the instrumented class file to exceed 65535 bytes.  The following 
exception occurs when this file is subsequently loaded for a dynamic 
analysis:

ERR> Exception in thread "main" java.lang.ClassFormatError: JVMCFRE042 
bytecode array size > 65535; 
class=org/apache/fop/text/linebreak/LineBreakUtils, offset=196356
ERR>    at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
ERR>    at java.security.SecureClassLoader.defineClass(Unknown Source)
ERR>    at java.net.URLClassLoader.defineClass(URLClassLoader.java:493)
ERR>    at java.net.URLClassLoader.access$300(URLClassLoader.java:64)
ERR>    at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:892)
ERR>    at 
java.security.AccessController.doPrivileged(AccessController.java:284)
ERR>    at java.net.URLClassLoader.findClass(URLClassLoader.java:414)
ERR>    at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
ERR>    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:300)
ERR>    at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
ERR>    at 
org.apache.fop.text.linebreak.LineBreakStatus.nextChar(LineBreakStatus.java
:76)

This is not a bug but it needs cleaner reporting.  Investigate if it is 
possible to catch this bug in chord.instr.Instrumentor while writing the 
instrumented class file to disk.  The easiest fix for this bug is to simply 
put the name of the class (org.apache.fop.text.linebreak.LineBreakUtils in 
the above example) in the value of system property chord.scope.exclude.ext 
to prevent it from being instrumented. 

Original issue reported on code.google.com by mayur.naik on 14 Mar 2010 at 8:38

GoogleCodeExporter commented 9 years ago
Fixed in r685.  Now a warning is generated that instrumenting the class is 
being 
skipped and the instrumented class written to disk is deleted.

Original comment by mayur.naik on 27 Mar 2010 at 1:09