haikuwebkit/LayoutTests/ipc/analytics-logger-crash.html

20 lines
821 B
HTML
Raw Permalink Normal View History

[CoreIPC] Crash in logDiagnosticMessage code https://bugs.webkit.org/show_bug.cgi?id=224390 Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-04-12 Reviewed by Chris Dumez. Source/WebKit: Create new WebPageProxy::logDiagnosticMessage APIs designed to be called on messages that need sanity checking, and hook that up to IPC handlers (while leaving existing APIs for all other callers). Test: ipc/analytics-logger-crash.html * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::logDiagnosticMessageWithValue): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::logDiagnosticMessageFromWebProcess): (WebKit::ProvisionalPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess): (WebKit::ProvisionalPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess): (WebKit::ProvisionalPageProxy::didReceiveMessage): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::logDiagnosticMessageFromWebProcess): (WebKit::WebPageProxy::logDiagnosticMessageWithResultFromWebProcess): (WebKit::WebPageProxy::logDiagnosticMessageWithValueFromWebProcess): (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacyFromWebProcess): (WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionaryFromWebProcess): (WebKit::WebPageProxy::logDiagnosticMessageWithDomainFromWebProcess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary): (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithDomain): LayoutTests: Add a test for this crasher. * ipc/analytics-logger-crash-expected.txt: Added. * ipc/analytics-logger-crash.html: Added. Canonical link: https://commits.webkit.org/236426@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-13 04:57:38 +00:00
<!DOCTYPE html><!-- webkit-test-runner [ IPCTestingAPIEnabled=true ] -->
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
if (window.IPC) {
buf = new Uint8Array([0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0x0,
0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0xfb,0x20,0x0,0x0,0x0,
0x0,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x21,0xda,0xe,0xef,0xd,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0x0,0x21,
0x0,0x0,0x0,0x0,0x0,0x21,0x1,0x0,0x0,0x0,0x0,0x0,0x21,0x0,0x0,0x0,0x0,0x0,0x21,0x0,0x0,0x0,]);
IPC.sendMessage('UI',IPC.webPageProxyID,IPC.messages.WebPageProxy_LogDiagnosticMessageWithValueFromWebProcess.name,[buf]);
}
</script>
<body>
This test passes if it does not crash.
</body>
</head>
</html>