[jboss-jira] [JBoss JIRA] Commented: (JASSIST-74) modifying a method containing a switch statement using IBM JVM throws ArrayIndexOutOfBoundsException

Mooky Grand (JIRA) jira-events at lists.jboss.org
Mon Mar 16 11:38:22 EDT 2009


    [ https://jira.jboss.org/jira/browse/JASSIST-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12457457#action_12457457 ] 

Mooky Grand commented on JASSIST-74:
------------------------------------

That's weird, because I and a few other people from my office have had this problem on multiple environments.
How did you obtain your version of the JVM?

I'll try to find another version that exhibits this behavior and can be easily downloaded from IBM's site.

For now, all I can add is the contents of the script that runs my sample:

C:\dev\tools\JDK\1.5.0_15\bin\javac -source 1.4 -target 1.4 -classpath ..\javassist.jar sample\Bla.java sample\MyTest2.java
C:\dev\servers\IBM\WebSphere\5.1\WebSphere\AppServer\java\bin\java -cp .;..\javassist.jar sample.MyTest2

> 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