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/03/03 21:38:50 UTC

[jira] Reopened: (HARMONY-5507) [pack200][classlib] LocalVariableTableAttribute localVariableTableSpanO can be negative

     [ https://issues.apache.org/jira/browse/HARMONY-5507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall reopened HARMONY-5507:
--------------------------------------


I may have spoken too quickly regarding this change for this issue. It appears to fix the problem with LocalVariableTableAttribute being negative, but has introduced a problem in the values passed in for creation of LineNumberTableAttributes. Now I'm getting LineNumberTableAttributes with values like:

             attribute LineNumberTable {
                attribute_name_index = #43  // "LineNumberTable"
                attribute_length = 14
                line_number_table_length = 3
                line_number_table {
                    // start_pc line_number
                    0 2321
                    5 2322
                    10 2323
                }
              }
 
for org.apache.harmony.pack200.bytecode.CPConstant's <init> method. Looking at the reasons for this, it seems that LineNumberTableAttribute() is being passed suspiciously high values for line_numbers[].

Is there a chance the LocalVariableTableAttribute change could cause a change in LineNumberTableAttribute values?


> [pack200][classlib] LocalVariableTableAttribute localVariableTableSpanO can be negative
> ---------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5507
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5507
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: All Pack200
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: mypack.jar, mypack.pack, mypack.pack.e1.gz
>
>
> Unpacking the attached mypack.pack test case, I get an exception:
> Thread [main] (Suspended (exception ArrayIndexOutOfBoundsException))	
> 	ArrayList<E>.get(int) line: 324	
> 	LocalVariableTableAttribute.renumber(List) line: 139	
> 	BcBands.unpack(InputStream) line: 407	
> 	Segment.parseSegment(InputStream) line: 325	
> 	Segment.parse(InputStream) line: 92	
> 	Unpack.main(String[]) line: 36	
> This appears to be happening because LocalVariableTableAttribute.lengths[0] == -1107. This is a value passed into LocalVariableTableAttribute(int, int[], int[], CPUTF8[], CPUTF8[], int[]) by ClassBands.parseCodeAttrBands(InputStream, int) .
> I think the decode of this value computed by:
>         int[][] localVariableTableSpanO = decodeBandInt(
>                 "code_LocalVariableTable_span_O", in, Codec.BRANCH5,
>                 localVariableTableN);
>  is not quite right.

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