Description
idb xctest list-bundle
results in error below on my Intel PC:
Process 98630 (xctest) died with signal 9
I found that xctest crashes and it put a crashlog like this:
{"app_name":"xctest","timestamp":"2022-12-20 09:34:58.00 +0000","app_version":"","slice_uuid":"364c0633-c61f-314e-b6ba-c8fedc30b808","build_version":"","platform":7,"share_with_app_devs":0,"is_first_party":
1,"bug_type":"309","os_version":"macOS 12.6.2 (21G320)","incident_id":"C3C3F0D6-E17A-46F8-BF2A-D39916978DD2","name":"xctest"}
{
"uptime" : 880,
"procLaunch" : "2022-12-20 09:34:57.1007 +0000",
"procRole" : "Unspecified",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "VMware7,1",
"procStartAbsTime" : 887364287690,
"coalitionID" : 1765,
"osVersion" : {
"train" : "macOS 12.6.2",
"build" : "21G320",
"releaseType" : "User"
},
"captureTime" : "2022-12-20 09:34:57.1771 +0000",
"incident" : "C3C3F0D6-E17A-46F8-BF2A-D39916978DD2",
"bug_type" : "309",
"pid" : 7878,
"procExitAbsTime" : 887437853417,
"cpuType" : "X86-64",
"procName" : "xctest",
"procPath" : "\/Applications\/Xcode_14.0.1.app\/Contents\/Developer\/Platforms\/iPhoneSimulator.platform\/Developer\/Library\/Xcode\/Agents\/xctest",
"parentProc" : "launchd_sim",
"parentPid" : 5912,
"coalitionName" : "com.apple.CoreSimulator.SimDevice.578EF79A-34A9-405C-A600-0B901BA4624D",
"crashReporterKey" : "28C488D7-2871-0137-7EA3-2D329D89124C",
"responsiblePid" : 1668,
"responsibleProc" : "SimulatorTrampoline",
"sip" : "enabled",
"vmRegionInfo" : "0x10bbba000 is in 0x10bbba000-0x10bbc2000; bytes after start: 0 bytes before end: 32767\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAI
L\n mapped file 10bb84000-10bbba000 [ 216K] r--\/rwx SM=COW ...t_id=beb8b55d\n---> mapped file 10bbba000-10bbc2000 [ 32K] r-x\/rwx SM=COW ...t_id=beb8b55d\n
VM_ALLOCATE (reserved) 10bbc2000-10bbd2000 [ 64K] rw-\/rwx SM=NUL ...(unallocated)",
"isCorpse" : 1,
"exception" : {"codes":"0x0000000000000032, 0x000000010bbba000","rawCodes":[50,4491812864],"type":"EXC_BAD_ACCESS","signal":"SIGKILL (Code Signature Invalid)","subtype":"UNKNOWN_0x32 at 0x000000010bbba000
"},
"termination" : {"namespace":"CODESIGNING","flags":0,"code":2},
"vmregioninfo" : "0x10bbba000 is in 0x10bbba000-0x10bbc2000; bytes after start: 0 bytes before end: 32767\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n mapped file 10bb84000-10bbba000 [ 216K] r--\/rwx SM=COW ...t_id=beb8b55d\n---> mapped file 10bbba000-10bbc2000 [ 32K] r-x\/rwx SM=COW ...t_id=beb8b55d\n VM_ALLOCATE (reserved) 10bbc2000-10bbd2000 [ 64K] rw-\/rwx SM=NUL ...(unallocated)",
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":26716,"instructionState":{"instructionStream":{"bytes":[12,117,5,184,255,63,0,0,68,133,232,116,33,72,141,53,37,203,2,0,186,7,0,0,0,72,137,223,232,101,40,1,0,133,192,116,13,72,141,53,44,203,2,0,235,11,179,1,235,152,72,141,53,8,203,2,0,49,219,76,137,247,49,192,232,181,6,1,0,235,131,144,85,72,137,229,83,80,72,137,243,72,131,250,27,119,9,72,141,53,37,205,2,0,235,70,139,7,137,193,131,225,254,129,249,206,250,237,254,117,36,139,79,20,49,246,61,207,250,237,254,64,15,148,198,72,141,4,177,72,131,192,28,72,57,208,118,47,72,141,53,58,205,2,0,235,19,37,255,255,255,254,61,254,237,250,206,116,17,72,141,53,254,204,2,0,72,137,223,49,192,232,74,6,1,0,49,192,72,131,196,8,91,93,195,72,141,21,226,42,3,0],"offset":96}},"threadState":{"r13":{"value":4491812864},"rax":{"value":4572894892,"symbolLocation":172,"symbol":"_main_thread"},"rflags":{"value":66066},"cpu":{"value":0},"r14":{"value":140701858581008},"rsi":{"value":140701858582960},"r8":{"value":3},"cr2":{"value":4491812864},"rdx":{"value":32768},"r10":{"value":262162},"r9":{"value":16384},"r15":{"value":0},"rbx":{"value":140701858582960},"trap":{"value":14,"description":"(no mapping for user data read)"},"err":{"value":4},"r11":{"value":518},"rip":{"value":4492732286,"matchesCrashFrame":1},"rbp":{"value":140701858580032},"rsp":{"value":140701858580016},"r12":{"value":98304},"rcx":{"value":4572894892,"symbolLocation":172,"symbol":"_main_thread"},"flavor":"x86_THREAD_STATE","rdi":{"value":4491812864}},"frames":[{"imageOffset":194430,"symbol":"dyld3::MachOFile::isMachO(Diagnostics&, unsigned long long) const","symbolLocation":24,"imageIndex":0},{"imageOffset":68331,"symbol":"dyld4::Loader::mapSegments(Diagnostics&, dyld4::RuntimeState&, char const*, unsigned long long, dyld4::Loader::CodeSignatureInFile const&, bool, dyld3::Array<dyld4::Loader::Region> const&, bool, bool, dyld4::Loader::FileValidationInfo const&)","symbolLocation":1267,"imageIndex":0},{"imageOffset":95615,"symbol":"invocation function for block in dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*)","symbolLocation":84,"imageIndex":0},{"imageOffset":93887,"symbol":"dyld4::JustInTimeLoader::withRegions(dyld3::MachOFile const*, void (dyld3::Array<dyld4::Loader::Region> const&) block_pointer)","symbolLocation":221,"imageIndex":0},{"imageOffset":95352,"symbol":"invocation function for block in dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*)","symbolLocation":509,"imageIndex":0},{"imageOffset":111822,"symbol":"dyld4::SyscallDelegate::withReadOnlyMappedFile(Diagnostics&, char const*, bool, void (void const*, unsigned long, bool, dyld4::FileID const&, char const*) block_pointer) const","symbolLocation":144,"imageIndex":0},{"imageOffset":94800,"symbol":"dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*)","symbolLocation":198,"imageIndex":0},{"imageOffset":65360,"symbol":"invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)","symbolLocation":2136,"imageIndex":0},{"imageOffset":61590,"symbol":"dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":606,"imageIndex":0},{"imageOffset":22671,"symbol":"dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const","symbolLocation":801,"imageIndex":0},{"imageOffset":60599,"symbol":"dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":251,"imageIndex":0},{"imageOffset":62459,"symbol":"dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)","symbolLocation":827,"imageIndex":0},{"imageOffset":9969,"symbol":"invocation function for block in dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":52,"imageIndex":0},{"imageOffset":19641,"symbol":"dyld4::ProcessConfig::PathOverrides::forEachInColonList(char const*, char const*, bool&, void (char const*, bool&) block_pointer)","symbolLocation":189,"imageIndex":0},{"imageOffset":20349,"symbol":"dyld4::ProcessConfig::PathOverrides::forEachInsertedDylib(void (char const*, bool&) block_pointer) const","symbolLocation":119,"imageIndex":0},{"imageOffset":4961,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":836,"imageIndex":0},{"imageOffset":8608,"symbol":"_dyld_sim_prepare","symbolLocation":442,"imageIndex":0},{"imageOffset":27512,"symbol":"dyld4::prepareSim(dyld4::RuntimeState&, char const*)","symbolLocation":1265,"imageIndex":1},{"imageOffset":22286,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":244,"imageIndex":1},{"imageOffset":21732,"symbol":"start","symbolLocation":388,"imageIndex":1}]}],
"usedImages" : [
{
"source" : "P",
"arch" : "x86_64",
"base" : 4492537856,
"size" : 393216,
"uuid" : "db2ea9eb-03d5-3b81-a6ce-26ec4dd81b07",
"path" : "\/Applications\/Xcode_14.0.1.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/dyld_sim",
"name" : "dyld_sim"
},
{
"source" : "P",
"arch" : "x86_64",
"base" : 4572368896,
"size" : 442368,
"uuid" : "b53641ea-6cd4-39c9-9b14-59c92cfd9584",
"path" : "\/usr\/lib\/dyld",
"name" : "dyld"
},
{
"size" : 0,
"source" : "A",
"base" : 0,
"uuid" : "00000000-0000-0000-0000-000000000000"
}
...
Reproduction
I use this app but I checked that this happens with the other apps as well.
xcrun simctl install booted ./XCTesterAppUITests-Runner.app
idb xctest install --udid $udid ./XCTesterAppUITests-Runner.app/PlugIns/XCTesterAppUITests.xctest
idb xctest list-bundle --udid $udid io.appium.XCTesterAppUITests
It works well on my M1 macbook, but doesn't work on my intel macbook and macos github acction runner.
I also confirmed that it works with idb 1.1.7. I use this commit version, it looks like 1.1.8 changed a way to install the binary. Also the binary I manually built from the source including both 1.1.8 and latest main branch don't have the problem.
Solution
I don't have an idea. Using 1.1.7 or building from the source worked to me.
Additional Information
idb
revision: only happens with homebrew version 1.1.8.