crash [@ nsMsgSearchSession::GetRunningAdapter(nsIMsgSearchAdapter**)]

RESOLVED FIXED in Thunderbird 15.0

Status

MailNews Core
Search
--
critical
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: wsmwk, Assigned: dlech)

Tracking

({crash})

Trunk
Thunderbird 15.0
x86
All
crash
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(crash signature)

Attachments

(1 attachment, 1 obsolete attachment)

crash [@ nsMsgSearchSession::GetRunningAdapter(nsIMsgSearchAdapter**)]
almost non-existent
interesting: all OS

2b548a85-9e82-46fc-a22d-7b91c2101007 (thomas)
0	thunderbird-bin	nsMsgSearchSession::GetRunningAdapter	mailnews/base/search/src/nsMsgSearchSession.cpp:566
1	thunderbird-bin	nsMsgSearchSession::OnStopRunningUrl	mailnews/base/search/src/nsMsgSearchSession.cpp:374
2	thunderbird-bin	nsMsgMailNewsUrl::SetUrlState	mailnews/base/util/nsMsgMailNewsUrl.cpp:135
3	thunderbird-bin	nsImapMailFolder::SetUrlState	mailnews/imap/src/nsImapMailFolder.cpp:6603
4	libxpcom_core.so	libxpcom_core.so@0x63f86	
5	libxpcom_core.so	nsProxyObjectCallInfo::Run	xpcom/proxy/src/nsProxyEvent.cpp:181
6	libxpcom_core.so	nsThread::ProcessNextEvent	xpcom/threads/nsThread.cpp:521 


bp-a812ff1a-b0de-4cc5-ba2e-ad52d2100901 v3.1.2
0	thunderbird.exe	nsMsgSearchSession::GetRunningAdapter	mailnews/base/search/src/nsMsgSearchSession.cpp:584
1	thunderbird.exe	nsImapMailFolder::NotifySearchHit	mailnews/imap/src/nsImapMailFolder.cpp:5574
2	xpcom_core.dll	NS_InvokeByIndex_P	xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp:102 


bp-f34641cc-9c0d-4563-b4b0-ca93c2101104 v3.1.7pre
0	thunderbird.exe	nsMsgSearchSession::GetRunningAdapter	mailnews/base/search/src/nsMsgSearchSession.cpp:584
1	thunderbird.exe	nsMsgSearchSession::OnStopRunningUrl	mailnews/base/search/src/nsMsgSearchSession.cpp:392
2	thunderbird.exe	nsMsgMailNewsUrl::SetUrlState	mailnews/base/util/nsMsgMailNewsUrl.cpp:136
3	thunderbird.exe	nsImapMailFolder::SetUrlState	mailnews/imap/src/nsImapMailFolder.cpp:6643
4	xpcom_core.dll	NS_InvokeByIndex_P	xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp:102
Crash Signature: [@ nsMsgSearchSession::GetRunningAdapter(nsIMsgSearchAdapter**)]
1 crash per month for 3.1 ending at 3.1.10. 
And none for v5 or v6.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME
(Assignee)

Comment 2

5 years ago
Created attachment 619491 [details] [diff] [review]
add check for existance of scope->m_adapter

I caused a crash here while working on an extension. This particular case involved an IMAP server. It is possible to create a search without an adapter, which I did. The adapter is not created until you run the search. Then, I manually sent a search command to the server using the nsIMsgImapMailFolder.issueCommandOnMsgs function.

The crash was caused by scope->m_adapter being a null pointer. I added a check for this so that when it happens, it fails gracefully instead of crashing.
David, can you request review for your patch?

(fwiw, no crashes found for past 6 weeks. but reopening to accept patch)
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
(Assignee)

Updated

5 years ago
Attachment #619491 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #619491 - Flags: review? → review?(dbienvenu)

Comment 4

5 years ago
Comment on attachment 619491 [details] [diff] [review]
add check for existance of scope->m_adapter

thx for the patch. You should be able to use NS_IF_ADDREF(*aSearchAdapter = scope->m_adapter); If that works, I'd give an r+ for that.
Attachment #619491 - Flags: review?(dbienvenu) → review-
(Assignee)

Comment 5

5 years ago
Created attachment 619737 [details] [diff] [review]
made change suggested in comment 4

Changed patch to use NS_IF_ADDREF. Also moved the *aSearchAdapter = nsnull; line to ensure that *aSearchAdapter is assigned a value in all cases.
Attachment #619491 - Attachment is obsolete: true
Attachment #619737 - Flags: review?(dbienvenu)
(Assignee)

Comment 6

5 years ago
Forgot to mention that I tested it with my broken plugin to verify that the revised patch also fixes the crash.

Comment 7

5 years ago
Comment on attachment 619737 [details] [diff] [review]
made change suggested in comment 4

looks ok, thx.
Attachment #619737 - Flags: review?(dbienvenu) → review+
(Assignee)

Updated

5 years ago
Attachment #619737 - Flags: superreview?(mbanner)

Comment 8

5 years ago
Comment on attachment 619737 [details] [diff] [review]
made change suggested in comment 4

you don't need super review for a patch that doesn't change an interface...
Attachment #619737 - Flags: superreview?(mbanner)

Updated

5 years ago
Keywords: checkin-needed
Thanks for the patch!

http://hg.mozilla.org/comm-central/rev/cd7bbb603424
Assignee: nobody → gismho+mozbug
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago5 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 15.0
You need to log in before you can comment on or make changes to this bug.