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.
*** Bug 2971 has been marked as a duplicate of this bug. ***
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.
For this particular reproducer, taking out the call to session_destroy() from imap_disconnect_all() in imap.c makes the problem unreproducible.
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)
Hi, The fix for bug #3145 may help. Can you test?
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.
Nice :) Keep me informed!
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.