You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Catherine Hope (JIRA)" <ji...@apache.org> on 2009/07/17 16:54:15 UTC

[jira] Updated: (HARMONY-6276) [luni][lang] Float.toString() can give wrong string and throws ArrayIndexOutOfBoundsException on AIX 32bit

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

Catherine Hope updated HARMONY-6276:
------------------------------------

    Attachment: 6276-patch.txt

Problem is modules/luni/src/main/native/luni/shared/cbigint.c - AIX is not defined to "USE_LL".  Put fix in this file, and the same in dblparse.c and fltparse.c

added new cases to FloatTest.test_toString to demonstrate issue.  

The native fix also prevents a hang on AIX in the FloatTest at the following point:

at org/apache/harmony/luni/util/FloatingPointParser.parseFltImpl(Ljava/lang/String;I)F (Native Method)
    [junit]     at org/apache/harmony/luni/util/FloatingPointParser.parseFloat(Ljava/lang/String;)F (FloatingPointParser.java:310)
    [junit]     at java/lang/Float.parseFloat(Ljava/lang/String;)F (Float.java:289)
    [junit]     at org/apache/harmony/luni/tests/java/lang/FloatTest.doTestCompareRawBits(Ljava/lang/String;ILjava/lang/String;)V (FloatTest.java:90)
    [junit]     at org/apache/harmony/luni/tests/java/lang/FloatTest.test_parseFloat_LString_Harmony6261()V (FloatTest.java:793)

> [luni][lang] Float.toString() can give wrong string and throws ArrayIndexOutOfBoundsException on AIX 32bit
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6276
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6276
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: AIX PPC 32bit
>            Reporter: Catherine Hope
>         Attachments: 6276-patch.txt
>
>
> Float.toString() fails on AIX 32 bit for the following float values:
>        Float f;
>        // 1E19F (and above) displays as "@.0E19"
>        f = 1E19F; 
>        System.out.println("1E19F: " + f);
>        
>        // 1E-36F displays completely wrong value
>        f = 1E-36F;
>        System.out.println("1E-36F: " + f);
>        
>        // and 1E-38F (and below) throws an ArrayIndexOutOfBoundsException: Array index out of range: 25
>        f = 1E-38F ;
>        System.out.println("1E-37F: " + f);

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