Bug 118498 - KSVG/svgdisplay consumes 100% CPU and quickly eats up all available memory on certain SVG files
Summary: KSVG/svgdisplay consumes 100% CPU and quickly eats up all available memory on...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: ksvg2
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Nikolas Zimmermann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-17 08:12 UTC by Øyvind Stegard
Modified: 2011-09-19 12:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
SVG file that crashes KSVG (83.69 KB, image/svg+xml)
2005-12-17 08:17 UTC, Øyvind Stegard
Details
SVG file #2 that crashes KSVG (75.78 KB, image/svg+xml)
2005-12-17 08:18 UTC, Øyvind Stegard
Details
SVGAnimatedPointsImpl.cc.patch.diff (380 bytes, patch)
2007-07-26 08:45 UTC, patch_linams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Øyvind Stegard 2005-12-17 08:12:55 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Fedora RPMs
Compiler:          gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8)
 
OS:                Linux

Certain SVG files cause the KSVG renderer to go crazy, eating 100% CPU and quickly allocating as much memory as the system has to offer. 

This bug is serious. Someone could craft an SVG which triggers this bug, and put it on the web. It will grind the victim's system to a halt, before an eventual oom-kill happens, possibly causing data loss and other problems.

I first encountered it while kio_thumbnail was working on SVG thumbs in a local directory, displayed with Konqueror. I had to reboot, because my HD is slow (laptop), my CPU is fast (which means memory allocation is also fast), and I've got 2GB swap space (1GB RAM). This combination made my system totally unresponsive, HD working full-time.

I recently decided to track down the SVG file which caused it, and have accomplished this. I am attaching the SVG files. They are from the Open Clipart Library: http://www.openclipart.org/
The bug can easily be reproduced by running 'svgdisplay' on files. Be ready to kill off the process.

I can confirm that it happens with the follwing apps:
svgdisplay
kio_thumbnail

GIMP version 2.2.8 renders the offending SVG's without any problems.
---
kdelibs-3.5.0-2.0.fc4.kde
kdebase-3.5.0-1.2.fc4.kde
qt-3.3.5-10.1.fc4.kde
kdegraphics-3.5.0-1.4.fc4.kde

$ svgdisplay --version
Qt: 3.3.5
KDE: 3.5.0-2.0.fc4.kde
KSVG test: 0.1
Comment 1 Øyvind Stegard 2005-12-17 08:17:13 UTC
Created attachment 13951 [details]
SVG file that crashes KSVG

From http://www.openclipart.org/
Comment 2 Øyvind Stegard 2005-12-17 08:18:00 UTC
Created attachment 13952 [details]
SVG file #2 that crashes KSVG

From http://www.openclipart.org/
Comment 3 patch_linams 2007-07-26 08:45:57 UTC
Created attachment 21249 [details]
SVGAnimatedPointsImpl.cc.patch.diff

Hi!

In the attachment you'll find a patch which fixes this crash.
Comment 4 esigra 2009-01-18 11:45:44 UTC
This is a confirmation that the bug still exists in KDE 3.5.10.
Comment 5 Christoph Feck 2011-09-19 12:38:16 UTC
This component has been replaced with the QtSvg based "svgpart" in KDE 4. If this issue still needs to be addressed, please add a comment.