close
Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Opened 14 months ago

Closed 14 months ago

Last modified 10 months ago

#420 closed bug (fixed)

ClearFolderMails : DSI after a "After download" event

Reported by: AmigaPhil Owned by: tboeckel
Priority: undecided Milestone: YAM 2.9
Component: undefined Version: 2.8p1
Severity: major Keywords:
Cc: OS Platform:
Blocked By: Blocking:
Release Notes:

mail disposal is now protected by a reference counter. This makes it possible to move a mail to a different folder in concurrent processes while still accessing the same mail without accessing invalid or already freed memory. This fixes numerous different potential crash problems.

Description

Summary

This one is hard to detail as it does not happen all the time.
This started after I created a "After download" ARexx event. Sometimes, just after the ARexx script (SpamFryer.yam) has finished, the GrimReaper appears.
Last time, Yam was downloading about 12 messages, SpamFryer.yam moved 2 messages to the trash folder, and while returning to Yam -> GR.

Steps to reproduce

No reproducable at will.

Expected results

Actual results

Regression

Notes

Attachments (6)

Crashlog_YAM_2013-09-10_17-25-34.txt (29.0 KB) - added by AmigaPhil 14 months ago.
Crashlog_YAM_2013-09-10_19-26-46.txt (29.4 KB) - added by AmigaPhil 14 months ago.
debug.log (115.6 KB) - added by AmigaPhil 14 months ago.
folder debug log
debug.2.log (128.7 KB) - added by AmigaPhil 14 months ago.
debug output - nightly build 13-09-2013
debug.3.log (115.7 KB) - added by AmigaPhil 14 months ago.
Debug log, with FOLDER flag
crashtest.yam (946 bytes) - added by AmigaPhil 14 months ago.
ARexx test case

Download all attachments as: .zip

Change History (19)

Changed 14 months ago by AmigaPhil

comment:1 Changed 14 months ago by AmigaPhil

Here is another crashlog that just happened.
2 messages downloaded, one messages moved to the trash folder.

Note: I'm confident that the ARexx script is not at fault. What it tells to Yam last is:
LISTUNFREEZE MAILS
APPNOBUSY

I'll see if I can get another crashlog from the nightly build.

Changed 14 months ago by AmigaPhil

comment:2 Changed 14 months ago by tboeckel

  • Milestone set to YAM 2.9
  • Owner set to tboeckel
  • Status changed from new to assigned

Currently I see no reason why anything in ClearFolderMails() should cause a crash.

Please try to reproduce this issue using the debug version of YAM to create a FOLDER log. Details about the debug version can be found in the FAQ. Please attach the log to this ticket.

Changed 14 months ago by AmigaPhil

folder debug log

comment:3 Changed 14 months ago by AmigaPhil

Having seen more DSI in the meantime, I've spotted that GR only appear if a message has previously been moved from incoming to trash.

comment:4 Changed 14 months ago by tboeckel

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [7049]) * YAM_FI.c, YAM_MA.c, misc: simplified the moving/copying of mails by omitting the additional folder pointer. Since each mail already carries a pointer to the folder it resides in it is quite senseless to specify the mail's source folder explicitly again. Furthermore this changes makes it possible to filter mails from different folders in one go as is it required after receiving mails and some of these mails have been moved from the Incoming folder to somewhere else by a script already (i.e. SpamFryer). This closes #420.

comment:5 follow-up: Changed 14 months ago by AmigaPhil

  • Resolution fixed deleted
  • Status changed from closed to reopened

Unfortunately, it still crash with yesterday's nightly build.

Changed 14 months ago by AmigaPhil

debug output - nightly build 13-09-2013

comment:6 in reply to: ↑ 5 Changed 14 months ago by tboeckel

Replying to AmigaPhil:

Unfortunately, it still crash with yesterday's nightly build.

Your log is not the FOLDER log I asked for, but a simple "nothing" log. Although this log indicates that there are some accesses to invalid strings are happening I really need the information of a FOLDER log for further debugging.

comment:7 Changed 14 months ago by AmigaPhil

Here it is, with the folder flag activated.

Not much more info before the crash however; but look at the last lines : there is a reference to a "mediatheque.be" folder : I have not and never have had such a folder (!?)

This time, GrimReaper did not mention ClearFolderMails, but <unknown>.
I have not have the chance to save the GR log as the computer froze.

Changed 14 months ago by AmigaPhil

Debug log, with FOLDER flag

comment:8 Changed 14 months ago by AmigaPhil

Here is a ARexx script to reproduce the crash easily.
Use it as a "After receiving mails" event.
Send yourself a mail with "yam crash test" as subject to test.

Changed 14 months ago by AmigaPhil

ARexx test case

comment:9 Changed 14 months ago by tboeckel

Ok, now I am perfectly able to reproduce this issue. Unfortunately I have no solution to this yet, except to not interfere with YAM's mail handling during the download process.

The reason is a bit complicated. Moving a mail from one folder to another will create a new (internal) copy of the mail. The first (old) pointer will finally be freed as it is not needed any longer. But exactly this (old) pointer is the one that will be used during the filter process and this is why YAM is crashing, because it is accessing no longer allocated memory.

I will see what I can do against this issue. Until this is really fixed all I can recommend is not to execute scripts which pull out mails from under YAM's control.

comment:10 Changed 14 months ago by tboeckel

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [7062]) * MailList.c, misc: added a reference counter to each mail. This makes it possible move a mail to a different folder in concurrent processes while still accessing the same mail without accessing invalid or already freed memory. The last referencing instance will finally free the mail if requested. This finally closes #420.

comment:11 Changed 14 months ago by tboeckel

I am quite sure I really fixed this isse this time. Please test this modification with the next nightly build as much as possible to confirm the fix.

comment:12 Changed 14 months ago by AmigaPhil

No more crash, thanks !
I'll keep testing for a few days.

comment:13 Changed 10 months ago by damato

  • Release Notes modified (diff)

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber

  • Philippe Duchenne(Reporter, Participant)
  • Thore Böckelmann(Owner, Participant)