Closed Bug 423259 Opened 18 years ago Closed 18 years ago

Crash [@ nsImapMailFolder::AllocateUidStringFromKeys] on mail startup

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kairo, Assigned: neil)

Details

(Keywords: crash)

Crash Data

Attachments

(2 files)

On my recent SeaMonkey debug builds (at least from yesterday and today), I'm getting a crash at mail startup, see attached stacktrace. I have some IMAP addresses that get checked right at mail startup, and the crash is at nsImapMailFolder::AllocateUidStringFromKeys, so that clearly seems related.
Just to be clear, this is the UA for where the crash happens: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5pre) Gecko/2008031612 SeaMonkey/2.0a1pre On a Gecko/2008030612, I didn't crash. Unfortunately, I didn't run the build I made in the days between those two.
The crashing line is http://mxr.mozilla.org/mozilla/source/mailnews/imap/src/nsImapMailFolder.cpp#1948 which is startSequence = keys[0]; That makes the "keys=0x5a5a5a5a" argument in the last frame look even more suspect than it has been before - note that it's passed up from frames below. Given this is array stuff and there hasn't been much change to nsImapMailFolder after that patch, Neil's change in http://bonsai.mozilla.org/cvslog.cgi?file=/mozilla/mailnews/imap/src/nsImapMailFolder.cpp&rev=HEAD&mark=1.796 is likely to be the cause, even though I wonder why the build before didn't have the problem, even though it should theoretically have been created shortly after this patch, but maybe I did for some reason not catch it there.
Attached patch Proposed patch — — Splinter Review
When all of your new messages are junk, we don't create a nonjunk bucket. Then when we come to store all the junk and nonjunk keywords, we discover that we don't have a nonjunk bucket and create one. Unfortunately, nsTArray only grows as necessary, compared to nsVoidArray which always grows at least 8 elements. This means that creating the junk bucket invalidates the memory location of the nonjunk bucket. The easy fix is to concentrate on one bucket at a time.
Assignee: bienvenu → neil
Status: NEW → ASSIGNED
Attachment #309764 - Flags: superreview?(dmose)
Attachment #309764 - Flags: review?
Comment on attachment 309764 [details] [diff] [review] Proposed patch Looking for KaiRo to test this since he can presumably reproduce the crash ;-)
Attachment #309764 - Flags: review? → review?(kairo)
Comment on attachment 309764 [details] [diff] [review] Proposed patch Looks good. With this patch, I can check IMAP accounts, run junk controls on them, move messages there, and don't crash :)
Attachment #309764 - Flags: review?(kairo) → review+
Summary: Crash @ nsImapMailFolder::AllocateUidStringFromKeys on mail startup → Crash [@ nsImapMailFolder::AllocateUidStringFromKeys] on mail startup
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
hanging sr? @ neil: superreview? (dmose)
It was important to fix the crash and I was hoping for post-facto review ;-)
Product: Core → MailNews Core
Attachment #309764 - Flags: superreview?(dmose) → superreview?(bienvenu)
Comment on attachment 309764 [details] [diff] [review] Proposed patch stealing review request.
Comment on attachment 309764 [details] [diff] [review] Proposed patch sorry for the delay - a comment would have been helpful since this is a bit of a magic workaround.
Attachment #309764 - Flags: superreview?(bienvenu) → superreview+
Crash Signature: [@ nsImapMailFolder::AllocateUidStringFromKeys]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: