[lldb/crashlog] Fix interactive crashlog test

This patch should fix the interactive crashlog test by checking in the
binary as a yaml to regeneate the binary with the addresses and offsets
when running the test.

rdar://93655633

Differential Revision: https://reviews.llvm.org/D129603

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
Med Ismail Bennani
2022-07-28 11:29:49 -07:00
parent cfefee87c2
commit 4c2fb2e551
5 changed files with 5013 additions and 458 deletions

View File

@@ -0,0 +1,483 @@
{"app_name":"multithread-test","timestamp":"2022-07-28 11:10:20.00 -0700","app_version":"","slice_uuid":"ab9b94f9-6cdf-3b8e-b140-fae3cb13d327","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 13.0","roots_installed":0,"incident_id":"5A0D8938-189E-4FD5-8C9F-02BD2C045BAF","name":"multithread-test"}
{
"bug_type": "309",
"captureTime": "2022-07-28 11:10:19.4194 -0700",
"coalitionID": 875,
"coalitionName": "com.apple.Terminal",
"cpuType": "ARM-64",
"crashReporterKey": "CDC11418-EDBF-2A49-0D83-8B441A5004B0",
"deployVersion": 210,
"exception": {
"codes": "0x0000000000000001, 0x0000000000000000",
"rawCodes": [
1,
0
],
"signal": "SIGSEGV",
"subtype": "KERN_INVALID_ADDRESS at 0x0000000000000000",
"type": "EXC_BAD_ACCESS"
},
"extMods": {
"caller": {
"task_for_pid": 0,
"thread_create": 0,
"thread_set_state": 0
},
"system": {
"task_for_pid": 23,
"thread_create": 0,
"thread_set_state": 812
},
"targeted": {
"task_for_pid": 0,
"thread_create": 0,
"thread_set_state": 0
},
"warnings": 0
},
"faultingThread": 2,
"incident": "5A0D8938-189E-4FD5-8C9F-02BD2C045BAF",
"legacyInfo": {
"threadTriggered": {}
},
"modelCode": "MacBookPro18,2",
"osVersion": {
"build": "",
"releaseType": "",
"train": "macOS 13.0"
},
"parentPid": 59146,
"parentProc": "zsh",
"pid": 22511,
"procExitAbsTime": 2823154294289,
"procLaunch": "2022-07-28 11:10:19.4122 -0700",
"procName": "multithread-test",
"procPath": "/Users/USER/*/multithread-test",
"procRole": "Unspecified",
"procStartAbsTime": 2823154159663,
"responsiblePid": 1640,
"responsibleProc": "Terminal",
"roots_installed": 0,
"sharedCache": {
"base": 6921912320,
"size": 3382837248,
"uuid": "fee93772-827d-31b1-bf36-d821401b6c11"
},
"sip": "disabled",
"sleepWakeUUID": "7B2A0D73-8966-4B8D-98E9-CC6EC1B44967",
"termination": {
"byPid": 22511,
"byProc": "exc handler",
"code": 11,
"flags": 0,
"indicator": "Segmentation fault: 11",
"namespace": "SIGNAL"
},
"threads": [
{
"frames": [
{
"imageIndex": 0,
"imageOffset": 11140,
"symbol": "__ulock_wait",
"symbolLocation": 8
},
{
"imageIndex": 1,
"imageOffset": 37780,
"symbol": "_pthread_join",
"symbolLocation": 444
},
{
"imageIndex": 2,
"imageOffset": 103028,
"symbol": "std::__1::thread::join()",
"symbolLocation": 36
},
{
"imageIndex": 3,
"imageOffset": 6972,
"sourceFile": "multithread-test.cpp",
"sourceLine": 31,
"symbol": "main",
"symbolLocation": 160
},
{
"imageIndex": 4,
"imageOffset": 23976,
"symbol": "start",
"symbolLocation": 2376
}
],
"id": 2344958,
"queue": "com.apple.main-thread"
},
{
"frames": [
{
"imageIndex": 0,
"imageOffset": 19612,
"symbol": "__write_nocancel",
"symbolLocation": 8
},
{
"imageIndex": 5,
"imageOffset": 211368,
"symbol": "__swrite",
"symbolLocation": 24
},
{
"imageIndex": 5,
"imageOffset": 76488,
"symbol": "_swrite",
"symbolLocation": 108
},
{
"imageIndex": 5,
"imageOffset": 68652,
"symbol": "__sflush",
"symbolLocation": 232
},
{
"imageIndex": 5,
"imageOffset": 20256,
"symbol": "__sfvwrite",
"symbolLocation": 792
},
{
"imageIndex": 5,
"imageOffset": 147300,
"symbol": "fwrite",
"symbolLocation": 152
},
{
"imageIndex": 2,
"imageOffset": 188548,
"symbol": "std::__1::__stdoutbuf<char>::overflow(int)",
"symbolLocation": 96
},
{
"imageIndex": 2,
"imageOffset": 136884,
"symbol": "std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >::operator=(char)",
"symbolLocation": 96
},
{
"imageIndex": 2,
"imageOffset": 137112,
"symbol": "std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)",
"symbolLocation": 200
},
{
"imageIndex": 3,
"imageOffset": 6740,
"sourceFile": "ostream",
"sourceLine": 994,
"symbol": "std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)",
"symbolLocation": 64
},
{
"imageIndex": 3,
"imageOffset": 6664,
"sourceFile": "ostream",
"sourceLine": 189,
"symbol": "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >& (*)(std::__1::basic_ostream<char, std::__1::char_traits<char> >&))",
"symbolLocation": 32
},
{
"imageIndex": 3,
"imageOffset": 6488,
"sourceFile": "multithread-test.cpp",
"sourceLine": 14,
"symbol": "call_and_wait(int&)",
"symbolLocation": 48
},
{
"imageIndex": 3,
"imageOffset": 13956,
"sourceFile": "type_traits",
"sourceLine": 3918,
"symbol": "decltype(static_cast<void (*>(fp)(static_cast<std::__1::reference_wrapper<int>>(fp0))) std::__1::__invoke<void (*)(int&), std::__1::reference_wrapper<int> >(void (*&&)(int&), std::__1::reference_wrapper<int>&&)",
"symbolLocation": 48
},
{
"imageIndex": 3,
"imageOffset": 13832,
"sourceFile": "thread",
"sourceLine": 287,
"symbol": "void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int>, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> >&, std::__1::__tuple_indices<2ul>)",
"symbolLocation": 56
},
{
"imageIndex": 3,
"imageOffset": 11608,
"sourceFile": "thread",
"sourceLine": 298,
"symbol": "void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> > >(void*)",
"symbolLocation": 84
},
{
"imageIndex": 1,
"imageOffset": 28780,
"symbol": "_pthread_start",
"symbolLocation": 148
},
{
"imageIndex": 1,
"imageOffset": 7724,
"symbol": "thread_start",
"symbolLocation": 8
}
],
"id": 2344960
},
{
"frames": [
{
"imageIndex": 3,
"imageOffset": 6388,
"sourceFile": "multithread-test.cpp",
"sourceLine": 7,
"symbol": "bar(int)",
"symbolLocation": 20
},
{
"imageIndex": 3,
"imageOffset": 6428,
"sourceFile": "multithread-test.cpp",
"sourceLine": 11,
"symbol": "foo(int)",
"symbolLocation": 24
},
{
"imageIndex": 3,
"imageOffset": 6792,
"sourceFile": "multithread-test.cpp",
"sourceLine": 20,
"symbol": "compute_pow(int&)",
"symbolLocation": 28
},
{
"imageIndex": 3,
"imageOffset": 13956,
"sourceFile": "type_traits",
"sourceLine": 3918,
"symbol": "decltype(static_cast<void (*>(fp)(static_cast<std::__1::reference_wrapper<int>>(fp0))) std::__1::__invoke<void (*)(int&), std::__1::reference_wrapper<int> >(void (*&&)(int&), std::__1::reference_wrapper<int>&&)",
"symbolLocation": 48
},
{
"imageIndex": 3,
"imageOffset": 13832,
"sourceFile": "thread",
"sourceLine": 287,
"symbol": "void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int>, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> >&, std::__1::__tuple_indices<2ul>)",
"symbolLocation": 56
},
{
"imageIndex": 3,
"imageOffset": 11608,
"sourceFile": "thread",
"sourceLine": 298,
"symbol": "void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> > >(void*)",
"symbolLocation": 84
},
{
"imageIndex": 1,
"imageOffset": 28780,
"symbol": "_pthread_start",
"symbolLocation": 148
},
{
"imageIndex": 1,
"imageOffset": 7724,
"symbol": "thread_start",
"symbolLocation": 8
}
],
"id": 2344961,
"threadState": {
"cpsr": {
"value": 2147487744
},
"esr": {
"description": "(Data Abort) byte write Translation fault",
"value": 2449473606
},
"far": {
"value": 0
},
"flavor": "ARM_THREAD_STATE64",
"fp": {
"value": 6157561600
},
"lr": {
"value": 4310456604
},
"pc": {
"matchesCrashFrame": 1,
"value": 4310456564
},
"sp": {
"value": 6157561568
},
"x": [
{
"value": 42
},
{
"value": 105553146843568
},
{
"value": 6924529664
},
{
"value": 0
},
{
"value": 12448
},
{
"value": 419432703
},
{
"value": 0
},
{
"value": 0
},
{
"value": 1
},
{
"value": 0
},
{
"value": 18446744066784917455
},
{
"value": 1099511628034
},
{
"value": 1099511628034
},
{
"value": 1099511628032
},
{
"value": 1099511627776
},
{
"value": 1
},
{
"symbol": "pthread_setspecific",
"symbolLocation": 0,
"value": 6925291176
},
{
"value": 8540288664
},
{
"value": 0
},
{
"value": 6157561856
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
}
]
},
"triggered": true
}
],
"translated": false,
"trialInfo": {},
"uptime": 110000,
"usedImages": [
{
"arch": "arm64e",
"base": 6925049856,
"name": "libsystem_kernel.dylib",
"path": "/usr/lib/system/libsystem_kernel.dylib",
"size": 233452,
"source": "P",
"uuid": "b8898079-5424-3e89-92b0-33022c3be1bb"
},
{
"arch": "arm64e",
"base": 6925283328,
"name": "libsystem_pthread.dylib",
"path": "/usr/lib/system/libsystem_pthread.dylib",
"size": 53244,
"source": "P",
"uuid": "ffd36328-45f2-31c5-9240-9f76f26a1a2b"
},
{
"arch": "arm64e",
"base": 6924529664,
"name": "libc++.1.dylib",
"path": "/usr/lib/libc++.1.dylib",
"size": 421876,
"source": "P",
"uuid": "da619b87-2723-3731-919a-bb3467eab9e1"
},
{
"arch": "arm64",
"base": 4310450176,
"name": "multithread-test",
"path": "/Users/USER/*/multithread-test",
"size": 16384,
"source": "P",
"uuid": "ab9b94f9-6cdf-3b8e-b140-fae3cb13d327"
},
{
"arch": "arm64e",
"base": 9178132480,
"name": "dyld",
"path": "/usr/lib/dyld",
"size": 560716,
"source": "P",
"uuid": "e81312a0-f3e5-3c60-8c25-4599b62b8b4a"
},
{
"arch": "arm64e",
"base": 6924001280,
"name": "libsystem_c.dylib",
"path": "/usr/lib/system/libsystem_c.dylib",
"size": 528384,
"source": "P",
"uuid": "b8f1c3ed-9048-34a6-8070-6c18d4ade541"
}
],
"userID": 501,
"version": 2,
"vmRegionInfo": "0 is not in any region. Bytes before following region: 4310450176\n REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 100ec4000-100ec8000 [ 16K] r-x/r-x SM=COW ...tithread-test",
"vmSummary": "ReadOnly portion of Libraries: Total=762.9M resident=0K(0%) swapped_out_or_unallocated=762.9M(100%)\nWritable regions: Total=538.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=538.2M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nKernel Alloc Once 32K 1 \nMALLOC 145.2M 12 \nMALLOC guard page 96K 5 \nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.0M 3 \nStack 9264K 3 \n__AUTH 46K 11 \n__AUTH_CONST 70K 38 \n__DATA 169K 36 \n__DATA_CONST 187K 40 \n__DATA_DIRTY 78K 22 \n__LINKEDIT 758.0M 2 \n__OBJC_CONST 11K 5 \n__OBJC_RO 64.7M 1 \n__OBJC_RW 1971K 1 \n__TEXT 5076K 42 \ndyld private memory 256K 1 \nshared memory 64K 3 \n=========== ======= ======= \nTOTAL 1.4G 227 \nTOTAL, minus reserved VM space 1.0G 227 \n",
"vmregioninfo": "0 is not in any region. Bytes before following region: 4310450176\n REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 100ec4000-100ec8000 [ 16K] r-x/r-x SM=COW ...tithread-test",
"wakeTime": 214
}

File diff suppressed because one or more lines are too long

View File

@@ -1,412 +0,0 @@
{"app_name":"@NAME@","timestamp":"2022-03-16 11:08:51.00 -0700","app_version":"","slice_uuid":"7166a382-172b-31ff-a821-66dee303ab6c","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.3","incident_id":"82B79418-50CC-4672-982A-46A9D8C159B6","name":"@NAME@"}
{
"bug_type": "309",
"captureTime": "2022-03-16 11:08:51.2579 -0700",
"coalitionID": 33758,
"coalitionName": "com.apple.Terminal",
"cpuType": "ARM-64",
"crashReporterKey": "CDC11418-EDBF-2A49-0D83-8B441A5004B0",
"deployVersion": 210,
"exception": {
"codes": "0x0000000000000001, 0x0000000000000000",
"rawCodes": [
1,
0
],
"signal": "SIGSEGV",
"subtype": "KERN_INVALID_ADDRESS at 0x0000000000000000",
"type": "EXC_BAD_ACCESS"
},
"extMods": {
"caller": {
"task_for_pid": 0,
"thread_create": 0,
"thread_set_state": 0
},
"system": {
"task_for_pid": 32,
"thread_create": 11,
"thread_set_state": 1052
},
"targeted": {
"task_for_pid": 0,
"thread_create": 0,
"thread_set_state": 0
},
"warnings": 0
},
"faultingThread": 2,
"incident": "82B79418-50CC-4672-982A-46A9D8C159B6",
"isCorpse": 1,
"legacyInfo": {
"threadTriggered": {}
},
"modelCode": "MacBookPro18,2",
"osVersion": {
"build": "",
"releaseType": "",
"train": "macOS 12.3"
},
"parentPid": 2976,
"parentProc": "zsh",
"pid": 24991,
"procExitAbsTime": 8601841756762,
"procLaunch": "2022-03-16 11:08:50.9857 -0700",
"procName": "@NAME@",
"procPath": "@EXEC@",
"procRole": "Unspecified",
"procStartAbsTime": 8601835247762,
"responsiblePid": 20664,
"responsibleProc": "Terminal",
"sharedCache": {
"base": 6639747072,
"size": 3141189632,
"uuid": "48726a6e-15bc-3826-9a66-b24b559993b5"
},
"sip": "enabled",
"sleepWakeUUID": "65E63A0C-730A-4DBB-A67C-7532476614E7",
"termination": {
"byPid": 24991,
"byProc": "exc handler",
"code": 11,
"flags": 0,
"indicator": "Segmentation fault: 11",
"namespace": "SIGNAL"
},
"threads": [
{
"frames": [
{
"imageIndex": 0,
"imageOffset": 14420,
"symbol": "__ulock_wait",
"symbolLocation": 8
},
{
"imageIndex": 1,
"imageOffset": 38304,
"symbol": "_pthread_join",
"symbolLocation": 444
},
{
"imageIndex": 2,
"imageOffset": 104896,
"symbol": "std::__1::thread::join()",
"symbolLocation": 36
},
{
"imageIndex": 3,
"imageOffset": 7096,
"sourceFile": "multithread-test.cc",
"sourceLine": 31,
"symbol": "main",
"symbolLocation": 160
},
{
"imageIndex": 4,
"imageOffset": 20616,
"symbol": "start",
"symbolLocation": 516
}
],
"id": 5154880,
"queue": "com.apple.main-thread"
},
{
"frames": [
{
"imageIndex": 3,
"imageOffset": 6632,
"sourceFile": "multithread-test.cc",
"sourceLine": 15,
"symbol": "call_and_wait(int&)",
"symbolLocation": 68
},
{
"imageIndex": 3,
"imageOffset": 6612,
"sourceFile": "multithread-test.cc",
"sourceLine": 14,
"symbol": "call_and_wait(int&)",
"symbolLocation": 48
},
{
"imageIndex": 3,
"imageOffset": 13968,
"sourceFile": "type_traits",
"sourceLine": 3584,
"symbol": "decltype(static_cast<void (*>(fp)(static_cast<std::__1::reference_wrapper<int>>(fp0))) std::__1::__invoke<void (*)(int&), std::__1::reference_wrapper<int> >(void (*&&)(int&), std::__1::reference_wrapper<int>&&)",
"symbolLocation": 48
},
{
"imageIndex": 3,
"imageOffset": 13844,
"sourceFile": "thread",
"sourceLine": 276,
"symbol": "void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int>, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> >&, std::__1::__tuple_indices<2ul>)",
"symbolLocation": 56
},
{
"imageIndex": 3,
"imageOffset": 11608,
"sourceFile": "thread",
"sourceLine": 287,
"symbol": "void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> > >(void*)",
"symbolLocation": 84
},
{
"imageIndex": 1,
"imageOffset": 29292,
"symbol": "_pthread_start",
"symbolLocation": 148
},
{
"imageIndex": 1,
"imageOffset": 8332,
"symbol": "thread_start",
"symbolLocation": 8
}
],
"id": 5154896
},
{
"frames": [
{
"imageIndex": 3,
"imageOffset": 6512,
"sourceFile": "multithread-test.cc",
"sourceLine": 7,
"symbol": "bar(int)",
"symbolLocation": 20
},
{
"imageIndex": 3,
"imageOffset": 6552,
"sourceFile": "multithread-test.cc",
"sourceLine": 11,
"symbol": "foo(int)",
"symbolLocation": 24
},
{
"imageIndex": 3,
"imageOffset": 6916,
"sourceFile": "multithread-test.cc",
"sourceLine": 20,
"symbol": "compute_pow(int&)",
"symbolLocation": 28
},
{
"imageIndex": 3,
"imageOffset": 13968,
"sourceFile": "type_traits",
"sourceLine": 3584,
"symbol": "decltype(static_cast<void (*>(fp)(static_cast<std::__1::reference_wrapper<int>>(fp0))) std::__1::__invoke<void (*)(int&), std::__1::reference_wrapper<int> >(void (*&&)(int&), std::__1::reference_wrapper<int>&&)",
"symbolLocation": 48
},
{
"imageIndex": 3,
"imageOffset": 13844,
"sourceFile": "thread",
"sourceLine": 276,
"symbol": "void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int>, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> >&, std::__1::__tuple_indices<2ul>)",
"symbolLocation": 56
},
{
"imageIndex": 3,
"imageOffset": 11608,
"sourceFile": "thread",
"sourceLine": 287,
"symbol": "void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(int&), std::__1::reference_wrapper<int> > >(void*)",
"symbolLocation": 84
},
{
"imageIndex": 1,
"imageOffset": 29292,
"symbol": "_pthread_start",
"symbolLocation": 148
},
{
"imageIndex": 1,
"imageOffset": 8332,
"symbol": "thread_start",
"symbolLocation": 8
}
],
"id": 5154897,
"threadState": {
"cpsr": {
"value": 2147487744
},
"esr": {
"description": "(Data Abort) byte write Translation fault",
"value": 2449473606
},
"far": {
"value": 0
},
"flavor": "ARM_THREAD_STATE64",
"fp": {
"value": 6097596160
},
"lr": {
"value": 4370422168
},
"pc": {
"matchesCrashFrame": 1,
"value": 4370422128
},
"sp": {
"value": 6097596128
},
"x": [
{
"value": 42
},
{
"value": 105553169518896
},
{
"value": 6097596223
},
{
"value": 105553169518880
},
{
"value": 6097596416
},
{
"value": 419432703
},
{
"value": 0
},
{
"value": 0
},
{
"value": 1
},
{
"value": 0
},
{
"value": 18446744067067154563
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"symbol": "pthread_setspecific",
"symbolLocation": 0,
"value": 6643048712
},
{
"value": 8151791216
},
{
"value": 0
},
{
"value": 6097596416
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
}
]
},
"triggered": true
}
],
"translated": false,
"trialInfo": {},
"uptime": 350000,
"usedImages": [
{
"arch": "arm64e",
"base": 6642810880,
"name": "libsystem_kernel.dylib",
"path": "/usr/lib/system/libsystem_kernel.dylib",
"size": 229376,
"source": "P",
"uuid": "1d7b3b8e-75a1-34ea-aa52-9f7c23155c55"
},
{
"arch": "arm64e",
"base": 6643040256,
"name": "libsystem_pthread.dylib",
"path": "/usr/lib/system/libsystem_pthread.dylib",
"size": 53248,
"source": "P",
"uuid": "cee8bc77-6923-34d9-89a3-6f8f7279605e"
},
{
"arch": "arm64e",
"base": 6642290688,
"name": "libc++.1.dylib",
"path": "/usr/lib/libc++.1.dylib",
"size": 421888,
"source": "P",
"uuid": "06bc1ec0-9992-398e-a85b-2973eb1fdba2"
},
{
"arch": "arm64",
"base": 4370415616,
"name": "@NAME@",
"path": "@EXEC@",
"size": 16384,
"source": "P",
"uuid": "@UUID@"
},
{
"arch": "arm64e",
"base": 4373479424,
"name": "dyld",
"path": "/usr/lib/dyld",
"size": 393216,
"source": "P",
"uuid": "fbb89662-e6f2-3434-b542-f75185ac5e74"
}
],
"userID": 501,
"version": 2,
"vmRegionInfo": "0 is not in any region. Bytes before following region: 4370415616\n REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 1047f4000-1047f8000 [ 16K] r-x/r-x SM=COW ....test.tmp.out",
"vmSummary": "ReadOnly portion of Libraries: Total=589.5M resident=0K(0%) swapped_out_or_unallocated=589.5M(100%)\nWritable regions: Total=666.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=666.2M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nKernel Alloc Once 32K 1 \nMALLOC 153.2M 15 \nMALLOC guard page 64.1M 7 \nMALLOC_MEDIUM (reserved) 120.0M 1 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nMALLOC_PROB_GUARD 138.5M 1 \nSTACK GUARD 56.0M 3 \nStack 9264K 3 \n__AUTH 46K 11 \n__AUTH_CONST 67K 38 \n__DATA 173K 36 \n__DATA_CONST 258K 40 \n__DATA_DIRTY 73K 21 \n__LINKEDIT 584.9M 3 \n__OBJC_CONST 10K 5 \n__OBJC_RO 82.9M 1 \n__OBJC_RW 3168K 1 \n__TEXT 4696K 43 \ndyld private memory 1024K 1 \nshared memory 48K 3 \n=========== ======= ======= \nTOTAL 1.6G 235 \nTOTAL, minus reserved VM space 1.1G 235 \n",
"vmregioninfo": "0 is not in any region. Bytes before following region: 4370415616\n REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 1047f4000-1047f8000 [ 16K] r-x/r-x SM=COW ....test.tmp.out",
"wakeTime": 4715
}

View File

@@ -1,60 +1,43 @@
# REQUIRES: python, native && target-aarch64 && system-darwin
# rdar://93655633
# UNSUPPORTED: arm64
# RUN: %clangxx_host -std=c++17 -g %S/Inputs/multithread-test.cc -o %t.out
# RUN: cp %S/Inputs/scripted_crashlog.ips %t.crash
# RUN: %python %S/patch-crashlog.py --binary %t.out --crashlog %t.crash --offsets '{"main":160, "bar":20, "foo":24}' --json
# RUN: %lldb %t.out -o 'command script import lldb.macosx.crashlog' -o 'crashlog -a -i %t.crash' 2>&1 -o "thread list" -o "bt all" | FileCheck %s
# RUN: mkdir -p %t.dir
# RUN: yaml2obj %S/Inputs/interactive_crashlog/multithread-test.yaml > %t.dir/multithread-test
# RUN: %lldb %t.dir/multithread-test -o 'command script import lldb.macosx.crashlog' \
# RUN: -o 'crashlog -a -i %S/Inputs/interactive_crashlog/multithread-test.ips' \
# RUN: -o "thread list" -o "bt all" 2>&1 | FileCheck %s
# CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands
# CHECK: (lldb) process status
# CHECK-NEXT: Process 24991 stopped
# CHECK-NEXT: Process 22511 stopped
# CHECK-NEXT: * thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: frame #0: 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar
# CHECK-NEXT: frame #0: 0x0000000100ec58f4 multithread-test`bar
# CHECK: (lldb) thread backtrace
# CHECK-NEXT: * thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: * frame #0: 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar
# CHECK-NEXT: frame #1: 0x00000001047f5998 scripted_crashlog_json.test.tmp.out`foo
# CHECK-NEXT: frame #2: 0x00000001047f5b04 scripted_crashlog_json.test.tmp.out`compute_pow
# CHECK-NEXT: frame #3: 0x00000001047f7690 scripted_crashlog_json.test.tmp.out`decltype
# CHECK-NEXT: frame #4: 0x00000001047f7614 scripted_crashlog_json.test.tmp.out`void std::__1::__thread_execute
# CHECK-NEXT: frame #5: 0x00000001047f6d58 scripted_crashlog_json.test.tmp.out`void* std::__1::__thread_proxy
# CHECK-NEXT: frame #6: 0x000000018bf5326c libsystem_pthread.dylib`_pthread_start
# CHECK-NEXT: frame #7: 0x000000018bf4e08c libsystem_pthread.dylib`thread_start
# CHECK-NEXT: * frame #0: 0x0000000100ec58f4 multithread-test`bar{{.*}} [artificial]
# CHECK-NEXT: frame #1: 0x0000000100ec591b multithread-test`foo{{.*}} [artificial]
# CHECK-NEXT: frame #2: 0x0000000100ec5a87 multithread-test`compute_pow{{.*}} [artificial]
# CHECK: (lldb) thread list
# CHECK-NEXT: Process 24991 stopped
# CHECK-NEXT: thread #1: tid = 0x4ea840, 0x000000018bf17854 libsystem_kernel.dylib`__ulock_wait{{.*}}, queue = 'com.apple.main-thread'
# CHECK-NEXT: thread #2: tid = 0x4ea850, 0x00000001047f59e8 scripted_crashlog_json.test.tmp.out`call_and_wait
# CHECK-NEXT: * thread #3: tid = 0x4ea851, 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar{{.*}}, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: Process 22511 stopped
# CHECK-NEXT: thread #1: tid = 0x23c7fe, 0x000000019cc40b84 libsystem_kernel.dylib`__ulock_wait{{.*}}, queue = 'com.apple.main-thread'
# CHECK-NEXT: thread #2: tid = 0x23c800, 0x000000019cc42c9c libsystem_kernel.dylib`{{.*}}
# CHECK-NEXT: * thread #3: tid = 0x23c801, 0x0000000100ec58f4 multithread-test`bar{{.*}}, stop reason = EXC_BAD_ACCESS
# CHECK: (lldb) bt all
# CHECK-NEXT: thread #1
# CHECK-NEXT: frame #0: 0x000000018bf17854 libsystem_kernel.dylib`__ulock_wait
# CHECK-NEXT: frame #1: 0x000000018bf555a0 libsystem_pthread.dylib`_pthread_join
# CHECK-NEXT: frame #2: 0x000000018beae9c0 libc++.1.dylib`std::__1::thread::join
# CHECK-NEXT: frame #3: 0x00000001047f5bb8 scripted_crashlog_json.test.tmp.out`main
# CHECK-NEXT: frame #4: 0x0000000104ae5088 dyld`start
# CHECK-NEXT: thread #2
# CHECK-NEXT: frame #0: 0x00000001047f59e8 scripted_crashlog_json.test.tmp.out`call_and_wait
# CHECK-NEXT: frame #1: 0x00000001047f59d4 scripted_crashlog_json.test.tmp.out`call_and_wait
# CHECK-NEXT: frame #2: 0x00000001047f7690 scripted_crashlog_json.test.tmp.out`decltype
# CHECK-NEXT: frame #3: 0x00000001047f7614 scripted_crashlog_json.test.tmp.out`void std::__1::__thread_execute
# CHECK-NEXT: frame #4: 0x00000001047f6d58 scripted_crashlog_json.test.tmp.out`void* std::__1::__thread_proxy
# CHECK-NEXT: frame #5: 0x000000018bf5326c libsystem_pthread.dylib`_pthread_start
# CHECK-NEXT: frame #6: 0x000000018bf4e08c libsystem_pthread.dylib`thread_start
# CHECK-NEXT: * thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: * frame #0: 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar
# CHECK-NEXT: frame #1: 0x00000001047f5998 scripted_crashlog_json.test.tmp.out`foo
# CHECK-NEXT: frame #2: 0x00000001047f5b04 scripted_crashlog_json.test.tmp.out`compute_pow
# CHECK-NEXT: frame #3: 0x00000001047f7690 scripted_crashlog_json.test.tmp.out`decltype
# CHECK-NEXT: frame #4: 0x00000001047f7614 scripted_crashlog_json.test.tmp.out`void std::__1::__thread_execute
# CHECK-NEXT: frame #5: 0x00000001047f6d58 scripted_crashlog_json.test.tmp.out`void* std::__1::__thread_proxy
# CHECK-NEXT: frame #6: 0x000000018bf5326c libsystem_pthread.dylib`_pthread_start
# CHECK-NEXT: frame #7: 0x000000018bf4e08c libsystem_pthread.dylib`thread_start
# CHECK: thread #1, queue = 'com.apple.main-thread'
# CHECK: frame #{{[0-9]+}}: 0x000000019cc40b84 libsystem_kernel.dylib`__ulock_wait{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x0000000100ec5b3b multithread-test`main{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x00000002230f8da7 dyld`start{{.*}} [artificial]
# CHECK-NEXT: thread #2
# CHECK-NEXT: frame #0: 0x000000019cc42c9c libsystem_kernel.dylib`__write_nocancel{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x0000000100ec5957 multithread-test`call_and_wait{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x000000019cc7e06b libsystem_pthread.dylib`_pthread_start{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x000000019cc78e2b libsystem_pthread.dylib`thread_start{{.*}} [artificial]
# CHECK-NEXT:* thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: * frame #0: 0x0000000100ec58f4 multithread-test`bar{{.*}} [artificial]
# CHECK-NEXT: frame #1: 0x0000000100ec591b multithread-test`foo{{.*}} [artificial]
# CHECK-NEXT: frame #2: 0x0000000100ec5a87 multithread-test`compute_pow{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x000000019cc7e06b libsystem_pthread.dylib`_pthread_start{{.*}} [artificial]
# CHECK: frame #{{[0-9]+}}: 0x000000019cc78e2b libsystem_pthread.dylib`thread_start{{.*}} [artificial]