Version: (using KDE KDE 3.1) Installed from: Compiled From Sources Compiler: gcc 2.95.3 Compiled with objprelink2 OS: Linux KMail crashed after I clicked the read new mail button. I read mail using fetchmail/procmail, so KMail reads it from local folders. When I try to restart KMail after the crash, it crashes every time before displaying its window, with the same crash dump. (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...[New Thread 1024 (LWP 1444)] (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...0x415da279 in wait4 () from /lib/libc.so.6 #0 0x415da279 in wait4 () from /lib/libc.so.6 #1 0x416482c8 in __DTOR_END__ () from /lib/libc.so.6 #2 0x4149c317 in waitpid () from /lib/libpthread.so.0 #3 0x40ba4f3a in KCrash::defaultCrashHandler () from /opt/kde3.1/lib/libkdecore.so.4 #4 0x41499e9d in pthread_sighandler () from /lib/libpthread.so.0 #5 <signal handler called> #6 0x4155dff1 in kill () from /lib/libc.so.6 #7 0x41499b02 in raise () from /lib/libpthread.so.0 #8 0x4155f3f1 in abort () from /lib/libc.so.6 #9 0x401fb368 in __default_terminate () from /opt/kde3.1/lib/libkhtml.so.4 #10 0x401fb38d in __terminate () from /opt/kde3.1/lib/libkhtml.so.4 #11 0x401fbe46 in __unwinding_cleanup () from /opt/kde3.1/lib/libkhtml.so.4 #12 0x401fc015 in __throw () from /opt/kde3.1/lib/libkhtml.so.4 #13 0x401fdb07 in __builtin_vec_new () from /opt/kde3.1/lib/libkhtml.so.4 #14 0x4115dcae in QString::setLength () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #15 0x41163788 in QString::operator+= () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #16 0x4042d200 in KRegExp3::replace () from /opt/kde3.1/lib/libkdenetwork.so.2 #17 0x814c04b in KDialog::marginHint () #18 0x815283f in KDialog::marginHint () #19 0x8146ae7 in KDialog::marginHint () #20 0x80d3117 in KDialog::marginHint () #21 0x813e648 in KDialog::marginHint () #22 0x813cb27 in KDialog::marginHint () #23 0x813c6bc in KDialog::marginHint () #24 0x813cdc3 in KDialog::marginHint () #25 0x8091782 in KDialog::marginHint () #26 0x808c93d in KDialog::marginHint () #27 0x40f5bc64 in QObject::activate_signal () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #28 0x40f5bb92 in QObject::activate_signal () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #29 0x40a103db in KAction::activated () from /opt/kde3.1/lib/libkdeui.so.4 #30 0x40a0b632 in KAction::slotActivated () from /opt/kde3.1/lib/libkdeui.so.4 #31 0x409587f2 in KAction::qt_invoke () from /opt/kde3.1/lib/libkdeui.so.4 #32 0x40a1110e in KActionMenu::qt_invoke () from /opt/kde3.1/lib/libkdeui.so.4 #33 0x40f5bd05 in QObject::activate_signal () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #34 0x40f5bb92 in QObject::activate_signal () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #35 0x411b7b4c in QButton::clicked () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #36 0x40fc1974 in QButton::mouseReleaseEvent () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #37 0x40f85bd6 in QWidget::event () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #38 0x40f10773 in QApplication::internalNotify () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #39 0x40f1021f in QApplication::notify () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #40 0x40b3c12f in KApplication::notify () from /opt/kde3.1/lib/libkdecore.so.4 #41 0x40ec890b in QETWidget::translateMouseEvent () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #42 0x40ec6b39 in QApplication::x11ProcessEvent () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #43 0x40ed678a in QEventLoop::processEvents () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #44 0x40f20bc0 in QEventLoop::enterLoop () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #45 0x40f20b07 in QEventLoop::exec () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #46 0x40f108e6 in QApplication::exec () from /usr/lib/qt3.1/lib/libqt-mt.so.3 #47 0x8191fcf in KDialog::marginHint () #48 0x4154dc5f in __libc_start_main () from /lib/libc.so.6
I now discover that the initial cause of the crash was a new filter which I had set up. It was set up as follows in kmailrc: [Filter #4] StopProcessingHere=true action-args-0=Subject\t^\t[Checkinstall]\s action-args-1=.Software.directory/Lists action-name-0=rewrite header action-name-1=transfer actions=2 apply-on=check-mail,manual-filtering contentsA=checkinstall-list@asic-linux.com.mx fieldA=<recipients> funcA=contains name=<<To or Cc>>:checkinstall-list@asic-linux.com.mx operator=and rules=1 I realise now that this is probably set up wrongly. But it shouldn't lead to a crash!
It now turns out that the fault is that the regular expression "^" used as the search expression in a filter doesn't work, although being a legitimate regular expression, it should. It seems probably to cause an infinite loop. Substituting "^(\S)" as the search expression fixes the fault. Not satisfactory!
David, kmail has since been ported to QRegExp, which is a bit more robus. Since you compiled from sources, can you try whether you still see this with current HEAD cvs, please?
Unfortunately I am currently working abroad for a few months and don't have access to a Linux system to check the HEAD version. I'll try when I return, probably in a couple of months.
I can still reproduce it (thanks to the detailed analysis). The trick is not to breath :) kmail falls into a recursion trying to replace the beginning with something new eating a lot of memory quickly.
Subject: kdepim/libkdenetwork CVS commit by coolo: avoid endless loop while trying to replace ^ (crossing fingers as I lack test cases I could break) CCMAIL: 54886-close@bugs.kde.org CCMAIL: mutz@kde.org A tests/test_kregexp.cpp 1.1 [no copyright] M +6 -0 kregexp3.cpp 1.12 M +5 -2 tests/Makefile.am 1.3 --- kdepim/libkdenetwork/kregexp3.cpp #1.11:1.12 @@ -161,4 +161,10 @@ QString KRegExp3::replace( const QString #endif } + if (matchedLength() == 0 && pos == 0) { + // if we matched the begin of the string, then better avoid endless + // recursion + result += str.mid( oldpos ); + break; + } pos += matchedLength(); #ifdef DEBUG_KREGEXP3 --- kdepim/libkdenetwork/tests/Makefile.am #1.2:1.3 @@ -1,5 +1,5 @@ #KDE_CXXFLAGS = #SUBDIRS = -INCLUDES = -I$(top_srcdir)/libkdenetwork $(all_includes) +AM_CPPFLAGS = -I$(top_srcdir)/libkdenetwork $(all_includes) LDADD = ../libkdenetwork.la @@ -11,5 +11,6 @@ test_kmime_codec \ testutf7decoder \ - testutf7encoder + testutf7encoder \ + test_kregexp test_kmime_codec_SOURCES = test_kmime_codec.cpp @@ -20,2 +21,4 @@ testutf7encoder_SOURCES = testutf7encoder2.cpp testutf7decoder_SOURCES = testutf7decoder.cpp +test_kregexp_SOURCES = test_kregexp.cpp +
I've finally been able to try out the CVS version of KMail. It works fine now - thanks.