Closed Bug 1723593 Opened 4 years ago Closed 4 years ago

0xc0000142 (STATUS_DLL_INIT_FAILED) error when trying to run Nightly ASan build on Windows 11

Categories

(Core :: Fuzzing, defect)

Unspecified
Windows
defect

Tracking

()

VERIFIED FIXED
94 Branch
Tracking Status
firefox92 --- wontfix
firefox93 --- wontfix
firefox94 --- verified

People

(Reporter: cpeterson, Assigned: toshi)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

I just upgraded from Windows 10 to Windows 11 Beta (Version 10.0.22000 Build 22000). When I try to run a Firefox Nightly Asan build on Windows 11, the app fails to run with the following error message:

The application was unable to start correctly (0xc0000142). Click OK to close the application.

NT error code 0xc0000142 is STATUS_DLL_INIT_FAILED.

Blocks: 1722073
Severity: -- → S4

See bug 1361185 for a past occurrence of something similar on an upgrade of Windows 10. It is likely a similar asan runtime issue that would need to be investigated.

I reproduced the problem on Windows 11 (10.0.22000.1). The crash happened in Clang's runtime clang_rt.asan_dynamic-x86_64.dll. I believe this should be fixed on the Clang side.

0:000> r
rax=0000000000000005 rbx=00007ffcc085c200 rcx=0000000000d28548
rdx=0000000000000000 rsi=0000000000000000 rdi=00007ffcc11b7bd0
rip=00007ffcc0831ac6 rsp=000000b44f5fe1b8 rbp=0000000000000001
 r8=0000000074d28548  r9=0000000000008548 r10=00000000ffff8548
r11=8080808080808080 r12=00007ffcf50d8200 r13=00007ffcc0873508
r14=0000000000000002 r15=00007ffcc11b7bd0
iopl=0         nv up ei pl nz na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000204
clang_rt_asan_dynamic_x86_64+0x1ac6:
00007ffc`c0831ac6 cc              int     3
0:000> knL
 # Child-SP          RetAddr           Call Site
00 000000b4`4f5fe1b8 00007ffc`c0831b13 clang_rt_asan_dynamic_x86_64+0x1ac6
01 000000b4`4f5fe1c0 00007ffc`c08320db clang_rt_asan_dynamic_x86_64+0x1b13
02 000000b4`4f5fe260 00007ffc`c0861ebd clang_rt_asan_dynamic_x86_64+0x20db
03 000000b4`4f5fe2c0 00007ffc`c086b88f clang_rt_asan_dynamic_x86_64!_asan_wrap_atol+0x2fd
04 000000b4`4f5fe2f0 00007ffc`c084d4f9 clang_rt_asan_dynamic_x86_64!_asan_storeN_noabort+0x57f
05 000000b4`4f5fe360 00007ffc`c084dcb8 clang_rt_asan_dynamic_x86_64!_ubsan_get_current_report_data+0x1679
06 000000b4`4f5fe400 00007ffc`c0863106 clang_rt_asan_dynamic_x86_64!_ubsan_get_current_report_data+0x1e38
07 000000b4`4f5fe450 00007ffc`c08a0d16 clang_rt_asan_dynamic_x86_64!_asan_memmove+0x5d6
08 000000b4`4f5fece0 00007ffc`c08a0d9c clang_rt_asan_dynamic_x86_64!_ubsan_handle_function_type_mismatch_v1_abort+0x2ea76
09 000000b4`4f5fed10 00007ffc`c08ab7af clang_rt_asan_dynamic_x86_64!_ubsan_handle_function_type_mismatch_v1_abort+0x2eafc
0a 000000b4`4f5fed40 00007ffc`c0872f1c clang_rt_asan_dynamic_x86_64!_ubsan_handle_function_type_mismatch_v1_abort+0x3950f
0b 000000b4`4f5fed70 00007ffc`c0873226 clang_rt_asan_dynamic_x86_64!_ubsan_handle_function_type_mismatch_v1_abort+0xc7c
0c 000000b4`4f5feda0 00007ffc`c0873424 clang_rt_asan_dynamic_x86_64!_ubsan_handle_function_type_mismatch_v1_abort+0xf86
0d 000000b4`4f5fedd0 00007ffc`f507fb97 clang_rt_asan_dynamic_x86_64!_ubsan_handle_function_type_mismatch_v1_abort+0x1184
0e 000000b4`4f5fee30 00007ffc`f50b2a2e ntdll!LdrpCallInitRoutine+0x6b
0f 000000b4`4f5feea0 00007ffc`f50b27de ntdll!LdrpInitializeNode+0x1ca
10 000000b4`4f5fefe0 00007ffc`f50b2850 ntdll!LdrpInitializeGraphRecurse+0x42
11 000000b4`4f5ff020 00007ffc`f511f5b2 ntdll!LdrpInitializeGraphRecurse+0xb4
12 000000b4`4f5ff060 00007ffc`f510cee2 ntdll!LdrpInitializeProcess+0x1c86
13 000000b4`4f5ff420 00007ffc`f50ba7a3 ntdll!_LdrpInitialize+0x52706
14 000000b4`4f5ff4a0 00007ffc`f50ba6ce ntdll!LdrpInitializeInternal+0x6b
15 000000b4`4f5ff720 00000000`00000000 ntdll!LdrInitializeThunk+0xe

I reproduced the problem on Windows 11 (10.0.22000.1). The crash happened in Clang's runtime clang_rt.asan_dynamic-x86_64.dll. I believe this should be fixed on the Clang side.

Thanks for verifying!

I filed a clang bug: https://bugs.llvm.org/show_bug.cgi?id=51721

It's interesting that Clang does almost the same thing as our detour does. Their GetInstructionSize needs to support more patterns to detour Win11's ntdll.dll.

Submitted a patch to LLVM: https://reviews.llvm.org/D109941. I confirmed firefox.exe with this patch ran on Win11.

This is needed to run ASan binaries on Windows 11.

Assignee: nobody → tkikuchi
Status: NEW → ASSIGNED
Pushed by tkikuchi@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/aa51381f7b50 Port Windows 11 ASan fix to clang-12. r=glandium
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

Verified fixed in Nightly 94.0a1 build 2021-09-30.

Status: RESOLVED → VERIFIED
See Also: → 1769448
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: