Version: kdebase-runtime-4.2.4, qt-4.5.1 (using KDE 4.2.4) Compiler: gcc version 4.4.0 (Gentoo 4.4.0 p1.0) OS: Linux Installed from: Compiled From Sources martin@jama ~/ksvgtopng-test $ wget https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit/navit/xpm/bank.svg martin@jama ~/ksvgtopng-test $ ksvgtopng 20 20 bank.svg bank.png Segmentation fault with debug enabled it says: ASSERT failure in QFontDatabase: "A QApplication object needs to be constructed before FontConfig is used.", file text/qfontdatabase_x11.cpp, line 994 Confirmed on 2 computers (both amd64), one with qt-4.5.1, kde-4.2.4 and second with recent qt-copy snapshot and kde-4.2.91. It looks like qt bug, I'll try to create smaller test-case without ksvgtopng to report it to qt-devs.
Created attachment 34549 [details] ksvgtopng.initQApplication.patch Initialize Qt application, otherwise for some svg files it can segfault with: ASSERT failure in QFontDatabase: "A QApplication object needs to be constructed before FontConfig is used."
SVN commit 982740 by cfeck: Use QApplication (for SVG files with text) Patch by Martin Jansa, thanks! BUG: 196634 M +6 -0 ksvgtopng.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=982740
(In reply to comment #2) > SVN commit 982740 by cfeck: > > Use QApplication (for SVG files with text) > > Patch by Martin Jansa, thanks! > BUG: 196634 > > > M +6 -0 ksvgtopng.cpp > > > WebSVN link: http://websvn.kde.org/?view=rev&revision=982740 It has unwanted side effect, that it needs X11 connection, so batch converting of png files, like when compiling referenced navit suffers from this change, when run from commandline without X11 :(. SRCDIR=. ./navit_svg2png "/usr/bin/ksvgtopng" "gui_inactive.png" ksvgtopng: cannot connect to X server Strange that this bug appears only on certain SVG files with text. https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit/navit/xpm/cursor_still.svg worked ok, even before my change and has text with some font too. What's even stranger, is that when I replaced whole <text> element in bank.svg with <text> element from cursor_still.svg than resulting svg segfaults again :(. Maybe there is still some hidden bug in qt code after all...
(In reply to comment #3) https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit/navit/xpm/cursor_still.svg > worked ok, even before my change and has text with some font too. What's even > stranger, is that when I replaced whole <text> element in bank.svg with <text> > element from cursor_still.svg than resulting svg segfaults again :(. Ah my fault to notice.. cursor_still.svg has <text> but in layer with style="display:none", so it wasn't rendered at all. It would be nice to have qt function like bool QSvgRenderer::animated () const for check if svg has <text> elements and only then init QApplication.