A llvm-mingw built winver.exe with ASan enabled shows below error
when exiting the application.
This seems to be caused by libc++ using register_onexit_function
before ASan has all function hooks in place, therefore allocates
memory with plain calloc function.
On process exit ASan uses in asan_allocator.cpp/Deallocate the
function HeapValidate, which fails if msvcrt does not use the heap
returned by GetProcessHeap().
```
wine64 winver_asan.exe
=================================================================
==292==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x7ffffea05a10 in thread T0
0130:fixme:file:server_get_file_info Unsupported info class e
#0 0x6ffffa809fe1 in free .../llvm-mingw/llvm-project/compiler-rt\lib/asan/asan_malloc_win.cpp:71:3
#1 0x6ffffeb048c5 in execute_onexit_table /home/bernhard/wine/dlls/msvcrt\exit.c:141:5
#2 0x6ffffbfb109e in _CRT_INIT .../llvm-mingw/mingw-w64/mingw-w64-crt/build-x86_64\../crt\crtdll.c:130:11
#3 0x6ffffbfb1316 in __DllMainCRTStartup .../llvm-mingw/mingw-w64/mingw-w64-crt/build-x86_64\../crt\crtdll.c:196:6
#4 0x6fffffc6d223 in call_dll_entry_point (C:\windows\system32\ntdll.dll+0x17002d223)
#5 0x6fffffc71fdd in MODULE_InitDLL /home/bernhard/wine/dlls/ntdll\loader.c:1720:16
#6 0x6fffffc72601 in process_detach /home/bernhard/wine/dlls/ntdll\loader.c:1866:13
#7 0x6fffffc726f5 in RtlExitUserProcess /home/bernhard/wine/dlls/ntdll\loader.c:3893:5
#8 0x6fffffa8b899 in ExitProcess /home/bernhard/wine/dlls/kernel32\process.c:207:5
#9 0x6ffffeb054a7 in exit /home/bernhard/wine/dlls/msvcrt\exit.c:383:3
#10 0x000140001338 in mainCRTStartup /home/bernhard/wine/dlls/msvcrt\crt_main.c:60:5
#11 0x6fffffa98d58 in BaseThreadInitThunk /home/bernhard/wine/dlls/kernel32\thread.c:61:5
#12 0x6fffffc95afa in RtlUserThreadStart (C:\windows\system32\ntdll.dll+0x170055afa)
Address 0x7ffffea05a10 is a wild pointer inside of access range of size 0x000000000001.
SUMMARY: AddressSanitizer: bad-free /home/bernhard/wine/dlls/msvcrt\exit.c:141:5 in execute_onexit_table
==292==ABORTING
```
Please provide some guidance if this needs to be separated commits per msvcrt version, and if they are all needed (or more)?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/6791
This fixes https://bugs.winehq.org/show_bug.cgi?id=52094.
--
v5: ntdll: Properly track refcount with forwarded exports.
ntdll: Don't re-add a module dependency if it already exists.
ntdll: Remove some NULL checks for current_importer.
ntdll: Update current importer in LdrGetProcedureAddress().
ntdll: Wrap current_modref variable in a new structure.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7
structuredquery is required to support AQS filters in Windows.Devices.Enumeration's `FindAllAsync` methods, and this stubs adds a basic set of stubs to get the ball rolling.
--
v7: dlls/structuredquery: Add stubs for IQueryParserManager.
dlls/structuredquery/tests: Add basic conformance tests for IQueryParserManager.
include/structuredquery.idl: Add IQueryParserManager.
dlls/structuredquery: Add stubs for QueryParser.
dlls/structuredquery/tests: Add basic conformance tests for QueryParser.
dlls/structuredquery: Add stub.
include: Add structuredquery.idl.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6788
> I'm not enthusiastic anymore about championing my patches, knowing I can always maintain a local patchset or submit them to Proton
It's no use sending them to Proton because the same people who maintain Wine and Wine Staging also maintain Proton. You could try to get the patches accepted in another Wine derivative, but I think a bigger problem may be that the infinite-sleep workaround kind of only works by accident, so even though it works for the current version of MS Office, I expect that it will break in a future version. I hate to say it, but your time and energy, which I greatly appreciate, would probably be better spent on other Wine bugs.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5522#note_86895