After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769010 - Geary crashes when archiving, deleting, selecting a different message
Geary crashes when archiving, deleting, selecting a different message
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: engine
0.11.x
Other Linux
: High major
: 0.11.2
Assigned To: Michael Gratton
Geary Maintainers
: 750048 751656 779373 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-07-20 20:35 UTC by Peter Buck
Modified: 2017-03-05 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debugging session including stack trace of geary crash (11.82 KB, text/plain)
2016-07-21 17:15 UTC, Peter Buck
Details
Example message that reliably triggers this bug. (25.34 KB, text/plain)
2016-08-02 01:29 UTC, Michael Gratton
Details
Decoded HTML from message in Bug 750048 that reportedly also causes the crash (47.85 KB, text/plain)
2016-08-02 01:31 UTC, Michael Gratton
Details
Decoded HTML from example that reliably triggers the bug (15.53 KB, text/plain)
2016-08-02 01:35 UTC, Michael Gratton
Details
Decoded HTML from message in Bug 750048 that reportedly also causes the crash (47.46 KB, text/plain)
2016-08-02 01:41 UTC, Michael Gratton
Details

Description Peter Buck 2016-07-20 20:35:05 UTC
Starting 7/20/2016, Geary crashes when attempting to delete message from IMAP inbox.  I'll be happy to supply whatever debugging aids if you tell me how to do so. Contact me at pbuck at his.com
Comment 1 Peter Buck 2016-07-20 21:39:52 UTC
To clarify, problems occur with only about 5-10% of the messages, but at least some messages cause Geary to crash every time I try to delete them. I can delete those messages in an online email client.
Comment 2 Michael Gratton 2016-07-21 00:38:00 UTC
Hi Peter, thanks for reporting this bug.

To debug this, I'll need you to obtain and attach a stack trace per the instructions here: https://wiki.gnome.org/Apps/Geary/ReportingABug#Stack_Trace 

I'll also some information about your system: Distro and version, desktop environment and version, GTK and WebKitGTK library versions.
Comment 3 Peter Buck 2016-07-21 17:15:53 UTC
Created attachment 331897 [details]
Debugging session including stack trace of geary crash

Thanks, Michael.  Attached is the stack trace from trying to delete one of the messages that cause the crash.

I'm running ubuntu 16.04, pretty vanilla.  I don't know how to gather the version information you requested.  Please advise me if you need more details than I've provided.
Comment 4 Luca MonsterLord 2016-07-28 12:34:58 UTC
I've got the same problem of Peter. Since the previous version of geary every time I try to delete messages from the inbox section, the program stucks and then crashes. If I delte only a message and then i navigate through my other email account everything goes right but if I try to delete 2 or 3 messages in a row it crashes... 
I use geary on elementary os 0.3  
Any suggestion??? please notify by email your suggestion (monsterlord@live.it)
Comment 5 Michael Gratton 2016-07-28 23:46:43 UTC
Peter, thanks for the stack trace. From that, since the crash is occurring in WebKitGTK, it might be the same issue as Bug 750048. I occasionally see something  like this as well, and am pretty sure it is indeed a WebKitGTK bug.

If so, you can work around it by selecting a different message that you also want to delete first, then selecting this problematic message, and then deleting them both.
Comment 6 Michael Gratton 2016-07-28 23:48:14 UTC
Luca, thanks for the extra information. Does the workaround I just above in comment 5 help?
Comment 7 Michael Gratton 2016-08-02 01:17:01 UTC
*** Bug 750048 has been marked as a duplicate of this bug. ***
Comment 8 Michael Gratton 2016-08-02 01:28:31 UTC
The crash is a bug in WebKitGTK. It is triggered in ConversationViewer, by both conversation_viewer_clear and conversation_viewer_remove_message. It occurs when the message's root DOM node is removed from the web view, and seems to depend on something specific to the messages involved.

After trying a few obvious workarounds (setting the parent node's inner_html to "", moving the node to a different parent instead of removing it) it is still crashing. Some investigation into the specific nature of the messages that are causing the crash is probably needed to work out what the actual issue is. I'll attach a few here in case someone wants to try to work out what they have in common.

If nothing else, this will be fixed when Bug 765516 lands for 0.12, but a fix for this would be great to have for 0.11.x as well.
Comment 9 Michael Gratton 2016-08-02 01:29:29 UTC
Created attachment 332498 [details]
Example message that reliably triggers this bug.
Comment 10 Michael Gratton 2016-08-02 01:31:16 UTC
Created attachment 332499 [details]
Decoded HTML from message in Bug 750048 that reportedly also causes the crash
Comment 11 Michael Gratton 2016-08-02 01:35:52 UTC
Created attachment 332500 [details]
Decoded HTML from example that reliably triggers the bug

Decode the Q-P encoding for clarity.
Comment 12 Michael Gratton 2016-08-02 01:41:17 UTC
Created attachment 332501 [details]
Decoded HTML from message in Bug 750048 that reportedly also causes the crash

Clean up line endings for clarity
Comment 13 Michael Gratton 2016-08-02 04:47:02 UTC
*** Bug 751656 has been marked as a duplicate of this bug. ***
Comment 14 Michael Gratton 2016-08-02 04:55:41 UTC
The stack trace from Bug 751656 indicates one instance of the crash is occurring in WebCore::RenderTableCell::borderLeft(), which is called from WebCore::RenderBoxModelObject::localCaretRectForEmptyElement() so it may have something to do with borders on table cells, and/or maybe on empty table cells?
Comment 15 Michael Gratton 2016-08-09 11:45:18 UTC
Turns out WebKitGTK+ 2.4.x at least will crash if you remove an element that has nested tables, and the nested table has cells with some border set. Removing the cell's contents in reverse order will prevent the crash from occurring.

A workaround has been pushed to master as 36a35f9. It fixes the crash for the message that was causing the crash for me. If anyone can also test it out, please let me know if it also fixes the problem for you.

I'll cherry pick this for the geary-0.11 branch a bit later once it hasn't shown to cause any performance regressions.
Comment 16 Michael Gratton 2016-08-16 15:29:27 UTC
This has been pushed to the stable geary-0.11 branch as 52fe9b6. Resolving as fixed.
Comment 17 Michael Gratton 2017-03-05 14:51:35 UTC
*** Bug 779373 has been marked as a duplicate of this bug. ***