Bug 2769 - crash when activating offline mode during IMAP remote activity
Summary: crash when activating offline mode during IMAP remote activity
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: Folders/IMAP (show other bugs)
Version: 3.9.3
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
: 2971 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-02 12:58 UTC by Michael Schwendt
Modified: 2014-04-23 11:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schwendt 2012-11-02 12:58:06 UTC
It's likely that activating "offline" mode, while something in Claws Mail is using IMAP, leads to a crash. Alternatively, it can happen also with sporadic network interruptions during long IMAP access.

How to reproduce
-----
1. Access Google Mail via IMAP.
2. During IMAP activity, such as loading a folder, go offline within Claws Mail.
3. Crash.

It's nearly 100% reproducible and crashes in varying locations such as memory management.
Comment 1 Paul 2013-07-14 10:54:23 UTC
*** Bug 2971 has been marked as a duplicate of this bug. ***
Comment 2 Michael Schwendt 2014-02-07 15:35:40 UTC
Reproducible with Claws Mail 3.9.3 (x86_64 Fedora 20) and caused malloc to crash again:

  $ claws-mail 
  (claws-mail:9041): Claws-Mail-CRITICAL **: imap_scan_required: assertion 'session != NULL' failed

  (claws-mail:9041): Claws-Mail-WARNING **: can't get message file path.

  Segmentation fault (core dumped)

When running via valgrind, it seems the slow-down is too high, and instead of a segfault there are only warnings on the terminal:

** (claws-mail:8837): WARNING **: [15:30:03] IMAP error on imap.googlemail.com: bad state
** (claws-mail:8837): WARNING **: [15:30:03] IMAP4 connection broken
** (claws-mail:8837): WARNING **: [15:30:03] can't select folder: [Google Mail]/All Mail
(claws-mail:8837): Claws-Mail-WARNING **: can't get message file path.
Comment 3 Michael Schwendt 2014-02-10 23:53:34 UTC
For this particular reproducer, taking out the call to session_destroy() from
imap_disconnect_all() in imap.c makes the problem unreproducible.
Comment 4 Michael Schwendt 2014-02-14 22:54:42 UTC
Something uses freed memory structures. This is output _after_ session_destroy() in imap_disconnect_all():

** (claws-mail:28962): WARNING **: [22:13:50] IMAP error on \x9b\x9d\x9e\xff\x9b\x9d\x9e\xff\xa1\u0011: bad state


** (claws-mail:28962): WARNING **: [22:13:50] IMAP4 connection broken

Segmentation fault (core dumped)
Comment 5 Colin Leroy 2014-04-21 14:35:36 UTC
Hi,
The fix for bug #3145 may help.  Can you test?
Comment 6 Michael Schwendt 2014-04-21 17:57:34 UTC
Looks promising so far. :)

Instead of a crash I only get the following messages on terminal:

(claws-mail:27971): Claws-Mail-CRITICAL **: imap_scan_required: assertion 'session != NULL' failed

** (claws-mail:27971): WARNING **: [17:52:18] IMAP error on imap.googlemail.com: stream error


** (claws-mail:27971): WARNING **: [17:52:18] IMAP4 connection broken


(claws-mail:27971): Claws-Mail-WARNING **: can't get message file path.
Comment 7 Colin Leroy 2014-04-21 23:11:33 UTC
Nice :)

Keep me informed!
Comment 8 Michael Schwendt 2014-04-23 11:52:27 UTC
I consider this fixed since I've been unable to reproduce what has been fairly easy to reproduce with 3.9.3 and older. It's likely that the imap_safe_destroy commit for bug 3145 fixed it.