https://bugs.winehq.org/show_bug.cgi?id=57498
Bug ID: 57498 Summary: ASan expects some imports to intercept from api-ms-win-core-heap-l1-1-0.dll Product: Wine Version: 9.22 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: ucrtbase Assignee: wine-bugs@winehq.org Reporter: bernhardu@mailbox.org Distribution: ---
This is a followup to bug #50993 and bug #49828.
Starting an instrumented executable with ASAN_OPTIONS='verbosity=1' gives this output:
Failed to intercept ucrtbase.dll import HeapAlloc Failed to intercept ucrtbase.dll import HeapFree Failed to intercept ucrtbase.dll import HeapReAlloc Failed to intercept ucrtbase.dll import HeapSize
This seems to be caused by ASan expecting these imports to be linked in through api-ms-win-core-heap-l1-1-0.dll. But currently ucrtbase.dll in Wine links directly to kernel32.dll.
One workaround is to add to ASAN_OPTIONS windows_hook_rtl_allocators=1.
Another workaround is, if already building llvm-mingw from source, to modify following location this way:
llvm-mingw/llvm-project/compiler-rt/lib/asan/asan_malloc_win.cpp: #define INTERCEPT_UCRT_FUNCTION(func) \ if (!INTERCEPT_FUNCTION_DLLIMPORT( \ - "ucrtbase.dll", "api-ms-win-core-heap-l1-1-0.dll", func)) { \ + "ucrtbase.dll", "kernel32.dll", func)) { \
Reproducing currently needs a modified llvm-mingw build, which allows ASan to recognize a few more instructions like here: https://github.com/llvm/llvm-project/pull/113085
https://bugs.winehq.org/show_bug.cgi?id=57498
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de