[Bug 174112] Kmail crashes on attaching a document to a message

George Kiagiadakis gkiagiad at csd.uoc.gr
Sat Nov 8 00:30:41 CET 2008


http://bugs.kde.org/show_bug.cgi?id=174112


George Kiagiadakis gkiagiad csd uoc gr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gkiagiad at csd.uoc.gr
         AssignedTo|bugsquad-triage at kde.org     |kdelibs-bugs at kde.org
             Status|UNCONFIRMED                 |NEW
          Component|general                     |kdecore
     Ever Confirmed|0                           |1
           Keywords|                            |triaged
            Product|kmail                       |kdelibs
            Version|1.10.1                      |4.1




--- Comment #4 from George Kiagiadakis <gkiagiad csd uoc gr>  2008-11-08 00:30:40 ---
Interesting backtrace.... I can't reproduce it, but it's reasonable, as this is
a configuration-dependent feature that crashes.

The problem probably is in kdelibs (kdecore, kdebug.cpp). In this case, kdebug
is configured to write its output to a file instead of stdout, so the
KFileDebugStream is connected to the QDebug object that is returned by kDebug()
and friends. KFileDebugStream expects to get a filename from somewhere and this
is passed to it in the string that it writes (the filename is prepended with a
\0 character to the debug message). That is defined in kdebug.cpp line 375:
    QDebug setupFileWriter(const QString &fileName)
    {
        QDebug result(&filewriter);
        result.nospace() << qPrintable(fileName) << '\0';
        return result;
    }

When KFileDebugStream::writeData() is called, it gets the filename from the
string and writes the rest of the string to that file. However, in this case we
have this warning in kmmsgpart.cpp line 151:
    kWarning(5006)
      << "KMMessagePart::setCharset(): trying to set a charset for a
non-textual mimetype." << endl
      << "Fix this caller:" << endl
      << "===================================================================="
<< endl
      << kBacktrace( 5 ) << endl
      <<
"====================================================================";

The problem with this is that it puts "endl" many times in the stream and endl
by default causes a flush, which in turn calls KFileDebugStream::writeData()
many times, but the filename is only prepended once, in the first string only!
That makes it unable to get the filename the second time and thus cause
assertion failure.

PS: quick solution: disable logging kdebug to a file! (don't ask me how, I
don't know :P)

PS2: That is also a kmail bug, because this warning message should *not* be
shown ;)


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Kdelibs-bugs mailing list