From kde-core-devel Mon Apr 09 20:24:35 2001 From: Wynn Wilkes Date: Mon, 09 Apr 2001 20:24:35 +0000 To: kde-core-devel Subject: Re: Strange crash in kmimemagic.h X-MARC-Message: https://marc.info/?l=kde-core-devel&m=98684804530767 On Friday 06 April 2001 05:55 pm, David Faure wrote: > On Saturday 07 April 2001 00:44, Wynn Wilkes wrote: > > Hello, > > > > I've been using the HEAD Branch of kde, and the KDEVELOP_1_4 branch of > > kdevelop. This week a strange crash started happening whenever I > > attempted to open a file or new project. The pertinent part of the > > backtrace looks like: > > #2 0x40a2e110 in KCrash::defaultCrashHandler (signal=11) at > > kcrash.cpp:194 #3 > > #4 0x40cc483d in QString::QString () from /usr/lib/qt2/lib/libqt.so.2 > > #5 0x400c0a30 in KMimeMagicResult::mimeType (this=0x83426a0) > > at /opt/kde-cvs/include/kmimemagic.h:52 > > Huh, I did quite some changes to KMimeMagic recently.... > > > #6 0x4064cbf8 in KMimeType::findByURL (_url=@0x8342274, _mode=32768, > > _is_local_file=true, _fast_mode=false) at kmimetype.cpp:245 > > Can you print out the URL it's looking at ? > If you open Konqueror on that directory, does it crash looking at the same > file ? > > > There were a couple of other situations where > > KMimeMagicResult::mimeType() also crashed. In trying to debug it, it > > looked like the m_strMimeType ( a QString ) in the KMimeMagicResult class > > was being corrupted, leading to the segfault. This happens in the static > > void refineResult method in kmimemagic.cpp:1958 right after line 1961. I > > can't see where this is happening. > > Any interesting debug output if you s,//kdDebug,kdDebug, in kmimemagic.cpp > ? (it's what I do to debug kmimemagic - we don't want the calls to remain > there because this code is quite performance-critical). > > I doubt KFile is to blame here - it's KMimeType that calls KMimeMagic, so > there are too many layers in between. And I know I changed KMimeMagic > quite much recently :} Can't see what caused this though. I rebuilt everything this morning after updating and that crash is gone. I don't understand why it was crashing- I stepped through everything in gdb and all the code looked good, but it always crashed when trying to create a QString- somehow the memory for the m_strMimeType was getting corrupted. I'll look into it more if it ever comes back...I must have had something weird happening in my setup. Wynn