In my last ASan run below report showed up.
Maybe manifests also as crashes in https://test.winehq.org/data/patterns.html#setupapi:diskspace
Contains also a little patch reversing the message in two `ok` statements.
``` ================================================================= ==setupapi_test.exe==3900==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0xbebebebe in thread T0 #0 0x7a102bdb in free /home/runner/work/llvm-mingw/llvm-mingw/llvm-project/compiler-rt\lib/asan/asan_malloc_win.cpp:71:3 #1 0x78a6311c in SetupDestroyDiskSpaceList .../wine/dlls/setupapi/diskspace.c:246:5 #2 0x0042572a in test_SetupDuplicateDiskSpaceListA .../wine/dlls/setupapi/tests/diskspace.c:216:8 #3 0x00424ab1 in func_diskspace .../wine/dlls/setupapi/tests/diskspace.c:765:5 #4 0x0044f493 in run_test .../wine/include/wine/test.h:765:5 #5 0x0044f035 in main .../wine/include/wine/test.h:884:12 #6 0x004506de in mainCRTStartup .../wine/dlls/msvcrt/crt_main.c:58:11 #7 0x7bcc0f0f in BaseThreadInitThunk (C:\windows\system32\kernel32.dll+0x7b820f0f) #8 0x7be31dc2 in call_thread_func_wrapper (C:\windows\system32\ntdll.dll+0x7bc41dc2) #9 0x7be326c9 in call_thread_func .../wine/dlls/ntdll/signal_i386.c:524:9
Address 0xbebebebe is a wild pointer inside of access range of size 0x00000001. SUMMARY: AddressSanitizer: bad-free .../wine/dlls/setupapi/diskspace.c:246:5 in SetupDestroyDiskSpaceList ```
Testbot run with this two patches: https://testbot.winehq.org/JobDetails.pl?Key=151644
From: Bernhard Übelacker bernhardu@mailbox.org
--- dlls/setupapi/diskspace.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/setupapi/diskspace.c b/dlls/setupapi/diskspace.c index f5f39f627a8..83044ec9625 100644 --- a/dlls/setupapi/diskspace.c +++ b/dlls/setupapi/diskspace.c @@ -109,6 +109,7 @@ HDSKSPC WINAPI SetupDuplicateDiskSpaceListW(HDSKSPC handle, PVOID Reserved1, DWO copy->flags = list->flags; copy->count = list->count; copy->capacity = 0; + copy->files = NULL; array_reserve((void **)©->files, ©->capacity, copy->count, sizeof(*copy->files)); for (size_t i = 0; i < list->count; ++i) {
From: Bernhard Übelacker bernhardu@mailbox.org
--- dlls/setupapi/tests/diskspace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/tests/diskspace.c b/dlls/setupapi/tests/diskspace.c index 9f2afc1e53d..6064d8f1cf8 100644 --- a/dlls/setupapi/tests/diskspace.c +++ b/dlls/setupapi/tests/diskspace.c @@ -209,7 +209,7 @@ static void test_SetupDuplicateDiskSpaceListA(void) "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
duplicate = SetupDuplicateDiskSpaceListA(handle, NULL, 0, 0); - ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate); + ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to not return NULL, got %p\n", duplicate); ok(duplicate != handle, "Expected new handle (%p) to be different from the old handle (%p)\n", duplicate, handle);
@@ -285,7 +285,7 @@ static void test_SetupDuplicateDiskSpaceListW(void) "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
duplicate = SetupDuplicateDiskSpaceListW(handle, NULL, 0, 0); - ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to return NULL, got %p\n", duplicate); + ok(duplicate != NULL, "Expected SetupDuplicateDiskSpaceList to not return NULL, got %p\n", duplicate); ok(duplicate != handle, "Expected new handle (%p) to be different from the old handle (%p)\n", duplicate, handle);
This merge request was approved by Jinoh Kang.
Thanks for fixing this! Sorry I didn't get to it quicker myself...