Transient Error IOAccelSysMemory::wire(): memory <private> failed to prepare

While launching a VM using the Virtualization framework, it transiently exhibits the following behavior:

Start the VM, runs the completion handler, and immediately after, the VM exits with the following error:

Error Domain=VZErrorDomain Code=1 "The virtual machine stopped unexpectedly." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=The virtual machine stopped unexpectedly.}

Inspecting the Console logs, 302 of those logs messages can be found (for a single VM crash):

virtual bool IOAccelSysMemory::wire(): memory failed to prepare. Error 0x1

This actually appears to be happening only when the Console is unpaused ? And the virtual bool IOAccelSysMemory::wire() error is not there every time, i can see some of:

EXC_GUARD code zero: 0x1E03 -> 0x2000008000001E03

Sending event: com.apple.stability.crash {"bundleID":"com.apple.Virtualization.VirtualMachine","bundleVersion":"59.6","exceptionCodes":"7683SIGKILL00x0000000000001e03, 0x0000000000000000(\n  "MSG_FILTERED"\n) MSG_FILTERED on mach port 7683 (guarded with 0x0000000000000000)GUARD_TYPE_MACH_PORTEXC_GUARD(\n  7683,\n  0\n)","incidentID":"0A3175A0-11BC-4B7F-9ECA-92FE0E9A4304","logwritten":0,"process":"com.apple.Virtualization.VirtualMachine","responsibleApp":"xxx","terminationReasonExceptionCode":"0x2000008000001e03","terminationReasonNamespace":"GUARD"}

Looking at the crash report of the VM, an XPC Send seems to be the culprit

Crashed Thread: 4 Dispatch queue: com.apple.CoreAnalytics::Client XPC Send

Here is the relevant details from the crash log


-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               com.apple.Virtualization.VirtualMachine [49929]
Path:                  /System/Library/Frameworks/Virtualization.framework/Versions/A/XPCServices/com.apple.Virtualization.VirtualMachine.xpc/Contents/MacOS/com.apple.Virtualization.VirtualMachine
Identifier:            com.apple.Virtualization.VirtualMachine
Version:               1.0 (59.6)
Build Info:            Virtualization-59006000000000~7
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
Responsible:           zetoclient [49918]
User ID:               501

Date/Time:             2022-02-09 16:26:07.3946 +0100
OS Version:            macOS 12.2 (21D49)
Report Version:        12
Bridge OS Version:     6.2 (19P744)
Anonymous UUID:        DAF1083D-2341-07AB-93D6-ACE3152566FB


Time Awake Since Boot: 14000 seconds

System Integrity Protection: enabled

Notes:
thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port
thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port
thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port

Crashed Thread:        3  Dispatch queue: com.apple.CoreAnalytics::Client XPC Send

Exception Type:        EXC_GUARD (SIGKILL)
Exception Codes:       GUARD_TYPE_MACH_PORT
Exception Codes:       0x0000000000001e03, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace GUARD, Code 2305843558969515523 

Application Specific Information:
Generic Platform


Error Formulating Crash Report:
thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port
thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port
thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port

Thread 3 Crashed::  Dispatch queue: com.apple.CoreAnalytics::Client XPC Send
0   libsystem_kernel.dylib        	    0x7ff80eacaaba mach_msg_trap + 10
1   libsystem_kernel.dylib        	    0x7ff80eacae2b mach_msg + 59
2   libdispatch.dylib             	    0x7ff80e96c005 _dispatch_mach_msg_send + 986
3   libdispatch.dylib             	    0x7ff80e96c3d2 _dispatch_mach_msg_send + 1959
4   libdispatch.dylib             	    0x7ff80e96b7ef _dispatch_mach_send_drain + 340
5   libdispatch.dylib             	    0x7ff80e968275 _dispatch_mach_send_msg + 318
6   libdispatch.dylib             	    0x7ff80e968337 dispatch_mach_send_with_result + 49
7   libxpc.dylib                  	    0x7ff80e84bd31 _xpc_connection_enqueue + 152
8   libxpc.dylib                  	    0x7ff80e84bc60 xpc_connection_send_message + 89
9   CoreAnalytics                 	    0x7ff8154a09d8 invocation function for block in CoreAnalytics::Client::sendXpcMessage_sync(applesauce::xpc::dict, XPCMessagePriority) const + 144
10  libdispatch.dylib             	    0x7ff80e95dd0d _dispatch_block_async_invoke2 + 83
11  libdispatch.dylib             	    0x7ff80e950cc9 _dispatch_client_callout + 8
12  libdispatch.dylib             	    0x7ff80e956cee _dispatch_lane_serial_drain + 696
13  libdispatch.dylib             	    0x7ff80e9577c8 _dispatch_lane_invoke + 366
14  libdispatch.dylib             	    0x7ff80e9617e1 _dispatch_workloop_worker_thread + 758
15  libsystem_pthread.dylib       	    0x7ff80eb04074 _pthread_wqthread + 326
16  libsystem_pthread.dylib       	    0x7ff80eb02ffb start_wqthread + 15


Thanks for including the details from the crash logs.

It is not obvious from the logs what could have caused that. It would be useful to have all the logs in context. Could you please file a full report with the Feedback Assistant?

If you can share steps to reproduce, this could also be valuable to understand the problem.

Filed: FB9895344

Transient Error IOAccelSysMemory::wire(): memory &lt;private&gt; failed to prepare
 
 
Q