Bug 287815

Summary: [curl] LibreSSL SSL_read: Connection closed abruptly, errno 0 (Fatal because this is a curl debug build)
Product: WebKit Reporter: Fujii Hironori <fujii.hironori>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal Keywords: DoNotImportToRadar
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
workaround patch for libcurl 8.12.1 none

Fujii Hironori
Reported 2025-02-17 13:11:37 PST
If I use a debug build of libcurl.dll, some https tests fail. For example, http/wpt/service-workers/check-service-worker-header.https.html [ Failure ] imported/w3c/web-platform-tests/cookies/secure/set-from-dom.https.sub.html [ Failure ] imported/w3c/web-platform-tests/urlpattern/urlpattern.https.any.worker.html [ Failure ] If I open https://localhost:9443/WebKit/service-workers/check-service-worker-header.https.html with Windows MiniBrowser, the following message was reported on the debug console. > LibreSSL SSL_read: Connection closed abruptly, errno 0 (Fatal because this is a curl debug build) To use a debug build of libcurl.dll, copy libcurl.dll and zlib1.dll from WebKitLibraries/win/debug/bin directory to WebKitLibraries/win/bin or WebKitBuild/Debug/bin directories. However, due to another libcurl bug bug#286788, libcurl is going to abort quickly now. You need to compile libcurl with the DEBUGASSERT(NULL) commented out.
Attachments
workaround patch for libcurl 8.12.1 (1.01 KB, patch)
2025-02-18 13:20 PST, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2025-02-17 14:23:14 PST
curl.exe also reports an error. > curl.exe -k https://localhost:9443/WebKit/service-workers/check-service-worker-header.https.html > (...) > curl: (56) Failure when receiving data from the peer
Fujii Hironori
Comment 3 2025-02-17 17:02:23 PST
CurlRequestScheduler::completeTransfer gets CURLE_OK with a release build of libcurl.dll, but CURLE_RECV_ERROR with a debug build.
Fujii Hironori
Comment 4 2025-02-17 23:55:24 PST
I use this patch to dump libcurl debug log to the debug console. diff --git a/Source/WebCore/platform/network/curl/CurlRequest.cpp b/Source/WebCore/platform/network/curl/CurlRequest.cpp index 950dbeadadf1..3f0dd3d0c481 100644 --- a/Source/WebCore/platform/network/curl/CurlRequest.cpp +++ b/Source/WebCore/platform/network/curl/CurlRequest.cpp @@ -512,6 +512,7 @@ int CurlRequest::didReceiveDebugInfo(curl_infotype type, std::span<const char> d { if (!data.data()) return 0; + OutputDebugStringA(data.data()); if (type == CURLINFO_HEADER_OUT) { String requestHeader(data);
Fujii Hironori
Comment 5 2025-02-18 13:20:54 PST
Created attachment 474276 [details] workaround patch for libcurl 8.12.1
Fujii Hironori
Comment 6 2025-02-18 15:52:08 PST
Run wpt server by invoking "python wpt.py serve" in another terminal. If I specify a pipe, the error doesn't happen. > PS C:\> curl --no-progress-meter -ko NUL https://web-platform.test:8443/acid/README.md > curl: (56) Failure when receiving data from the peer > PS C:\> curl --no-progress-meter -ko NUL https://web-platform.test:8443/acid/README.md?pipe=sub
Fujii Hironori
Comment 7 2025-02-18 16:17:28 PST
This is a workaround patch. diff --git a/LayoutTests/imported/w3c/web-platform-tests/tools/wptserve/wptserve/handlers.py b/LayoutTests/imported/w3c/web-platform-tests/tools/wptserve/wptserve/handlers.py index 62faf47d6456..5b302f03bb54 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/tools/wptserve/wptserve/handlers.py +++ b/LayoutTests/imported/w3c/web-platform-tests/tools/wptserve/wptserve/handlers.py @@ -243,7 +243,7 @@ class FileHandler: """Return either the handle to a file, or a string containing the content of a chunk of the file, if we have a range request.""" if byte_ranges is None: - return open(path, 'rb') + return open(path, 'rb').read() else: with open(path, 'rb') as f: response.status = 206
Note You need to log in before you can comment on or make changes to this bug.