After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 565371 - Crashes on some architectures because of wrong zero check on doubles
Crashes on some architectures because of wrong zero check on doubles
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.22.x
Other Linux
: Normal major
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-22 17:51 UTC by Josselin Mouette
Modified: 2009-02-19 23:34 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Correctly check the radius against division by zero (473 bytes, patch)
2008-12-22 17:53 UTC, Josselin Mouette
committed Details | Review

Description Josselin Mouette 2008-12-22 17:51:30 UTC
The following test case makes librsvg crash on mips and sparc architectures (and basically all architectures where (int) NaN == INT_MAX):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
        <rect
           width="1"
           height="1"
           ry="1.7e-17"
            />
</svg>
Comment 1 Josselin Mouette 2008-12-22 17:53:06 UTC
Created attachment 125149 [details] [review]
Correctly check the radius against division by zero

This patch from Thomas Viehmann fixes the issue by replacing the (foo == 0.0) checks by appropriate ones.
Comment 2 Dominic Lachowicz 2008-12-22 17:57:53 UTC
Good catch. I'll cook up a similar patch that doesn't incur the fabs() penalty.
Comment 3 Josselin Mouette 2008-12-22 22:08:06 UTC
Is there really a penalty with fabs() ? GCC should inline it, leading to a minimal performance impact in this change.
Comment 4 Dominic Lachowicz 2008-12-22 22:48:06 UTC
I just know that Cairo and some other projects do things a bit differently for performance-related reasons. It's probably worth copying their lead, if only to be similar with a related project that shares some of the same goals and developers.