Bug: Downloading all message headers (600000) from a newsgroup causes hang.
Status: RESOLVED
Priority: --
Resolution: FIXED
Created: 2024-11-16 06:04:44+00:00
Resolved: 2024-12-16 23:12:05+00:00

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

Steps to reproduce:

Add a newsmail account with server name "news.gmane.io"
Subscribe to a newsgroup with name "gmane.linux.kernel"
Click the newsgroup among subscribed newsgroup list.
Specify 600000 as number of headers to fetch.
Click Download.


Actual results:

Hangs or Busy with following stacktrace.

Stack trace (Tab delimited)
#	File name	 Line number	 Name
0	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KiDeliverApc+0x27b
1	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KiSwapThread+0x827
2	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KiCommitThreadWait+0x14f
3	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KeWaitForSingleObject+0x233
4	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KiSchedulerApc+0x3bd
5	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KiDeliverApc+0x391
6	 C:\WINDOWS\system32\ntoskrnl.exe	 	 ntoskrnl.exe!KiApcInterrupt+0x2ff
7	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/algorithm @ 7914	 xul.dll!std::_Partition_by_median_guess_unchecked<unsigned int *
8	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/algorithm @ 7967	 xul.dll!std::_Sort_unchecked<unsigned int *
9	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/algorithm @ 7976	 xul.dll!std::_Sort_unchecked<unsigned int *
10	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/fetches/vs/VC/Tools/MSVC/14.39.33519/include/algorithm @ 7986	 xul.dll!std::sort+0x5 (Inline function)
11	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/workspace/obj-build/dist/include/nsTArray.h @ 2370	 xul.dll!nsTArray_Impl<unsigned int
12	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/workspace/obj-build/dist/include/nsTArray.h @ 2378	 xul.dll!nsTArray_Impl<unsigned int
13	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/comm/mailnews/db/msgdb/src/nsMsgThread.cpp @ 105	 xul.dll!nsMsgThread::InitCachedValues+0x267
14	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/comm/mailnews/db/msgdb/src/nsMsgThread.cpp @ 34	 xul.dll!nsMsgThread::nsMsgThread+0x15c
15	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/comm/mailnews/db/msgdb/src/nsMsgDatabase.cpp @ 4212	 xul.dll!nsMsgDatabase::GetThreadForThreadId+0xf1
16	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/comm/mailnews/db/msgdb/src/nsMsgDatabase.cpp @ 3827	 xul.dll!nsMsgDatabase::GetThreadForReference+0x73
17	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/comm/mailnews/db/msgdb/src/nsMsgDatabase.cpp @ 3929	 xul.dll!nsMsgDatabase::ThreadNewHdr+0x15b
18	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/comm/mailnews/db/msgdb/src/nsMsgDatabase.cpp @ 2910	 xul.dll!nsMsgDatabase::AddNewHdrToDB+0x9d
19	 D:\Program Files\Mozilla Thunderbird\xul.dll	 Z:\builds\worker\checkouts\gecko\xpcom\reflect\xptcall\md\win32\xptcinvoke_asm_x86_64.asm @ 99	 xul.dll!XPTC__InvokebyIndex+0x72
20	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/xpconnect/src/XPCWrappedNative.cpp @ 1620	 xul.dll!CallMethodHelper::Invoke+0x24 (Inline function)
21	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/xpconnect/src/XPCWrappedNative.cpp @ 1174	 xul.dll!CallMethodHelper::Call+0xdc9 (Inline function)
22	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/xpconnect/src/XPCWrappedNative.cpp @ 1120	 xul.dll!XPCWrappedNative::CallMethod+0xefc
23	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @ 966	 xul.dll!XPC_WN_CallMethod+0x252
24	 	 	 0x1c790934398
25	 	 	 0x1c7907e1538
26	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/jit/BaselineJIT.cpp @ 140	 xul.dll!EnterBaseline+0xa8 (Inline function)
27	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/jit/BaselineJIT.cpp @ 196	 xul.dll!js::jit::EnterBaselineInterpreterAtBranch+0x20e
28	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 2097	 xul.dll!js::Interpret+0x6f8
29	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 433	 xul.dll!MaybeEnterInterpreterTrampoline+0x127 (Inline function)
30	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 502	 xul.dll!js::RunScript+0x246
31	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 660	 xul.dll!js::InternalCallOrConstruct+0x36d
32	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/jit/BaselineIC.cpp @ 1683	 xul.dll!js::jit::DoCallFallback+0x471
33	 	 	 0x1c7907e39f2
34	 	 	 0x1c7907e97d6
35	 	 	 0x1c7907ebac2
36	 	 	 0x1c7907ec35f
37	 	 	 0x1c7907e1538
38	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/jit/Jit.cpp @ 114	 xul.dll!EnterJit+0x13b (Inline function)
39	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/jit/Jit.cpp @ 260	 xul.dll!js::jit::MaybeEnterJit+0x28d
40	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 493	 xul.dll!js::RunScript+0x101
41	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 660	 xul.dll!js::InternalCallOrConstruct+0x36d
42	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 695	 xul.dll!InternalCall+0xb (Inline function)
43	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 727	 xul.dll!js::Call+0xb9
44	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/SelfHosting.cpp @ 1576	 xul.dll!js::CallSelfHostedFunction+0xfe
45	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/AsyncFunction.cpp @ 156	 xul.dll!AsyncFunctionResume+0x1e4
46	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/builtin/Promise.cpp @ 2116	 xul.dll!AsyncFunctionPromiseReactionJob+0x96 (Inline function)
47	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/builtin/Promise.cpp @ 2179	 xul.dll!PromiseReactionJob+0x41b
48	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 532	 xul.dll!CallJSNative+0xbf (Inline function)
49	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 628	 xul.dll!js::InternalCallOrConstruct+0x220
50	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 695	 xul.dll!InternalCall+0xb (Inline function)
51	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp @ 727	 xul.dll!js::Call+0xb9
52	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/src/vm/CallAndConstruct.cpp @ 119	 xul.dll!JS::Call+0x309
53	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/workspace/obj-build/dom/bindings/./JSActorBinding.cpp @ 35	 xul.dll!mozilla::dom::MozJSActorCallback::Call+0xb7
54	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h @ 198	 xul.dll!mozilla::dom::PromiseJobCallback::Call+0x61 (Inline function)
55	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h @ 211	 xul.dll!mozilla::dom::PromiseJobCallback::Call+0x69 (Inline function)
56	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/xpcom/base/CycleCollectedJSContext.cpp @ 209	 xul.dll!mozilla::PromiseJobRunnable::Run+0x10e
57	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/xpcom/base/CycleCollectedJSContext.cpp @ 715	 xul.dll!mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint+0x3b0
58	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/xpcom/base/CycleCollectedJSContext.cpp @ 504	 xul.dll!mozilla::CycleCollectedJSContext::AfterProcessTask+0xf
59	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/js/xpconnect/src/XPCJSContext.cpp @ 1461	 xul.dll!XPCJSContext::AfterProcessTask+0x312
60	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp @ 1195	 xul.dll!nsThread::ProcessNextEvent+0x8f4
61	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp @ 480	 xul.dll!NS_ProcessNextEvent+0x68
62	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp @ 85	 xul.dll!mozilla::ipc::MessagePump::Run+0xaa
63	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc @ 369	 xul.dll!MessageLoop::RunInternal+0x16 (Inline function)
64	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc @ 363	 xul.dll!MessageLoop::RunHandler+0x50
65	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc @ 345	 xul.dll!MessageLoop::Run+0x57
66	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/widget/nsBaseAppShell.cpp @ 150	 xul.dll!nsBaseAppShell::Run+0x28
67	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/widget/windows/nsAppShell.cpp @ 679	 xul.dll!nsAppShell::Run+0xe4
68	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/toolkit/components/startup/nsAppStartup.cpp @ 295	 xul.dll!nsAppStartup::Run+0x48
69	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp @ 5791	 xul.dll!XREMain::XRE_mainRun+0x11dd
70	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp @ 6032	 xul.dll!XREMain::XRE_main+0x5cd
71	 D:\Program Files\Mozilla Thunderbird\xul.dll	 /builds/worker/checkouts/gecko/toolkit/xre/nsAppRunner.cpp @ 6104	 xul.dll!XRE_main+0xa5
72	 D:\Program Files\Mozilla Thunderbird\thunderbird.exe	 /builds/worker/checkouts/gecko/comm/mail/app/nsMailApp.cpp @ 221	 thunderbird.exe!do_main+0x242 (Inline function)
73	 D:\Program Files\Mozilla Thunderbird\thunderbird.exe	 /builds/worker/checkouts/gecko/comm/mail/app/nsMailApp.cpp @ 391	 thunderbird.exe!NS_internal_main+0x3f4
74	 D:\Program Files\Mozilla Thunderbird\thunderbird.exe	 /builds/worker/checkouts/gecko/toolkit/xre/nsWindowsWMain.cpp @ 151	 thunderbird.exe!wmain+0x1de
75	 D:\Program Files\Mozilla Thunderbird\thunderbird.exe	 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 90	 thunderbird.exe!invoke_main+0x22 (Inline function)
76	 D:\Program Files\Mozilla Thunderbird\thunderbird.exe	 D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288	 thunderbird.exe!__scrt_common_main_seh+0x10c
77	 C:\Windows\System32\kernel32.dll	 	 kernel32.dll!BaseThreadInitThunk+0x14
78	 C:\Windows\System32\ntdll.dll	 	 ntdll.dll!RtlUserThreadStart+0x21



Expected results:

nsMsgThread::InitCachedValues should get rid of code snippets that introduce performance degradation since its introduction from #1883506.