[ 
https://issues.apache.org/jira/browse/XGC-109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16047550#comment-16047550
 ] 

Julien Gouesse commented on XGC-109:
------------------------------------

Hi

At first, the suggested patch makes sense to me. It would still be valuable if 
it didn't cause any crash as it drives the behaviour of this class much more 
consistent and it drives it more robust.
tooCloseToRound(double, int) calls Math.abs() on the source to round, it seems 
to be logical to do the same in tooManyDigitsUsed(double, int). Moreover, the 
current source code (i.e without this patch) performs a sum between the scale 
and NaN whereas the patch makes this method return false in this case; in my 
humble opinion, the latter is more understandable and more robust than the 
former.

Finally, no OpenJDK contributor has replied yet concerning the backport of the 
bug fix that would mitigate this bug:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-June/048168.html

> Exception in DoubleFormatUtil.tooManyDigitsUsed with Windows 64 bits / Java 8
> -----------------------------------------------------------------------------
>
>                 Key: XGC-109
>                 URL: https://issues.apache.org/jira/browse/XGC-109
>             Project: XMLGraphicsCommons
>          Issue Type: Bug
>          Components: utilities
>    Affects Versions: trunk, 2.2
>         Environment: Windows 64 bits  / Java 8 64 bits
>            Reporter: Valery LEPRETRE
>             Fix For: trunk, 2.2
>
>         Attachments: DoubleFormatUtil.java
>
>
> Hi,
> I was recently confronted to this trouble with Windows 64 bits / Java 8:
> When you start a JVM (Java 8 / 64 bits) from a C, C++ (or other non Java) 
> program using xml-graphics to convert a svg to pdf, a crash occurs with  
> number 0 or negative in DoubleFormatUtil.tooManyDigitsUsed.
> It's because the VM is not handling correctly Floating point exception (fixed 
> in Java 9)
> To avoid this error, I propose to protect the call of function 
> tooManyDigitsUsed



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to