You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Shi Jun Zhang (JIRA)" <ji...@apache.org> on 2010/09/03 05:06:33 UTC
[jira] Created: (HARMONY-6641) [classlib][luni] FloatParser returns
wrong value and uses 1GB memory and 100% cpu
[classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
---------------------------------------------------------------------------------
Key: HARMONY-6641
URL: https://issues.apache.org/jira/browse/HARMONY-6641
Project: Harmony
Issue Type: Bug
Components: Classlib
Affects Versions: 5.0M14
Environment: all
Reporter: Shi Jun Zhang
Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (HARMONY-6641) [classlib][luni] FloatParser returns
wrong value and uses 1GB memory and 100% cpu
Posted by "Shi Jun Zhang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shi Jun Zhang closed HARMONY-6641.
----------------------------------
Verified. Thanks Mark.
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Fix For: 5.0M16
>
> Attachments: HARMONY-6641-v2.diff, HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908007#action_12908007 ]
Mark Hindess commented on HARMONY-6641:
---------------------------------------
No need to make the patch again but you have the assertEquals arguments the wrong way around so you get confusing failure messages from the tests you added.
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Attachments: HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909816#action_12909816 ]
Hudson commented on HARMONY-6641:
---------------------------------
Integrated in Harmony-1.5-head-linux-x86_64 #944 (See [https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/944/])
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Fix For: 5.0M16
>
> Attachments: HARMONY-6641-v2.diff, HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909645#action_12909645 ]
Mark Hindess commented on HARMONY-6641:
---------------------------------------
Thanks. I applied your new patch (with a modified version of the new tests) at r997212. Please verify (by closing this JIRA) that it has been applied as expected.
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Attachments: HARMONY-6641-v2.diff, HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6641) [classlib][luni] FloatParser returns
wrong value and uses 1GB memory and 100% cpu
Posted by "Shi Jun Zhang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shi Jun Zhang updated HARMONY-6641:
-----------------------------------
Attachment: HARMONY-6641-v2.diff
Sorry for the mistake. I attached the wrong patch last time. The minimal exponent for float should be -46 because 7.0064923216240853546186479164496e-46 will be parsed as 1.40129846432481707e-45f.
I also modified the test case.
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Attachments: HARMONY-6641-v2.diff, HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-6641) [classlib][luni] FloatParser returns
wrong value and uses 1GB memory and 100% cpu
Posted by "Shi Jun Zhang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shi Jun Zhang updated HARMONY-6641:
-----------------------------------
Attachment: HARMONY-6641.diff
The root cause is that when the exponent is too large or too small, the exponent will overflow or the FloatPointingParser will parse the very large exponent or very small exponent into native code, and then causes the 1GB memory usage and 100% cpu usage. Actually when exponent is larger than 38 for float and larger than 308 for double, the number will be treated as infinity. The same way to negative exponent.
My patch do 2 things,
1. ensure the exponent will not overflow in the initialParse(String, int) method.
2. if the exponent is too large or too small, just return infinity or 0.0 instead of invoke the native method.
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Attachments: HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908015#action_12908015 ]
Mark Hindess commented on HARMONY-6641:
---------------------------------------
I get a FloatTest failure on linux/x86 after applying the fix:
Incorrect float returned, expected minimum float. expected:
<1.401298464324817E-45> but was:<0.0>
junit.framework.AssertionFailedError: Incorrect float returned, expected
minimum float. expected:<1.401298464324817E-45> but was:<0.0>
at
org.apache.harmony.luni.tests.java.lang.FloatTest.test_parseFloatLjava_lang_String
(FloatTest.java:294)
at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Attachments: HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Hindess resolved HARMONY-6641.
-----------------------------------
Fix Version/s: 5.0M16
Resolution: Fixed
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Fix For: 5.0M16
>
> Attachments: HARMONY-6641-v2.diff, HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Mark Hindess (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Hindess reassigned HARMONY-6641:
-------------------------------------
Assignee: Mark Hindess
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Attachments: HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-6641) [classlib][luni] FloatParser
returns wrong value and uses 1GB memory and 100% cpu
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-6641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909866#action_12909866 ]
Hudson commented on HARMONY-6641:
---------------------------------
Integrated in Harmony-select-1.5-head-linux-x86_64 #106 (See [https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/106/])
> [classlib][luni] FloatParser returns wrong value and uses 1GB memory and 100% cpu
> ---------------------------------------------------------------------------------
>
> Key: HARMONY-6641
> URL: https://issues.apache.org/jira/browse/HARMONY-6641
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M14
> Environment: all
> Reporter: Shi Jun Zhang
> Assignee: Mark Hindess
> Fix For: 5.0M16
>
> Attachments: HARMONY-6641-v2.diff, HARMONY-6641.diff
>
>
> Float.valueOf("320.0E+2147483647") will return 32.0 and Float.valueOf("-1.4E-2147483314") will use 1GB memory, 100% cpu and hang. RI will return infinity and -0.0
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.