bugGNUstep Non-FSF - Bugs: bug #54364, [GNUMail] Crash due to quick IMAP...

 
 

bug #54364: [GNUMail] Crash due to quick IMAP folder switching

Submitter:  None
Submitted:  Tue 24 Jul 2018 07:29:25 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 27 Oct 2022 07:55:39 AM UTC, comment #7: 

Good to know guys! I commited some cleanups on Tasks to be explicit about ivars. It should help detect errors in that direction in the future.

Riccardo Mottola <rmottola>
Group administrator
Thu 27 Oct 2022 02:54:37 AM UTC, comment #6: 

I tried the SVN and it works great, even on OpenBSD! I was having crashes daily and even had a giant 4GB imap_cache and now both of those issues are gone. Thanks again!

Xylemon <xylemon>
Wed 19 Oct 2022 12:52:42 AM UTC, comment #5: 

Having specific stores for CWStore objects here and there is a manifestation of a design flaw in GNUMail.

It is natural for a mail application to maintain a list of accounts during whole running session. So it is not a memory leak to allow CWStore objects (virtually accounts) to be retained. The only thing to follow in this case is having only one class instance maintaining/owning the list of CWStore objects.

I'm fine with TaskManager being the only owner of CWStore objects though GNUMail.h/m is another possible choice (which i have made in my experiments).

I have tested the current GNUmail. The issue is gone. OK.

Sergei Golovin <svg>
Fri 14 Oct 2022 05:24:53 PM UTC, comment #4: 

I refuse the patch. I analyzed and it would lead to memory leaks.
Generally Store objects are not explicitly memory managed, autoreleasing them is dirty, but should work, except perhaps if the events are sent that both cause it.

I made the TaskManager (which is a single instance) have a specitfc store of CWStore objects, so that explicit memory references are done to it and objects cannot be release twice. Seems to work fro me, but please test.

Riccardo Mottola <rmottola>
Group administrator
Tue 27 Sep 2022 11:30:07 AM UTC, comment #3: 

I agree, the object is only sent through the notification, so it is incorrect to release it.

I will  test this eagerly, I was investigating an issue that might be related, where a simple operation would "die" because of timeout or network sisue and the whole store was invalid. Hard to reproduce, but hunts me since ever.

I wonder however if we are sure not to leak it and/or there is no further cleanup action needed. E.g. send the corresponding Store object an appropriate message, like termination, close cleanup, e.g. [CWStore close]. Maybe it is not appropriate in all cases though.

Riccardo Mottola <rmottola>
Group administrator
Sat 27 Aug 2022 07:27:27 PM UTC, comment #2: 

Thank you so much for the fix Sergei.
Let is be known that this bug has been annoying us users for a long time :)
My colleague wouldn't shut up about it this week.
I hope that this gets seen and merged.

Marco Cawthorne <eukara>
Sun 21 Aug 2022 07:59:15 AM UTC, comment #1: 

Many TaskManager' methods autorelease notification objects (services) that TaskManager doesn't own.
The crash while quick IMAP folder switching happens for the line


AUTORELEASE(o)


at the end of the -[TaskManager requestCancelled:] which creates unbalanced retain/release conditions leading to deallocation of a service (CWIMAPStore) during a timer invalidation.


(file #53592)

Sergei Golovin <svg>
Tue 24 Jul 2018 07:29:25 AM UTC, original submission:  

If I switch IMAP folders too quickly, say before the message list has finished loading, while the activity animation is still running and "Opening mailbox ..." showing, GNUMail keeps trying to load the previously selected folder and shows nothing on the newly chosen folder.

It then seems to hang. Console window shows "Connection lost to server [...]". If I then click it again, a mailbox error occurs: "You must select a valid mailbox to open!".

If I click it again, GNUMail crashes. But if I instead take the account offline, cancel the action "Opening mailbox ..." in Console window and then take the account online again, GNUMail continues to work fine.

GNUMail 1.30 (precompiled) on Mac OS X 10.9. Using mbox format; IMAP with TLS; 800, 1200 and 2300 messages in some of the folders.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by xylemon (Posted a comment)
  • -email is unavailable- added by rmottola (Posted a comment)
  • -email is unavailable- added by eukara (Posted a comment)
  • -email is unavailable- added by svg (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-10-14 rmottola StatusNone Fixed
        Open/ClosedOpen Closed
    2022-08-21 svg Attached File- Added bug_54364_TaskManager_wrong_autoreleasing.diff, #53592

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code