You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Cornwall (JIRA)" <ji...@apache.org> on 2008/08/27 19:21:44 UTC

[jira] Created: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

[pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
------------------------------------------------------------------

                 Key: HARMONY-5960
                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M6
         Environment: All Pack200
            Reporter: Andrew Cornwall


The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626317#action_12626317 ] 

Andrew Cornwall commented on HARMONY-5960:
------------------------------------------

It looks as if the failure cases have hasAllCodeFlags() == false. Not sure if that's a coincidence or not. In my test cases, codeSpecialHeader (and thus codeFlagsCount) is always zero when hasAllCodeFlags() is false in ClassBands.parseCodeBands().

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar, derby.jar.pack.gz
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sian January resolved HARMONY-5960.
-----------------------------------

    Resolution: Fixed

Resolving this, since the issue reported was fixed.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, nojdk16.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sian January resolved HARMONY-5960.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M8

Thanks Andrew - it looks like the test class has no code attributes at all, and we weren't handling that case correctly.

Fixed at r689764.  Please check that this fully resolves your issue.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628143#action_12628143 ] 

Andrew Cornwall commented on HARMONY-5960:
------------------------------------------

Your fix does appear to resolve the issue with the IndexOutOfBoundsException in BcBands.unpack. 

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, nojdk16.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627454#action_12627454 ] 

Sian January commented on HARMONY-5960:
---------------------------------------

No, that's not right - in the case where some code has attributes and some doesn't we need to have some way of knowing what code to assign the attribute to (i.e. not just the first 73).  I've checked in a probable fix at r690951, but I'm not closing this JIRA for now because the class-level comparison isn't always right for inner classes in that archive so I need to find out if that's the same issue or a different one.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, nojdk16.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall updated HARMONY-5960:
-------------------------------------

    Attachment: derby.jar.pack.gz

File causing exception in BcBands.unpack.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar.pack.gz
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626222#action_12626222 ] 

Andrew Cornwall commented on HARMONY-5960:
------------------------------------------

It looks as if ClassBands.getOrderedCodeAttributes is returning a collection whose size is less than classCount. Does this indicate a problem in parseCodeAttrBands?


> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar.pack.gz
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall updated HARMONY-5960:
-------------------------------------

    Attachment: nojdk16.pack.gz

Even without JDK 1.6 classes, I still get errors unpacking with r689764. The attached .pack.gz demonstrates the problem.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, nojdk16.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sian January closed HARMONY-5960.
---------------------------------


> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, nojdk16.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626273#action_12626273 ] 

Andrew Cornwall commented on HARMONY-5960:
------------------------------------------

Even if you pack the original JAR with -E1, you'll still get an IndexOutOfBounds on unpack.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar, derby.jar.pack.gz
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall updated HARMONY-5960:
-------------------------------------

    Attachment: smaller-tc.zip

Attached smaller-tc.zip, smaller test case with just one .class file. It also exhibits the problem, and none of its .class files is major version 50.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar, derby.jar.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall updated HARMONY-5960:
-------------------------------------

    Attachment: derby.jar

Original JAR file before packing

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar, derby.jar.pack.gz
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall reopened HARMONY-5960:
--------------------------------------


This appears to fix the smaller test case, but I still get an error with the larger testcase. Is that because it has JDK 1.6 classes in it? (If so, we should probably detect and fail more elegantly... maybe with a Pack200Exception in ClassBands.parseClassAttrBands?)

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall updated HARMONY-5960:
-------------------------------------

    Affects Version/s: 5.0M7

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>         Attachments: derby.jar.pack.gz
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Andrew Cornwall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626669#action_12626669 ] 

Andrew Cornwall commented on HARMONY-5960:
------------------------------------------

I can get the code to run to completion by changing your patch to test if(orderedCodeAttributes.size() > i) instead of >0, but I'm not confident at all that will do the right thing.

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, nojdk16.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sian January reassigned HARMONY-5960:
-------------------------------------

    Assignee: Sian January

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: derby.jar, derby.jar.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5960) [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626505#action_12626505 ] 

Sian January commented on HARMONY-5960:
---------------------------------------

Andrew - I'd like to check the smaller jar and pack file in as a regression test case.  It looks like it's a class from Apache Derby so if it's unmodified I can't see a reason not to from Harmony's point of view.  From your point of view, would that be ok, or is there a reason why I shouldn't do that?

> [pack200][classlib] IndexOutOfBounds exception in BcBands.unpack()
> ------------------------------------------------------------------
>
>                 Key: HARMONY-5960
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5960
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6, 5.0M7
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>             Fix For: 5.0M8
>
>         Attachments: derby.jar, derby.jar.pack.gz, smaller-tc.zip
>
>
> The attached file will cause an IndexOutOfBoundsException when unpacking on Harmony, but not when unpacking using the Sun code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.