TWO errors at the same time when running UITests on a simulator on a M1 Max MacBook

I get two error windows at the same time when I try to run UITests using a simulator in the newest XCode Version 14.1 (14B47b):

  • Could not attach to PID
  • Problem report

Could not attach to pid : “3297”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: tried to attach to process already being debugged
User Info: {
  DVTErrorCreationDateKey = "2022-11-03 00:53:03 +0000";
  DVTRadarComponentKey = 855031;
  IDERunOperationFailingWorker = DBGLLDBLauncher;
  RawUnderlyingErrorMessage = "tried to attach to process already being debugged";
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
  "device_model" = "iPhone15,2";
  "device_osBuild" = "16.1 (20B72)";
  "device_platform" = "com.apple.platform.iphonesimulator";
  "launchSession_schemeCommand" = Test;
  "launchSession_state" = 1;
  "launchSession_targetArch" = "x86_64";
  "operation_duration_ms" = 37573;
  "operation_errorCode" = 3;
  "operation_errorDomain" = IDEDebugSessionErrorDomain;
  "operation_errorWorker" = DBGLLDBLauncher;
  "operation_name" = IDERunOperationWorkerGroup;
  "param_consoleMode" = 0;
  "param_debugger_attachToExtensions" = 0;
  "param_debugger_attachToXPC" = 1;
  "param_debugger_type" = 3;
  "param_destination_isProxy" = 0;
  "param_destination_platform" = "com.apple.platform.iphonesimulator";
  "param_diag_MainThreadChecker_stopOnIssue" = 0;
  "param_diag_MallocStackLogging_enableDuringAttach" = 0;
  "param_diag_MallocStackLogging_enableForXPC" = 0;
  "param_diag_allowLocationSimulation" = 1;
  "param_diag_checker_tpc_enable" = 0;
  "param_diag_gpu_frameCapture_enable" = 3;
  "param_diag_gpu_shaderValidation_enable" = 0;
  "param_diag_gpu_validation_enable" = 1;
  "param_diag_memoryGraphOnResourceException" = 0;
  "param_diag_queueDebugging_enable" = 1;
  "param_diag_runtimeProfile_generate" = 0;
  "param_diag_sanitizer_asan_enable" = 0;
  "param_diag_sanitizer_tsan_enable" = 0;
  "param_diag_sanitizer_tsan_stopOnIssue" = 0;
  "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
  "param_diag_showNonLocalizedStrings" = 0;
  "param_diag_viewDebugging_enabled" = 1;
  "param_diag_viewDebugging_insertDylibOnLaunch" = 0;
  "param_install_style" = 2;
  "param_launcher_UID" = 2;
  "param_launcher_allowDeviceSensorReplayData" = 0;
  "param_launcher_kind" = 0;
  "param_launcher_style" = 0;
  "param_launcher_substyle" = 64;
  "param_runnable_appExtensionHostRunMode" = 0;
  "param_runnable_productType" = "com.apple.product-type.application";
  "param_runnable_type" = 1;
  "param_testing_launchedForTesting" = 1;
  "param_testing_suppressSimulatorApp" = 0;
  "param_testing_usingCLI" = 0;
  "sdk_canonicalName" = "iphonesimulator16.1";
  "sdk_osVersion" = "16.1";
  "sdk_variant" = iphonesimulator;
}
--


System Information

macOS Version 13.0 (Build 22A380)
Xcode 14.1 (21534.1) (Build 14B47b)
Timestamp: 2022-11-02T20:53:03-04:00

. . .

This has been happening consistently. When I proceed to try and "Device" ==> "erase all contents and settings" on the Simulator, I get another error "Simulator quit unexpectedly":

Overal, my development experience on my M1 Max has been very miserable. I've been having major issues on two separate M1 Max machines with fresh OS installs. I would appreciate

I had to break up my post into several parts due to character limitation. This is the second error window that occurs at the same time (the "problem report):

. .

.


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

Incident Identifier: 0FCF082A-B9CE-416C-BF4D-DC56572E5CBB
CrashReporter Key:  57C7BCFB-E241-3415-50BC-BB99CE32424F
Hardware Model:   MacBookPro18,2
Process:       KeychainCheckUITests-Runner [3297]
Path:        /Users/USER/Library/Developer/CoreSimulator/Devices/94068210-721D-4700-8F54-F39E8686BF53/data/Containers/Bundle/Application/74412165-51F5-4F2F-B13B-DA79FD1D66B0/KeychainCheckUITests-Runner.app/KeychainCheckUITests-Runner
Identifier:     com.microsoft.KeychainCheckUITests.xctrunner
Version:       1.0 (1)
Code Type:      X86-64 (Native)
Role:        unknown
Parent Process:   launchd_sim [3091]
Coalition:      com.apple.CoreSimulator.SimDevice.94068210-721D-4700-8F54-F39E8686BF53 [4058]
Responsible Process: SimulatorTrampoline [1631]

Date/Time:      2022-11-02 20:53:02.1860 -0400
Launch Time:     2022-11-02 20:52:27.4771 -0400
OS Version:     macOS 13.0 (22A380)
Release Type:    User
Report Version:   104

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010208d000
Termination Reason: SIGNAL 9 Killed: 9
Terminating Process: debugserver [3315]

Highlighted by Thread: 0

Backtrace not available

No thread state (register information) available

Binary Images:
Binary images description not available

Error Formulating Crash Report:
_dyld_process_info_create failed with 30
dyld_process_snapshot_get_shared_cache failed
Failed to create CSSymbolicatorRef - corpse still valid ¯\_(ツ)_/¯
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

EOF

-----------
Full Report
-----------

{"app_name":"KeychainCheckUITests-Runner","timestamp":"2022-11-02 20:53:05.00 -0400","app_version":"1.0","slice_uuid":"1d92ff91-9d63-3823-b234-f1f9f8eed821","build_version":"1","platform":0,"bundleID":"com.microsoft.KeychainCheckUITests.xctrunner","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 13.0 (22A380)","roots_installed":0,"name":"KeychainCheckUITests-Runner","incident_id":"0FCF082A-B9CE-416C-BF4D-DC56572E5CBB"}
{
 "uptime" : 25000,
 "procRole" : "unknown",
 "version" : 2,
 "userID" : 501,
 "deployVersion" : 210,
 "modelCode" : "MacBookPro18,2",
 "coalitionID" : 4058,
 "osVersion" : {
  "train" : "macOS 13.0",
  "build" : "22A380",
  "releaseType" : "User"
 },
 "captureTime" : "2022-11-02 20:53:02.1860 -0400",
 "incident" : "0FCF082A-B9CE-416C-BF4D-DC56572E5CBB",
 "pid" : 3297,
 "translated" : true,
 "cpuType" : "X86-64",
 "roots_installed" : 0,
 "bug_type" : "309",
 "procLaunch" : "2022-11-02 20:52:27.4771 -0400",
 "procStartAbsTime" : 604003190588,
 "procExitAbsTime" : 604836127658,
 "procName" : "KeychainCheckUITests-Runner",
 "procPath" : "\/Users\/USER\/Library\/Developer\/CoreSimulator\/Devices\/94068210-721D-4700-8F54-F39E8686BF53\/data\/Containers\/Bundle\/Application\/74412165-51F5-4F2F-B13B-DA79FD1D66B0\/KeychainCheckUITests-Runner.app\/KeychainCheckUITests-Runner",
 "bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1","CFBundleIdentifier":"com.microsoft.KeychainCheckUITests.xctrunner"},
 "storeInfo" : {"deviceIdentifierForVendor":"0156C530-D344-5621-8653-6573532E2796","thirdParty":true},
 "parentProc" : "launchd_sim",
 "parentPid" : 3091,
 "coalitionName" : "com.apple.CoreSimulator.SimDevice.94068210-721D-4700-8F54-F39E8686BF53",
 "crashReporterKey" : "57C7BCFB-E241-3415-50BC-BB99CE32424F",
 "responsiblePid" : 1631,
 "responsibleProc" : "SimulatorTrampoline",
 "wakeTime" : 1270,
 "sleepWakeUUID" : "13492C6C-B11A-4DBB-AE79-19A4F6B459A5",
 "sip" : "enabled",
 "exception" : {"codes":"0x0000000000000001, 0x000000010208d000","rawCodes":[1,4329099264],"type":"EXC_BREAKPOINT","signal":"SIGTRAP"},
 "termination" : {"flags":0,"code":9,"namespace":"SIGNAL","indicator":"Killed: 9","byProc":"debugserver","byPid":3315},
 "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":6,"task_for_pid":10},"targeted":{"thread_create":0,"thread_set_state":1,"task_for_pid":1},"warnings":1},
 "legacyInfo" : {
 "threadHighlighted" : 0
},
 "trialInfo" : {
 "rollouts" : [
  {
   "rolloutId" : "61fd92db295c182621ececc3",
   "factorPackIds" : {

   },
   "deploymentId" : 240000201
  },
  {
   "rolloutId" : "6112d17137f5d11121dcd4e2",
   "factorPackIds" : {

   },
   "deploymentId" : 240000147
  }
 ],
 "experiments" : [

 ]
},
 "reportNotes" : [
 "_dyld_process_info_create failed with 30",
 "dyld_process_snapshot_get_shared_cache failed",
 "Failed to create CSSymbolicatorRef - corpse still valid ¯\\_(ツ)_\/¯",
 "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"
]
}

Model: MacBookPro18,2, BootROM 8419.41.10, proc 10:8:2 processors, 32 GB, SMC 
Graphics: Apple M1 Max, Apple M1 Max, Built-In
Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online
Memory Module: LPDDR5, Samsung
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x4387), wl0: Sep 3 2022 02:35:52 version 20.10.965.9.8.7.129 FWID 01-b0e84a9b
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Network Service: iPhone, Ethernet, en7
USB Device: USB31Bus
USB Device: USB31Bus
USB Device: USB31Bus
USB Device: iPhone
Thunderbolt Bus: Laptop, Apple Inc.
Thunderbolt Bus: Laptop, Apple Inc.
Thunderbolt Bus: Laptop, Apple Inc.

And this is the "simulator quit unexpectedly" error report: Too big to display inside the post.

I suspect that all of these problems are fallout from the simulator crashing. It’s not supposed to do that )-:

Looking at the crash report you posted it seems that the simulator has crashed itself by calling abort. The backtrace of the crash is this:

Thread 4 Crashed::  Dispatch queue: ROCKSessionManager.instancesQueue.412FFC16-C822-4E67-8861-18DD0DC317C3
0  libsystem_kernel.dylib  … __pthread_kill + 8
1  libsystem_pthread.dylib … pthread_kill + 288
2  libsystem_c.dylib       … abort + 180
3  libsystem_malloc.dylib  … malloc_vreport + 908
4  libsystem_malloc.dylib  … malloc_zone_error + 100
5  libsystem_malloc.dylib  … tiny_free_list_remove_ptr + 492
6  libsystem_malloc.dylib  … tiny_free_no_lock + 836
7  libsystem_malloc.dylib  … free_tiny + 496
8  Foundation              … NSNextMapEnumeratorPair + 132
9  ROCKit                  … __rock_ROCKSessionManagerForwardingProxyForInstance_block_invoke + 56
10 libdispatch.dylib       … _dispatch_client_callout + 20
…

Some ROCKit (frame 9), an Apple private framework, is working with an NSMapTable (frame 8) which is freeing memory (frame 7) which has detected a memory corruption problem and called abort.

We’ve seen similar reports to this (r. 95796979) but I’ve no info to share as to what might be triggering them.

Regardless of what else you do here, I encourage you to file a bug about this. Make sure to attach a sysdiagnose log taken shortly after triggering the problem.

Please post your bug number, just for the record.

How reproducible is this for you?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

TWO errors at the same time when running UITests on a simulator on a M1 Max MacBook
 
 
Q