Closed Bug 1972546 Opened 1 year ago Closed 1 year ago

startup crash [@ nsPop3Sink::IncorporateComplete ]

Categories

(MailNews Core :: Networking: POP, defect)

Thunderbird 140
defect

Tracking

(thunderbird_esr140 fixed, thunderbird140 affected)

RESOLVED FIXED
141 Branch
Tracking Status
thunderbird_esr140 --- fixed
thunderbird140 --- affected

People

(Reporter: mkmelin, Assigned: mkmelin)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 external file)

https://searchfox.org/comm-central/rev/03ced4f21b3b7b768f25e43238f3018452899239/mailnews/local/src/nsPop3Sink.cpp#492

bp-3b37768b-623c-4fe4-b1ad-12c060250617

Reason:

EXC_BAD_ACCESS / KERN_INVALID_ADDRESS

Top 10 frames:

0  XUL  nsPop3Sink::IncorporateComplete(nsIMsgWindow*, int)  mailnews/local/src/nsPop3Sink.cpp:492
1  XUL  _NS_InvokeByIndex
2  XUL  CallMethodHelper::Invoke()  js/xpconnect/src/XPCWrappedNative.cpp:1620
2  XUL  CallMethodHelper::Call()  js/xpconnect/src/XPCWrappedNative.cpp:1174
2  XUL  XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode)  js/xpconnect/src/XPCWrappedNative.cpp:1120
3  XUL  XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*)  js/xpconnect/src/XPCWrappedNativeJSOps.cpp:966
4  XUL  CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::...  js/src/vm/Interpreter.cpp:494
4  XUL  js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstru...  js/src/vm/Interpreter.cpp:590
5  XUL  InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason)  js/src/vm/Interpreter.cpp:657
5  XUL  js::CallFromStack(JSContext*, JS::CallArgs const&, js::CallReason)  js/src/vm/Interpreter.cpp:662
Crash Signature: [@ nsPop3Sink::IncorporateComplete ]
Keywords: crash
See Also: → 1934417
Version: unspecified → Thunderbird 140
Summary: crash [@ nsPop3Sink::IncorporateComplete ] → startup crash [@ nsPop3Sink::IncorporateComplete ]

That patch to IncorporateComplete() is Fine as a sticking-plaster, and as an internal-state-assertion.
But the bigger question is: how could it get into this state?

From a (very!) quick peek, m_outFileStream is set in IncorporateBegin(), and the only code path for leaving the stream pointer null will result in IncorporateBegin() returning an error.
So I'd say the real issue is that the pop3 code is continuing to attempt delivery to the nsIPop3Sink - by calling incorporateWrite()/incorporateComplete() - even though the nsIPop3Sink.incorporateBegin() has already told it to get stuffed :-)

Magnus: you probably know the JS side here better than anyone: can you spot any obvious issue there?

Flags: needinfo?(mkmelin+mozilla)
Keywords: leave-open

Seems like for the receivingMultiLineResponse cases we would not necessarily (easily be able to) bail out on a failed IncorporateBegin().
Not sure those are worth trying to catch it there, as with the added things should work out ok in the end anyway.

Flags: needinfo?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Target Milestone: --- → 141 Branch

Pushed by toby@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/58e864b1e70b
Fix crash [@ nsPop3Sink::IncorporateComplete ]. r=BenC

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Comment on attachment 9495165 [details]
Bug 1972546 - Fix crash [@ nsPop3Sink::IncorporateComplete ]. r=#thunderbird-back-end-reviewers

Uplift Approval Request

  • Please state case for uplift consideration and ensure bug severity is set: Crash fix
  • User impact if declined: May crash
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Daily?: Yes
  • Has the fix been verified in Beta?: Yes
  • Needs manual test from QA?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Basically just an added null check to avoid crash if we get into that situation
  • String changes made/needed: none
Attachment #9495165 - Flags: approval-comm-esr140?

Comment on attachment 9495165 [details]
Bug 1972546 - Fix crash [@ nsPop3Sink::IncorporateComplete ]. r=#thunderbird-back-end-reviewers

[Triage Comment]
Approved for esr140

Attachment #9495165 - Flags: approval-comm-esr140? → approval-comm-esr140+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: