Bug 306065

Summary: kmail crashed while searching for an e-mail, then it crashes at every startup
Product: [Applications] kmail2 Reporter: carlo.tognetti
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: cfeck, montel
Priority: NOR    
Version: 4.8.4   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description carlo.tognetti 2012-08-31 09:31:44 UTC
Application: kmail (4.8.4)
KDE Platform Version: 4.8.4 (4.8.4)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-30-generic x86_64
Distribution: Ubuntu 12.04.1 LTS

-- Information about the crash:
- What I was doing when the application crashed:
Firs crash when I was searching for an e-mail with the internal search engine.
Then kmail crashes at every startup. Other Kontact applications (korganizer, knotes, kaddressbook) start fine 

- Unusual behavior I noticed:
Nothing

- Custom settings of the application:
-- Changed the default kde font, and the composer font, (from the debug info it seems the problem is somehow related to the fonts) but I did this many kmail startup ago.
-- Added 2 po3 accounts.
-- Added 1 freepops (http://http://www.freepops.org) account
This way it's been working fine foe a lot of times
During last execution:
-- Changed the composer font for the last sent mail
-- Added 1 more freepops (http://http://www.freepops.org) local accounts to retrieve mail from the same webmail account, but from a different folder
-- Added, in Kontact, sync to Gcal, Google accounts (sync with Android accounts) but the problem remains after disabilng the auto-retrieve feature for each e-mail account
-- Changed the kde default web browser from Rekonq to Firefox
-- Maybe I forced italian spellcheck

- I created a new account on my PC and there kmail starts fine.
- It crashes at startup even if I rename ~/.local/share/local-mail

The crash can be reproduced every time.

-- Backtrace:
Application: KMail (kmail), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f32dcd707c0 (LWP 7941))]

Thread 2 (Thread 0x7f32ba127700 (LWP 7945)):
#0  0x00007f32da0b5b03 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f32d2961036 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f32d2961164 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f32daa4c426 in QEventDispatcherGlib::processEvents (this=0x7f32b40008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f32daa1bc82 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f32daa1bed7 in QEventLoop::exec (this=0x7f32ba126d90, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f32da91afa7 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f32da9fb9ff in QInotifyFileSystemWatcherEngine::run (this=0x129ce60) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f32da91dfcb in QThreadPrivate::start (arg=0x129ce60) at thread/qthread_unix.cpp:298
#9  0x00007f32d7b90e9a in start_thread (arg=0x7f32ba127700) at pthread_create.c:308
#10 0x00007f32da0c14bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f32dcd707c0 (LWP 7941)):
[KCrash Handler]
#6  0x00007f32da005445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#7  0x00007f32da008bab in __GI_abort () at abort.c:91
#8  0x00007f32da042e2e in __libc_message (do_abort=2, fmt=0x7f32da14b0d0 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:201
#9  0x00007f32da04d626 in malloc_printerr (action=3, str=0x7f32da14b230 "double free or corruption (out)", ptr=<optimized out>) at malloc.c:5007
#10 0x00007f32d2e2fede in FcConfigSubstituteWithPat () from /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
#11 0x00007f32db18512f in getFcPattern (request=..., script=0, fp=0x179b9b0) at text/qfontdatabase_x11.cpp:1574
#12 loadFc (request=..., script=0, fp=0x179b9b0) at text/qfontdatabase_x11.cpp:1705
#13 QFontDatabase::load (d=0x179b9b0, script=0) at text/qfontdatabase_x11.cpp:1977
#14 0x00007f32db162587 in QFontPrivate::engineForScript (this=0x179b9b0, script=0) at text/qfont.cpp:305
#15 0x00007f32db198f89 in QTextEngine::fontEngine (this=0x17db5c0, si=..., ascent=0x17d8ecc, descent=0x17d8ec8, leading=0x17d8ed0) at text/qtextengine.cpp:1901
#16 0x00007f32db19a449 in QTextEngine::shapeTextWithHarfbuzz (this=0x17db5c0, item=0) at text/qtextengine.cpp:1195
#17 0x00007f32db19b5eb in QTextEngine::shapeText (this=0x17db5c0, item=0) at text/qtextengine.cpp:935
#18 0x00007f32db19b93e in QTextEngine::shape (this=0x17db5c0, item=0) at text/qtextengine.cpp:1450
#19 0x00007f32db1ab435 in QTextLine::layout_helper (this=0x7fffa6c47190, maxGlyphs=<optimized out>) at text/qtextlayout.cpp:1752
#20 0x00007f32db1e482a in QTextDocumentLayoutPrivate::layoutBlock (this=0x1465880, bl=..., blockPosition=2679, blockFormat=..., layoutStruct=0x7fffa6c47a50, layoutFrom=1082, layoutTo=1082, previousBlockFormat=0x0) at text/qtextdocumentlayout.cpp:2614
#21 0x00007f32db1eda9d in QTextDocumentLayoutPrivate::layoutFlow (this=0x1465880, it=..., layoutStruct=0x7fffa6c47a50, layoutFrom=1082, layoutTo=1082, width=...) at text/qtextdocumentlayout.cpp:2402
#22 0x00007f32db1e83a4 in QTextDocumentLayoutPrivate::layoutCell (this=0x1465880, t=0x17b6cd0, cell=..., width=..., layoutFrom=1082, layoutTo=1082, td=0x176df60, absoluteTableY=..., withPageBreaks=false) at text/qtextdocumentlayout.cpp:1532
#23 0x00007f32db1e8cd4 in QTextDocumentLayoutPrivate::layoutTable (this=0x1465880, table=0x17b6cd0, layoutFrom=1082, layoutTo=1082, parentY=...) at text/qtextdocumentlayout.cpp:1642
#24 0x00007f32db1eaf5f in QTextDocumentLayoutPrivate::layoutFrame (this=0x1465880, f=0x17b6cd0, layoutFrom=1082, layoutTo=1082, frameWidth=..., frameHeight=..., parentY=...) at text/qtextdocumentlayout.cpp:2107
#25 0x00007f32db1eb73d in QTextDocumentLayoutPrivate::layoutFrame (this=0x1465880, f=0x17b6cd0, layoutFrom=1082, layoutTo=1082, parentY=...) at text/qtextdocumentlayout.cpp:2049
#26 0x00007f32db1edf30 in QTextDocumentLayoutPrivate::layoutFlow (this=0x1465880, it=..., layoutStruct=0x7fffa6c489c0, layoutFrom=1082, layoutTo=1082, width=...) at text/qtextdocumentlayout.cpp:2311
#27 0x00007f32db1eb20e in QTextDocumentLayoutPrivate::layoutFrame (this=0x1465880, f=0x1465e30, layoutFrom=1082, layoutTo=1082, frameWidth=..., frameHeight=..., parentY=...) at text/qtextdocumentlayout.cpp:2143
#28 0x00007f32db1eb73d in QTextDocumentLayoutPrivate::layoutFrame (this=0x1465880, f=0x1465e30, layoutFrom=1082, layoutTo=1082, parentY=...) at text/qtextdocumentlayout.cpp:2049
#29 0x00007f32db1eb9d8 in QTextDocumentLayout::doLayout (this=0x1465860, from=1082, oldLength=<optimized out>, length=0) at text/qtextdocumentlayout.cpp:2939
#30 0x00007f32db1ec834 in QTextDocumentLayout::documentChanged (this=0x1465860, from=1082, oldLength=1, length=0) at text/qtextdocumentlayout.cpp:2902
#31 0x00007f32db1cd1f8 in QTextDocumentPrivate::finishEdit (this=0x146a8d0) at text/qtextdocument_p.cpp:1220
#32 0x00007f32db1f4c6b in removeSelectedText (this=0x7fffa6c48f00) at text/qtextcursor.cpp:1654
#33 QTextCursor::removeSelectedText (this=0x7fffa6c48f00) at text/qtextcursor.cpp:1647
#34 0x00007f32d3c33e5a in KPIMTextEdit::TextEdit::loadImage (this=0x1465690, image=..., matchName=..., resourceName=...) at ../../kpimtextedit/textedit.cpp:422
#35 0x00007f32d648ab4d in Message::ComposerViewBase::collectImages (this=0x1237910, root=<optimized out>) at ../../messagecomposer/composerviewbase.cpp:1308
#36 0x00007f32d64927df in Message::ComposerViewBase::setMessage (this=0x1237910, msg=...) at ../../messagecomposer/composerviewbase.cpp:182
#37 0x00007f32dbba3915 in KMComposeWin::setMsg (this=0x123b740, newMsg=..., mayAutoSign=false, allowDecryption=<optimized out>, isModified=false) at ../../kmail/kmcomposewin.cpp:1481
#38 0x00007f32dbb28cf0 in KMKernel::recoverDeadLetters (this=<optimized out>) at ../../kmail/kmkernel.cpp:1109
#39 0x0000000000402ba6 in main (argc=<optimized out>, argv=<optimized out>) at ../../kmail/main.cpp:135

This bug may be a duplicate of or related to bug 280630.

Possible duplicates by query: bug 305122, bug 304488, bug 303621, bug 302750, bug 302621.

Reported using DrKonqi
Comment 1 carlo.tognetti 2012-08-31 15:53:51 UTC
Kmail is up again. To have it start again as my user I had to:

- remove the content of (thanks to allemensen on https://bbs.archlinux.org/viewtopic.php?id=134571)
    /home/[my user]/.kde/share/apps/kmail2/
- move back to it's original path the folder local-mail (/home/[my user]/.local/share/local-mail)

At this point kmail started fine but had problems with akonadi so I restarted akonadi
- sudo akonadictl restart

and everything now is running fine.
I'm keeping a copy of the two files originally in /home/[my user]/.kde/share/apps/kmail2/autosave that were probably  cased the problem.
To me the bug still exixts, even if I've solved the problem
Comment 2 Laurent Montel 2012-08-31 16:11:22 UTC
IF you can send me your /.kde/share/apps/kmail2/autosave/* file perhaps I can look at it.

Or perhaps it's still bug with identity.
Comment 3 carlo.tognetti 2012-09-03 14:42:24 UTC
Laurent

  I can provide you the files, but they contain some kind of confidential data. 
So I can attach them to an e-mail if I'm sure that they'll not be published 
and that they will be used as reserved information.

I need to be sure that just you will be able to read the data, and will 
destroy them ASAP. Can you confirm?

Sorry, but I have to ask you all these boring confirmations because of both my 
country lows and our certification.

Differently I could " anonymize " the files by changing some relevant strings, 
but I think that you could better debug if you are sure that the files are 
exactly those that created the problem. 

Carlo
Comment 4 Laurent Montel 2012-09-03 15:17:52 UTC
Of course.
Yes I will not publish them.
And destroy them after reproduce crash.

Regards
Comment 5 Christoph Feck 2012-09-03 15:30:09 UTC
Just don't attach them to this bug, but mail Laurent directly. Otherwise the data is permanent (attachments cannot be deleted).
Comment 6 carlo.tognetti 2012-09-04 08:04:54 UTC
Sent the content of the autosave directory directly to Laurent.
Comment 7 Denis Kurz 2016-09-24 18:22:39 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 8 Denis Kurz 2017-01-07 22:13:51 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.