Bug: Debug build of trunk version 111 crashes on MOZ_ASSERT() when connecting to MS site via OAuth2
Status: RESOLVED
Priority: --
Resolution: DUPLICATE
Created: 2023-02-05 20:21:01+00:00
Resolved: 2023-04-24 19:31:02+00:00

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.78

Steps to reproduce:

Debug build of trunk version 111 crashes on MOZ_ASSERT() when connection to MS site via OAuth2.

This happens when the authentication screen comes up. Stack:
```
#01: mozilla::dom::ContentParent::LogAndAssertFailedPrincipalValidationInfo (C:\mozilla-source\mozilla-central\dom\ipc\ContentParent.cpp:1333)
#02: mozilla::dom::BrowserParent::RecvNewWindowGlobal (C:\mozilla-source\mozilla-central\dom\ipc\BrowserParent.cpp:1335)
#03: mozilla::dom::PBrowserParent::OnMessageReceived (C:\mozilla-source\mozilla-central\obj-x86_64-pc-mingw32\ipc\ipdl\PBrowserParent.cpp:7584)
#04: mozilla::dom::PContentParent::OnMessageReceived (C:\mozilla-source\mozilla-central\obj-x86_64-pc-mingw32\ipc\ipdl\PContentParent.cpp:6750)
#05: mozilla::ipc::MessageChannel::DispatchAsyncMessage (C:\mozilla-source\mozilla-central\ipc\glue\MessageChannel.cpp:1800)
#06: mozilla::ipc::MessageChannel::DispatchMessage (C:\mozilla-source\mozilla-central\ipc\glue\MessageChannel.cpp:1725)
#07: mozilla::ipc::MessageChannel::RunMessage (C:\mozilla-source\mozilla-central\ipc\glue\MessageChannel.cpp:1525)
#08: mozilla::ipc::MessageChannel::MessageTask::Run (C:\mozilla-source\mozilla-central\ipc\glue\MessageChannel.cpp:1632)
#09: mozilla::RunnableTask::Run (C:\mozilla-source\mozilla-central\xpcom\threads\TaskController.cpp:540)
#10: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal (C:\mozilla-source\mozilla-central\xpcom\threads\TaskController.cpp:852)
#11: mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal (C:\mozilla-source\mozilla-central\xpcom\threads\TaskController.cpp:684)
#12: mozilla::TaskController::ProcessPendingMTTask (C:\mozilla-source\mozilla-central\xpcom\threads\TaskController.cpp:462)
#13: mozilla::detail::RunnableFunction<`lambda at C:/mozilla-source/mozilla-central/xpcom/threads/TaskController.cpp:188:7'>::Run (C:\mozilla-source\mozilla-central\xpcom\threads\nsThreadUtils.h:547)
#14: nsThread::ProcessNextEvent (C:\mozilla-source\mozilla-central\xpcom\threads\nsThread.cpp:1229)
#15: NS_ProcessNextEvent (C:\mozilla-source\mozilla-central\xpcom\threads\nsThreadUtils.cpp:477)
#16: mozilla::ipc::MessagePump::Run (C:\mozilla-source\mozilla-central\ipc\glue\MessagePump.cpp:86)
#17: MessageLoop::RunHandler (C:\mozilla-source\mozilla-central\ipc\chromium\src\base\message_loop.cc:375)
#18: MessageLoop::Run (C:\mozilla-source\mozilla-central\ipc\chromium\src\base\message_loop.cc:357)
#19: nsBaseAppShell::Run (C:\mozilla-source\mozilla-central\widget\nsBaseAppShell.cpp:150)
#20: nsAppShell::Run (C:\mozilla-source\mozilla-central\widget\windows\nsAppShell.cpp:614)
#21: nsAppStartup::Run (C:\mozilla-source\mozilla-central\toolkit\components\startup\nsAppStartup.cpp:296)
#22: XREMain::XRE_mainRun (C:\mozilla-source\mozilla-central\toolkit\xre\nsAppRunner.cpp:5650)
#23: XREMain::XRE_main (C:\mozilla-source\mozilla-central\toolkit\xre\nsAppRunner.cpp:5843)
#24: XRE_main (C:\mozilla-source\mozilla-central\toolkit\xre\nsAppRunner.cpp:5899)
#25: NS_internal_main (C:\mozilla-source\mozilla-central\comm\mail\app\nsMailApp.cpp:386)
#26: wmain (C:\mozilla-source\mozilla-central\toolkit\xre\nsWindowsWMain.cpp:167)
#27: __scrt_common_main_seh (d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
#28: BaseThreadInitThunk[C:\WINDOWS\System32\KERNEL32.DLL +0x17614]
#29: RtlUserThreadStart[C:\WINDOWS\SYSTEM32\ntdll.dll +0x526a1]
```


Actual results:

Crash here:
https://searchfox.org/mozilla-central/rev/0bf957f909ae1f3d19b43fd4edfc277342554836/dom/ipc/ContentParent.cpp#1333


Expected results:

Debug builds should generally work since (some) developers and upstream projects rely on them. Example of this not being the case: Bug 1801067 (with two duplicates of developers who couldn't work) and bug 1737485.

Any MOZ_ASSERT() is essentially indicating an error condition which is papered over in optimised release builds.