Version: (using KDE KDE 3.1.94) Installed from: Compiled From Sources Compiler: GCC 3.2.1 OS: Solaris Kate or its part embedded in anything else (Konqueror when previewing a text file, Kwrite, etc.) crashes when attempting to print a plain text file. The last part of the debug output, and the backtrace, is: kdeprint: kdeprint: status message: Generating print data: page 1 QFont::fromString: invalid description ' Program received signal SIGSEGV, Segmentation fault. 0xfd833474 in strlen () from /usr/lib/libc.so.1 (gdb) where #0 0xfd833474 in strlen () from /usr/lib/libc.so.1 #1 0xfd885798 in _doprnt () from /usr/lib/libc.so.1 #2 0xfd887550 in vfprintf () from /usr/lib/libc.so.1 #3 0xfe211138 in qWarning(char const*, ...) (msg=0xfd8bc000 "") at tools/qglobal.cpp:505 (gdb) (This is QT 3.2.3). The crash appears to be in one of the two QFont::fromString() calls in kdelibs/kate/part/kateprinter.cpp. It is being called with a null string because the option key "app-kate-hffont" is not defined - why that is undefined is another problem, but Kate should be defensive. Qt tries to print some debug output in this case, but appears to use a null pointer and crashes. (This only happens on Solaris - 58011 is probably the same happening on Linux, but there is no crash in this case). So it is really a Qt bug, but again Kate should be defensive and not make bad calls to fromString(). This may be a duplicate also of 54165, which was resolved WORKSFORME. The attached patch checks that the printer option (font name) is not null before calling the QFont routine. With this applied, there is no crash and Kate prints successfully.
Created attachment 4192 [details] Guard against Qt font setting crash (in 2 places)
Same on Gentoo linux. qt 3.1 works fine. I couldn't find the other bugreports referred to, so I add my comments to this one. I attach the output of strace.
Created attachment 4199 [details] output of strace when printing from kwrite
does the patch work for you too ? I have applied it to head btw., it won't do any harm even on fixed qt versions
somebody still gets this probs after the fix ? if yes, not much time to fix and backport until kde 3.2 release, therefor please test ;)
Not sure who is being asked if the patch works, but there are no problems for me after applying the fix. Many thanks for applying the fix so quickly, especially at this critical time for the 3.2 release!
will close it, if it comes again up we will take care again ;)