com.apple.WebKit.WebContent crash in WebKit::AuxiliaryProcess::didReceiveInvalidMessage

In Beta 2 of Ventura 13.1 (22C5044e) I'm seeing consistent WebKit crashes:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGKILL)
Exception Codes:       0x0000000000000001, 0x00000001aebfe8d0

Termination Reason:    Namespace PAC_EXCEPTION, Code 1 

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   JavaScriptCore                	       0x1aebfe8d0 WTFCrashWithInfoImpl(int, char const*, char const*, int, unsigned long long) + 4
1   WebKit                        	       0x1b53971dc WebKit::AuxiliaryProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::MessageName) + 612
2   WebKit                        	       0x1b55b4b74 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 1424
3   WebKit                        	       0x1b55b750c WTF::Detail::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_13, void>::call() + 188
4   JavaScriptCore                	       0x1aec3fb90 WTF::RunLoop::performWork() + 200
5   JavaScriptCore                	       0x1aec408c8 WTF::RunLoop::performWork(void*) + 36
6   CoreFoundation                	       0x195493a18 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
7   CoreFoundation                	       0x1954939ac __CFRunLoopDoSource0 + 176
8   CoreFoundation                	       0x19549371c __CFRunLoopDoSources0 + 244
9   CoreFoundation                	       0x195492320 __CFRunLoopRun + 836
10  CoreFoundation                	       0x195491888 CFRunLoopRunSpecific + 612
11  Foundation                    	       0x196399e58 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
12  Foundation                    	       0x196412cf0 -[NSRunLoop(NSRunLoop) run] + 64
13  libxpc.dylib                  	       0x19512f380 _xpc_objc_main + 860
14  libxpc.dylib                  	       0x19512eca0 xpc_main + 108
15  WebKit                        	       0x1b53c69ec WebKit::XPCServiceMain(int, char const**) + 256
16  dyld                          	       0x19508be50 start + 2544

This is happening in an x64 app which is using WKWebView, running on a M1 mac. I'm not sure what is causing this, but I suspect it may have something to do with using the JavaScript function:

					webkit.messageHandlers.javascriptToHost.postMessage();

Submitted as FB11786440 Anyone else seeing this?

Still happening in Beta 3 - I've narrowed it down a bit, it appears that any use of WkWebView in a x64 Intel app no longer functions on M1 / ARM macs: Instead, the WebKit process crashes.

A standalone ARM build, or a Universal Intel/Arm build work fine.

Apple: this is a very bad regression, any insight?

I have updated FB11786440 with an XCode sample project to illustrate the crash.

com.apple.WebKit.WebContent crash in WebKit::AuxiliaryProcess::didReceiveInvalidMessage
 
 
Q