Closed Bug 717129 Opened 12 years ago Closed 12 years ago

crash nsNNTPProtocol::Initialize

Categories

(MailNews Core :: Networking: NNTP, defect)

x86
Windows NT
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 15.0

People

(Reporter: m_kato, Assigned: aceman)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file, 2 obsolete files)

This bug was filed from the Socorro interface and is 
report bp-b037d74c-94b5-46d9-883c-c4be62120108 .
============================================================= 
0 	xul.dll 	nsNNTPProtocol::Initialize 	mailnews/news/src/nsNNTPProtocol.cpp:381
1 	xul.dll 	nsNntpIncomingServer::GetNntpConnection 	mailnews/news/src/nsNntpIncomingServer.cpp:592
2 	xul.dll 	nsNntpIncomingServer::LoadNewsUrl 	mailnews/news/src/nsNntpIncomingServer.cpp:623
3 	xul.dll 	nsNntpService::RunNewsUrl 	mailnews/news/src/nsNntpService.cpp:1195
4 	xul.dll 	nsNntpService::GetNewNews 	mailnews/news/src/nsNntpService.cpp:1226
5 	xul.dll 	nsMsgNewsFolder::GetNewsMessages 	mailnews/news/src/nsNewsFolder.cpp:923
6 	xul.dll 	nsMsgNewsFolder::GetNewMessages 	mailnews/news/src/nsNewsFolder.cpp:894
7 	xul.dll 	nsNntpIncomingServer::DownloadMail 	mailnews/news/src/nsNntpIncomingServer.cpp:705
8 	xul.dll 	nsNntpIncomingServer::PerformExpand 	mailnews/news/src/nsNntpIncomingServer.cpp:682
9 	xul.dll 	NS_InvokeByIndex_P 	xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp:102
10 	xul.dll 	XPCWrappedNative::CallMethod 	js/src/xpconnect/src/xpcwrappednative.cpp:2334
11 	xul.dll 	XPC_WN_CallMethod 	js/src/xpconnect/src/xpcwrappednativejsops.cpp:1629
12 	mozjs.dll 	CallCompiler::generateNativeStub 	js/src/methodjit/MonoIC.cpp:937
13 	mozjs.dll 	js::mjit::ic::NativeCall 	js/src/methodjit/MonoIC.cpp:1162
14 	mozjs.dll 	js::mjit::EnterMethodJIT 	js/src/methodjit/MethodJIT.cpp:884
15 	mozjs.dll 	js::mjit::JaegerShot 	js/src/methodjit/MethodJIT.cpp:962
16 	mozjs.dll 	js::Interpret 	js/src/jsinterp.cpp:4075
17 	mozjs.dll 	js::RunScript 	js/src/jsinterp.cpp:614
18 	mozjs.dll 	js::InvokeKernel 	js/src/jsinterp.cpp:678
19 	mozjs.dll 	js::Invoke 	js/src/jsinterp.cpp:710
20 	mozjs.dll 	JS_CallFunctionValue 	js/src/jsapi.cpp:5039
21 	xul.dll 	nsXPCWrappedJSClass::CallMethod 	js/src/xpconnect/src/xpcwrappedjsclass.cpp:1660
22 	xul.dll 	nsXPCWrappedJS::CallMethod 	js/src/xpconnect/src/xpcwrappedjs.cpp:585
23 	xul.dll 	PrepareAndDispatch 	xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp:114
24 	xul.dll 	SharedStub 	xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp:141
25 	xul.dll 	NS_InvokeByIndex_P 	xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp:102


m_nntpServer seems to be null.  connection pool has closed connection?
Component: General → Networking: NNTP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.nntp
Should I add the check?
(In reply to :aceman from comment #1)
> Should I add the check?

go for it
Assignee: nobody → acelists
Attached patch patch (obsolete) — Splinter Review
Should the function exit like this, or can the server be initialized somehow?
Attachment #592218 - Flags: review?(dbienvenu)
Status: NEW → ASSIGNED
Comment on attachment 592218 [details] [diff] [review]
patch

probably better to ask Joshua...
Attachment #592218 - Flags: review?(dbienvenu) → review?(Pidgeot18)
Jcranmer, any idea?
Comment on attachment 592218 [details] [diff] [review]
patch

Review of attachment 592218 [details] [diff] [review]:
-----------------------------------------------------------------

The problem is not the server isn't initialized (that has to happen when it's created), but that it's apparently being used after the server is dead. I'd rather see an assertion on m_nntpServer not being present and using some other error (NS_ERROR_UNEXPECTED perhaps?).
Attachment #592218 - Flags: review?(Pidgeot18) → review-
But why would that happen? You don't know but you want to see the message in error console so that the user can report it and we can ask him what he does?

Is NS_ENSURE_TRUE an assertion? Or what exactly should I make it?
NS_ASSERTION is how you get an assertion (it won't fail in release builds, so you still need a check to prevent a crash).

As for how it happens, we end up a lot of time in NNTP having values which can't be null being null somewhow, so I'm going to chalk it up to the same effect.
OK, so the only thing I have to do in the patch is just add an NS_ASSERTION line next to the NS_ENSURE_TRUE line?
I'm also not thrilled with the use of NS_ERROR_UNITIALIZED; another one would be better.
Attached patch patch v2 (obsolete) — Splinter Review
Attachment #592218 - Attachment is obsolete: true
Attachment #628472 - Flags: review?(Pidgeot18)
Comment on attachment 628472 [details] [diff] [review]
patch v2

Review of attachment 628472 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/news/src/nsNNTPProtocol.cpp
@@ +329,5 @@
>    }
>    nsMsgProtocol::InitFromURI(aURL);
>  
>    nsCOMPtr<nsIMsgIncomingServer> server = do_QueryInterface(m_nntpServer);
> +  NS_ASSERTION(m_nntpServer, "m_nntpServer is null!");

Change this message to "nsNNTPProtocol needs an m_nntpServer"
Attachment #628472 - Flags: review?(Pidgeot18) → review+
Attached patch patch v3Splinter Review
Thanks, done.
Attachment #628472 - Attachment is obsolete: true
Attachment #628819 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/62b83330b36c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
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.

Attachment

General

Creator:
Created:
Updated:
Size: