This should fix crashes on W10L vms, when we pass NULL to InternetUnlockRequestFile after prior lock already failed. Crashes are here: https://test.winehq.org/data/tests/wininet:http.html Behavior after crash is here: https://testbot.winehq.org/JobDetails.pl?Key=104580
Signed-off-by: Robert Wilhelm robert.wilhelm@gmx.net --- dlls/wininet/tests/http.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index cf3f62f868a..ee56c64fbd9 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1718,10 +1718,13 @@ static void InternetLockRequestFile_test(void)
ret = InternetLockRequestFile(req.request, &lock2); ok(ret, "InternetLockRequestFile returned: %x(%u)\n", ret, GetLastError()); + ok(lock2 != NULL, "lock2 == NULL\n"); ok(lock == lock2, "lock != lock2\n");
- ret = InternetUnlockRequestFile(lock2); - ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError()); + if (lock2) { + ret = InternetUnlockRequestFile(lock2); + ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError()); + }
ret = DeleteFileA(file_name); ok(!ret && GetLastError() == ERROR_SHARING_VIOLATION, "Deleting file returned %x(%u)\n", ret, GetLastError()); @@ -1731,8 +1734,12 @@ static void InternetLockRequestFile_test(void) ret = DeleteFileA(file_name); ok(!ret && GetLastError() == ERROR_SHARING_VIOLATION, "Deleting file returned %x(%u)\n", ret, GetLastError());
- ret = InternetUnlockRequestFile(lock); - ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError()); + ok(lock != NULL, "lock == 0\n"); + if (lock) + { + ret = InternetUnlockRequestFile(lock); + ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError()); + }
ret = DeleteFileA(file_name); ok(ret, "Deleting file returned %x(%u)\n", ret, GetLastError()); -- 2.31.1
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104599
Your paranoid android.
=== w8adm (32 bit report) ===
wininet: http.c:697: Test failed: req_error = 12007 http.c:708: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 1 times, received 0 times http.c:721: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 1 times, received 0 times http.c:722: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 1 times, received 0 times http.c:723: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 1 times, received 0 times http.c:724: Test failed: expected status 41 (INTERNET_STATUS_RESPONSE_RECEIVED) 1 times, received 0 times http.c:733: Test failed: flags = 8, expected 0 http.c:747: Test failed: Expected any header character, got 0x00 http.c:774: Test failed: Expected 0x0000, got 7777 http.c:937: Test failed: Returned zero size in response to request complete http.c:376: Test failed: unexpected status 10 (INTERNET_STATUS_RESOLVING_NAME) http.c:376: Test failed: unexpected status 11 (INTERNET_STATUS_NAME_RESOLVED) http.c:718: Test failed: expected status 10 (INTERNET_STATUS_RESOLVING_NAME) 0 times, received 1 times http.c:719: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 0 times, received 1 times
=== w10pro64 (32 bit report) ===
wininet: http.c:376: Test failed: unexpected status 20 (INTERNET_STATUS_CONNECTING_TO_SERVER) http.c:1737: Test failed: lock == 0 http.c:1745: Test failed: Deleting file returned 0(2) http.c:1299: Test failed: DeleteUrlCacheEntry returned 0, GetLastError() = 12004 http.c:1325: Test failed: INTERNET_FLAG_NO_CACHE_WRITE flag doesn't work http.c:3817: Test failed: cache entry should not exist http.c:3888: Test failed: HttpSendRequest failed with error 12004 http.c:3892: Test failed: read 0 bytes of data http.c:3904: Test failed: HttpQueryInfo(HTTP_QUERY_CONTENT_TYPE) failed: 12150 http.c:3906: Test failed: buf = http.c:3933: Test failed: HttpSendRequest failed with error 12004 http.c:3937: Test failed: read 0 bytes of data http.c:3941: Test failed: HttpQueryInfo(HTTP_QUERY_CONTENT_ENCODING) failed: 12150
=== w10pro64 (64 bit report) ===
wininet: http.c:376: Test failed: unexpected status 20 (INTERNET_STATUS_CONNECTING_TO_SERVER) http.c:1721: Test failed: lock2 == NULL http.c:1730: Test failed: Deleting file returned 0(3) http.c:1735: Test failed: Deleting file returned 0(3) http.c:1737: Test failed: lock == 0 http.c:1745: Test failed: Deleting file returned 0(3) http.c:1299: Test failed: DeleteUrlCacheEntry returned 0, GetLastError() = 12004 http.c:1325: Test failed: INTERNET_FLAG_NO_CACHE_WRITE flag doesn't work http.c:3817: Test failed: cache entry should not exist http.c:3888: Test failed: HttpSendRequest failed with error 12004 http.c:3892: Test failed: read 0 bytes of data http.c:3904: Test failed: HttpQueryInfo(HTTP_QUERY_CONTENT_TYPE) failed: 12150 http.c:3906: Test failed: buf = http.c:3933: Test failed: HttpSendRequest failed with error 12004 http.c:3937: Test failed: read 0 bytes of data http.c:3941: Test failed: HttpQueryInfo(HTTP_QUERY_CONTENT_ENCODING) failed: 12150
=== debian11 (32 bit German report) ===
wininet: http.c:3602: Test failed: got 66
On 12/29/21 14:40, Robert Wilhelm wrote:
This should fix crashes on W10L vms, when we pass NULL to InternetUnlockRequestFile after prior lock already failed. Crashes are here: https://test.winehq.org/data/tests/wininet:http.html Behavior after crash is here: https://testbot.winehq.org/JobDetails.pl?Key=104580
Signed-off-by: Robert Wilhelm robert.wilhelm@gmx.net
dlls/wininet/tests/http.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index cf3f62f868a..ee56c64fbd9 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1718,10 +1718,13 @@ static void InternetLockRequestFile_test(void)
ret = InternetLockRequestFile(req.request, &lock2); ok(ret, "InternetLockRequestFile returned: %x(%u)\n", ret, GetLastError());
- ok(lock2 != NULL, "lock2 == NULL\n"); ok(lock == lock2, "lock != lock2\n");
- ret = InternetUnlockRequestFile(lock2);
- ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError());
- if (lock2) {
ret = InternetUnlockRequestFile(lock2);
ok(ret, "InternetUnlockRequestFile failed: %u\n", GetLastError());
- }
Shouldn't we fix whatever's causing "lock2" to be NULL instead? Even with this patch we're still getting a test failure.