[jboss-jira] [JBoss JIRA] Commented: (JASSIST-74) modifying a method containing a switch statement using IBM JVM throws ArrayIndexOutOfBoundsException
Shigeru Chiba (JIRA)
jira-events at lists.jboss.org
Mon Mar 16 03:41:07 EDT 2009
[ https://jira.jboss.org/jira/browse/JASSIST-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12457354#action_12457354 ]
Shigeru Chiba commented on JASSIST-74:
--------------------------------------
I ran sample.MyTest2 with Javassist 3.9 and IBM J9 JVM (the same version that you used) but I didn't see the exception you reported.
My machine was Windows XP (running on VMware). Are there any hints for reproducing your bug?
> modifying a method containing a switch statement using IBM JVM throws ArrayIndexOutOfBoundsException
> ----------------------------------------------------------------------------------------------------
>
> Key: JASSIST-74
> URL: https://jira.jboss.org/jira/browse/JASSIST-74
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.8.1.GA
> Environment: OS: Probably all. I produced it on Windows
> JVM: does not happen with Sun JVM (at least the versions I used). Does happen with IBM's JVM. I used the following version:
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build pwi32dev-20060511 (SR2))
> IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20060504 (JIT enabled)
> J9VM - 20060501_06428_lHdSMR
> JIT - 20060428_1800_r8
> GC - 20060501_AA)
> JCL - 20060511a
> This version comes bundled with Websphere 6.1 ND. The Exact version that I used is "WebSphere Platform 6.1 [ND 6.1.0.0 b0620.14]"
> Reporter: Mooky Grand
> Assignee: Shigeru Chiba
> Attachments: Bla.class, Bla.class, Bla.java, MyTest2.java
>
>
> First the exception that I see:
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -2147483648
> at javassist.bytecode.CodeIterator.insertGap2(CodeIterator.java(Compiled Code))
> at javassist.bytecode.CodeIterator.insertGap0(CodeIterator.java:656)
> at javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:640)
> at javassist.bytecode.CodeIterator.insertGapCore(CodeIterator.java:467)
> at javassist.bytecode.CodeIterator.insert0(CodeIterator.java:370)
> at javassist.bytecode.CodeIterator.insertEx(CodeIterator.java:339)
> at javassist.CtBehavior.insertBefore(CtBehavior.java:671)
> at javassist.CtBehavior.insertBefore(CtBehavior.java:640)
> at sample.MyTest2.main(MyTest2.java:26)
> From the little analysis I did I discovered the following:
> 1. The problem is not reproduced using Sun's JVM.
> 2. The method being modified must be of a certain length
> 3. The method must have a switch statement.
> 4. The added code should be containe dinside a try-catch block.
> When I remove some of the repeating statements from Bla.java, the exception goes away (BTW, if I remove just one there's no exception but the resulting file is corrupted).
> Essentially, this prevents me from using Javassist under IBM's JVM for large methods that contain switch statements.
> I've reproduced this problem using javassist 3.4, 3.8 & 3.9.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list