Closed Bug 1766169 Opened 2 years ago Closed 2 years ago

Crash in [@ memset | nsXPCWrappedJS::CleanupOutparams]

Categories

(MailNews Core :: Networking: POP, defect, P1)

Thunderbird 99
Unspecified
Windows

Tracking

(thunderbird_esr102+ verified, thunderbird101+ wontfix, thunderbird102+ wontfix, thunderbird103 verified)

VERIFIED FIXED
104 Branch
Tracking Status
thunderbird_esr102 + verified
thunderbird101 + wontfix
thunderbird102 + wontfix
thunderbird103 --- verified

People

(Reporter: wsmwk, Assigned: KaiE)

References

(Regression)

Details

(4 keywords)

Crash Data

Attachments

(1 file, 1 obsolete file)

Starting with beta 99[1], The crash signature of Bug #1696893 returns, but the stack is different.

Maybe Fission related. (DOMFissionEnabled=1)

Crash report: https://crash-stats.mozilla.org/report/index/fc15e988-f2f8-465b-a1b2-396b20220423

Reason: EXCEPTION_ACCESS_VIOLATION_WRITE

Top 5 frames of crashing thread:

0 vcruntime140.dll memset d:\agent\_work\2\s\src\vctools\crt\vcruntime\src\string\i386\memset.asm:173
1 xul.dll static nsXPCWrappedJS::CleanupOutparams js/xpconnect/src/XPCWrappedJSClass.cpp:591
2 xul.dll nsXPCWrappedJS::CallMethod js/xpconnect/src/XPCWrappedJSClass.cpp:962
3 xul.dll PrepareAndDispatch xpcom/reflect/xptcall/md/win32/xptcstubs.cpp:79
4 xul.dll SharedStub xpcom/reflect/xptcall/md/win32/xptcstubs.cpp:98

[1] 99 beta bp-ea1ed557-890d-49fd-aaa5-e90e80220407 buildid 20220321154912

#3 crash for beta

Flags: needinfo?(mkmelin+mozilla)

Why do you think it's related to nsMsgMdnGenerator? (We could potentially rewrite that in js though.)
Without more information, we don't have a lot to go on. Are we sure it started with 99?

Flags: needinfo?(mkmelin+mozilla)

I don't think it is related - I forgot to take nsMsgMdnGenerator off of the summary.

Summary: Crash in [@ memset | nsXPCWrappedJS::CleanupOutparams] via nsMsgMdnGenerator::SendMdnMsg → Crash in [@ memset | nsXPCWrappedJS::CleanupOutparams]

(In reply to Magnus Melin [:mkmelin] from comment #2)

Without more information, we don't have a lot to go on. Are we sure it started with 99?

It can't be stated with 100% certainty that it started with 99, because we only have 6 months of crash data, and no crash-stats.mozilla.org for Nov-Feb. But crash-stats indicates it may have started with 99, per https://crash-stats.mozilla.org/signature/?signature=memset%20%7C%20nsXPCWrappedJS%3A%3ACleanupOutparams&date=%3E%3D2021-10-25T06%3A40%3A00.000Z&date=%3C2022-04-25T06%3A40%3A00.000Z&_sort=-date
Sorry don't have more solid info

memset | nsXPTType::ZeroValue may be the same issue. But it first appears with 101.0b1, not beta 99.
bp-471d67ab-a620-4259-b5fd-4644d0220507
0 vcruntime140.dll memset(unsigned char*, unsigned char, unsigned long) d:\agent_work\1\s\src\vctools\crt\vcruntime\src\string\i386\memset.asm:173
1 xul.dll nsXPTType::ZeroValue(void*) const xpcom/reflect/xptinfo/xptinfo.h:288
2 xul.dll static nsXPCWrappedJS::CleanupOutparams(nsXPTMethodInfo const*, nsXPTCMiniVariant*, bool, unsigned char) js/xpconnect/src/XPCWrappedJSClass.cpp:591
3 xul.dll nsXPCWrappedJS::CallMethod(unsigned short, nsXPTMethodInfo const*, nsXPTCMiniVariant*) js/xpconnect/src/XPCWrappedJSClass.cpp:962
4 xul.dll PrepareAndDispatch(nsXPTCStubBase*, unsigned int, unsigned int*, unsigned int*) xpcom/reflect/xptcall/md/win32/xptcstubs.cpp:79
5 xul.dll SharedStub() xpcom/reflect/xptcall/md/win32/xptcstubs.cpp:98

Crash Signature: [@ memset | nsXPCWrappedJS::CleanupOutparams] → [@ memset | nsXPCWrappedJS::CleanupOutparams] [@ memset | nsXPTType::ZeroValue ]

still a strong topcrash for beta

#2 crash for version 102. Any ideas?

This is regression from bug 1738173 that c-c moves POP3 implementation to JSM.

I guess that this is similar to bug 1751576. We shouldn't pass nullptr for out parameter.

Flags: needinfo?(m_kato)
Crash Signature: [@ memset | nsXPCWrappedJS::CleanupOutparams] [@ memset | nsXPTType::ZeroValue ] → [@ memset | nsXPCWrappedJS::CleanupOutparams] [@ memset | nsXPTType::ZeroValue ] [@ nsXPCWrappedJS::CleanupOutparams]

Thanks for that analysis.

Component: General → Networking: POP
Flags: needinfo?(remotenonsense)
Product: Thunderbird → MailNews Core

Crash happens because nullptr is used to receive return value of a JS xpcom function.

Assignee: nobody → remotenonsense
Status: NEW → ASSIGNED

(In reply to Wayne Mery (:wsmwk) from comment #7)

bp-57ecf5a3-3f4e-49dd-83c9-029f90220619 tb102

This has the most useful backtrace.

To reproduce, click the bottom-left icon to go offline, a dialog is shown asking whether to download, click the Download button, crash.
I don't know why nsImapOfflineSync.cpp calls nsLocalMailFolder.cpp which then calls Pop3IncomingServer.jsm.

Flags: needinfo?(remotenonsense)

If you have confidence in this patch, it would be great to have it land on Friday morning's nightly, and then Friday's beta. Please request uplift with your assessment of risk.

This would seem to be a regression - and it would be nice to know the cause - but more important that we understand and have confidence in the fix.

Flags: needinfo?(remotenonsense)
Flags: needinfo?(benc)
Priority: -- → P1

I'll attach an alternative patch.

Regressed by: 1738173

Comment on attachment 9284182 [details]
Bug 1766169 - Ensure all callers of Pop3/GetNewMail can correctly receive the result from the JS XPCOM implementation. r=rnons.

[Approval Request Comment]
Regression caused by (bug #): 1738173
User impact if declined: crash
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): Low, code simply ensures that the called function can properly return its result, instead of storing it into a bad location.

Attachment #9284182 - Flags: approval-comm-beta?
Attachment #9283550 - Attachment is obsolete: true
Assignee: remotenonsense → kaie
Flags: needinfo?(remotenonsense)
Flags: needinfo?(benc)
Target Milestone: --- → 104 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/22a302c0c965
Ensure all callers of Pop3/GetNewMail can correctly receive the result from the JS XPCOM implementation. r=rnons.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Comment on attachment 9284182 [details]
Bug 1766169 - Ensure all callers of Pop3/GetNewMail can correctly receive the result from the JS XPCOM implementation. r=rnons.

[Triage Comment]
Approved for beta

Attachment #9284182 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9284182 [details]
Bug 1766169 - Ensure all callers of Pop3/GetNewMail can correctly receive the result from the JS XPCOM implementation. r=rnons.

[Approval Request Comment]
Regression caused by (bug #): 1738173
User impact if declined: crash
Testing completed (on c-c, etc.): 103.0b4
Risk to taking this patch (and alternatives if risky): Low, code simply ensures that the called function can properly return its result, instead of storing it into a bad location.

Attachment #9284182 - Flags: approval-comm-esr102?

Comment on attachment 9284182 [details]
Bug 1766169 - Ensure all callers of Pop3/GetNewMail can correctly receive the result from the JS XPCOM implementation. r=rnons.

[Triage Comment]
Approved for esr102

Attachment #9284182 - Flags: approval-comm-esr102? → approval-comm-esr102+

gone everywhere.
Thanks!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: