Bug 118498

Summary: KSVG/svgdisplay consumes 100% CPU and quickly eats up all available memory on certain SVG files
Product: ksvg2 Reporter: Øyvind Stegard <oyvinst>
Component: generalAssignee: Nikolas Zimmermann <wildfox>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: cfeck, esigra
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: SVG file that crashes KSVG
SVG file #2 that crashes KSVG
SVGAnimatedPointsImpl.cc.patch.diff

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.