Closed
Bug 84351
Opened 24 years ago
Closed 24 years ago
Crash on exiting messenger in filter code - Trunk [@ nsMsgFilterList::~nsMsgFilterList]
Categories
(MailNews Core :: Filters, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: mscott, Assigned: naving)
References
Details
(Keywords: crash, topcrash, Whiteboard: [PDT+])
Crash Data
Attachments
(3 files)
623 bytes,
patch
|
Details | Diff | Splinter Review | |
1.38 KB,
patch
|
Details | Diff | Splinter Review | |
15.35 KB,
patch
|
Details | Diff | Splinter Review |
My release builds have been crashing recently on exit sometimes.
Here's the stack trace from talkback. We are dereferencing a null ptr somewhere
in here.
nsMsgFilterList::~nsMsgFilterList
[d:\builds\seamonkey\mozilla\mailnews\base\search\src\nsMsgFilterList.cpp, line 700]
nsMsgFilterList::`scalar deleting destructor'
nsMsgFilterList::Release
[d:\builds\seamonkey\mozilla\mailnews\base\search\src\nsMsgFilterList.cpp, line 64]
nsCOMPtr_base::~nsCOMPtr_base
[d:\builds\seamonkey\mozilla\xpcom\base\nsCOMPtr.cpp, line 50]
nsImapIncomingServer::~nsImapIncomingServer
[d:\builds\seamonkey\mozilla\mailnews\imap\src\nsImapIncomingServer.cpp, line 119]
nsImapIncomingServer::`scalar deleting destructor'
nsMsgIncomingServer::Release
[d:\builds\seamonkey\mozilla\mailnews\base\util\nsMsgIncomingServer.cpp, line 99]
nsImapIncomingServer::Release
[d:\builds\seamonkey\mozilla\mailnews\imap\src\nsImapIncomingServer.cpp, line 86]
nsMsgAccountManager::~nsMsgAccountManager
[d:\builds\seamonkey\mozilla\mailnews\base\src\nsMsgAccountManager.cpp, line 156]
Assignee | ||
Comment 4•24 years ago
|
||
Reporter | ||
Comment 5•24 years ago
|
||
hey naving, doesn't this mean that mfilterstream isn't going to get deleted anymore?
Assignee | ||
Comment 6•24 years ago
|
||
m_fileStream just points to nsIOFileStream objects allocated by callers. The
callers have the obligation of closing and deleting stream, which they do
in this case. cc bienvenu for review.
Comment 7•24 years ago
|
||
No, I think this introduces a leak of the file stream.
nsMsgFilterService::OpenFilterList() does not delete the file stream it creates,
although it does close it. Perhaps we should just use comptrs here - this code
was written before comptrs existed.
Assignee | ||
Comment 9•24 years ago
|
||
I was just talking to mscott and will investigate more. However, I was thinking
if any massive changes would be allowed at this point.
Comment 10•24 years ago
|
||
I think it's about 5 lines of changes to use comptrs. Plus, people like seeing
comptrs :-)
Reporter | ||
Comment 11•24 years ago
|
||
I've noticing a lot of talkback reports with this stack trace now. adding top
crash keyword. Hoping PDT won't push it out past the release.
Keywords: topcrash
Comment 12•24 years ago
|
||
Yes, this is definitely a topcrasher. Here is the latest info from Talkback:
nsMsgFilterList::~nsMsgFilterList 37
First BBID :31250544
Last BBID :31380775
Min Runtime :80
Max Runtime :28009
First Appearance Date : 2001-06-03
Last Appearance Date : 2001-06-06
First BuildID : 2001053023
Last BuildID : 2001060509
Stack Trace:
nsMsgFilterList::~nsMsgFilterList
[d:\builds\seamonkey\mozilla\mailnews\base\search\src\nsMsgFilterList.cpp line 700]
nsMsgFilterList::`scalar deleting destructor'
nsMsgFilterList::Release
[d:\builds\seamonkey\mozilla\mailnews\base\search\src\nsMsgFilterList.cpp line 64]
nsCOMPtr_base::~nsCOMPtr_base
[d:\builds\seamonkey\mozilla\xpcom\base\nsCOMPtr.cpp line 50]
0x02409010
nsPop3IncomingServer::~nsPop3IncomingServer
[d:\builds\seamonkey\mozilla\mailnews\local\src\nsPop3IncomingServer.cpp line 97]
nsPop3IncomingServer::`scalar deleting destructor'
nsMsgIncomingServer::Release
[d:\builds\seamonkey\mozilla\mailnews\base\util\nsMsgIncomingServer.cpp line 99]
nsMsgAccountManager::hashElementRelease
[d:\builds\seamonkey\mozilla\mailnews\base\src\nsMsgAccountManager.cpp line 1058]
PL_HashTableEnumerateEntries
[../../../lib/ds/plhash.c line 414]
nsHashtable::Reset
[d:\builds\seamonkey\mozilla\xpcom\ds\nsHashtable.cpp line 389]
Source File :
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/base/search/src/nsMsgFilterList.cpp
line : 700
(31372283) URL: google.netscape.com
(31369860) URL: google.netscape.com
(31367376) Comments: Closed Mozilla
(31366994) Comments: closing program
(31366446) Comments: I switch builds and now it's MSGBASE.DLL (I wonder if bugs really
do crawl around in code)
(31365760) URL: google.netscape.com
(31364884) URL: google.netscape.com
(31364378) Comments: closing program
(31351202) Comments: I selected "File->Exit". That was enough to crash it [:-(]
(31350914)
Comments: crash on exit
(31349891) Comments: exiting N6 because it was failing to respond to email
(31347456) Comments: I'm nuking the install and starting over... I can't do anything
while I'm doing mail
(31346345) Comments: Crash upon closing
(31346325) URL: http://www.esd.gov.hk/chi/jumppage/auto_config.htm
(31343229)
Comments: shutting down mozilla
(31333107) Comments: Mozilla was in the process of closing down. I had right clicked
on the install icon so that I could remove it from my desktop.
(31309466) Comments: quitting
(31307616) Comments: crash on exit
(31286263) Comments: Closing program
Summary: Crash on exiting messenger in filter code → Crash on exiting messenger in filter code - Trunk [@ nsMsgFilterList::~nsMsgFilterList]
Assignee | ||
Comment 13•24 years ago
|
||
Looking at the first appearance date; this is a regression due to bug 49565
Assignee | ||
Comment 14•24 years ago
|
||
It is not crashing on 0.9.1 branch. I think hwaara just checked it on the trunk.
If it is urgent we can back out that fix.
Comment 15•24 years ago
|
||
Whoa whoa, no one notified me on this.
Looking...
Comment 16•24 years ago
|
||
Bienvenu: Unfortunately, nsIOFileStream doesn't have any any .idl file, which
also means that it doesn't support such. Right?
Comment 17•24 years ago
|
||
No, you're right, sorry, can't use comptrs - you'll have to fix it the old
fashioned way.
Comment 18•24 years ago
|
||
Hwaara, the reason this is crashing is that the memory leak fix that caused this
regression deletes the tmp file stream, and the filter list itself also deletes
the file stream, in its destructor. You can't delete a pointer twice.
I think that backing out the memory leak fix is probably the right thing to do -
the root cause of the problem seems to me that the filter list itself is not
getting freed in all situations. Previously, when it didn't get freed, it also
caused a leak of the file stream. After the memory leak fix, when the filter
list does get freed, we get a double delete and crash. I think it would be
better to find the root cause of the filter list leak.
Alternatively, we could do what Navin suggested, but we'd have to add code to
nsMsgFilterService::OpenFilterList to delete that stream too.
Comment 19•24 years ago
|
||
So in theory it all comes down to a huge leak where nsImapFolders on shutdown,
and therefore also leaking all members which include the nsMsgFilterList.
Will attach a patch which operates a delete on the filestream right after
close() in OpenFilterList() combined with naving's fix.
OS: Windows 2000 → All
Comment 20•24 years ago
|
||
Comment 21•24 years ago
|
||
r=, sr=?
Assignee | ||
Comment 22•24 years ago
|
||
I think it would be safer to pass the stream as parameter where ever needed
rather than making it a member variable (m_fileStream).
I was trying to use nsIFileSpec instead of nsIOFileStream but that didn't work
for some reason.
Assignee | ||
Comment 23•24 years ago
|
||
Assignee | ||
Comment 24•24 years ago
|
||
Pass nsIOFileStream as parameter. need r & sr
Reporter | ||
Comment 25•24 years ago
|
||
I like this solution a lot naving. r=mscott
Comment 26•24 years ago
|
||
yes, I do too sr=bienvenu
Assignee | ||
Comment 27•24 years ago
|
||
chofmann, I need your approval
a=dbaron for trunk checkin (on behalf of drivers)
Assignee | ||
Comment 30•24 years ago
|
||
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 31•24 years ago
|
||
*** Bug 84248 has been marked as a duplicate of this bug. ***
Comment 32•24 years ago
|
||
Mscott: fixed for you?
Naving: Any way to cause/verify this? Reproducibility hints?
Assignee | ||
Comment 33•24 years ago
|
||
It was crashing consistently on debug build. probably scott can verify it.
Reporter | ||
Comment 34•24 years ago
|
||
laurel, the best way to verify this is by looking at the talk back reports. I'm
no longer seeing this showing up on talkback reports for this stack trace since
the fix was checked in. It was a top crasher before
Another way to reproduce may have been to modify or create a new filter then
quit the app. But I'm not sure if that triggered the crash or not.
Comment 35•24 years ago
|
||
Marking verified.
Can't reproduce with june21 commercial trunk builds: win98, linux rh6.2 and mac
OS 9.0
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
Updated•14 years ago
|
Crash Signature: [@ nsMsgFilterList::~nsMsgFilterList]
You need to log in
before you can comment on or make changes to this bug.
Description
•