Closer and closer, but still not quite! :slight_smile:

This is running with Hardened Runtime off, but with original swift-inspect in original location without changes - dump-conformance-cache works, we still crash though for arrays and concurrency!

  See 'swift-inspect help <subcommand>' for detailed help.
hassila@ice ~/g/ordo (main)> swift-inspect dump-arrays 62326
Address	Size	Count	Is Class
0x600000200000	128	5	false
0x600000200600	128	5	false
0x600000200c00	128	5	false
0x600000201200	128	5	false
0x600000201800	128	5	false
0x600000202a80	128	5	false
0x600000202f80	128	5	false
0x600000203700	128	5	false
0x600000203d00	128	5	false
0x600000300a00	128	4	false
0x600000300c00	128	2	false
0x600000300d00	128	3	false
fish: Job 1, 'swift-inspect dump-arrays 62326' terminated by signal SIGBUS (Misaligned address error)
hassila@ice ~/g/ordo (main) [SIGBUS]> swift-inspect dump-concurrency 62326
TASKS
fish: Job 1, 'swift-inspect dump-concurrenc...' terminated by signal SIGBUS (Misaligned address error)
hassila@ice ~/g/ordo (main) [SIGBUS]> sudo swift-inspect dump-concurrency 62326
TASKS
fish: Job 1, 'sudo swift-inspect dump-concu...' terminated by signal SIGBUS (Misaligned address error)
hassila@ice ~/g/ordo (main) [SIGBUS]> 

FWIW, I'm not crashing in concurrency or arrays and get no runtime warnings (but skip 3 commands d/t metadata allocation iteration). It's likely my app is too simple async-wise to trigger the crash.

  • swift-inspect: self-signed per workaround
  • target app: running under Xcode debugger, but in sandbox.
  • XCode: 15.3
  • macOS: 14.4
  • mac: studio M1 max
## swift-inspect dump-conformance-cache from({item})
Conformance: Swift.Bool: Swift._ObjectiveCBridgeable
[...]

## swift-inspect dump-raw-metadata from({item})
- SKIP: must enable `metadata allocation iteration`

## swift-inspect dump-generic-metadata from({item})
- SKIP: must enable `metadata allocation iteration`

## swift-inspect dump-cache-nodes from({item})
- SKIP: must enable `metadata allocation iteration`

## swift-inspect dump-arrays from({item})
Address	Size	Count	Is Class
0x600000e03810	208	1	false
0x600000e039b0	208	1	false
[...]

## swift-inspect dump-concurrency from({item})
TASKS
        
      Task 0x1 - flags=future enqueuePriority=0x19 maxPriority=0x0 address=0x13b127990
        async backtrace: NSNotificationCenter.Notifications.next() [...]
        resume function: NSNotificationCenter.Notifications.next() in Foundation
        task allocator: 1016 bytes in 2 chunks

ACTORS
THREADS
  no threads with active tasks

Ok, if that’s still crashing then I think that’s probably a bug of some sort. If you could file a GitHub Issue or a Feedback Request and attach the crash logs, that’d be much appreciated.

hassila already filed this as FB13694901 [1].

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

[1] al45tair already knows this. I believe that request is a classic example of a race condition (-:

3 Likes

Thanks @eskimo and @al45tair - I did update the FB with the two different crashes for array/concurrency. For anyone interested the offending stack is:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib      	       0x19dfb335c _platform_memmove + 444
1   libswiftRemoteMirror.dylib    	       0x10473b938 swift::remote::MemoryReader::readBytes(swift::remote::RemoteAddress, unsigned char*, unsigned long long) + 100
2   libswiftRemoteMirror.dylib    	       0x10475b348 swift::remote::MetadataReader<swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8u>>>, swift::reflection::TypeRefBuilder>::readObjCRODataPtr(unsigned long long) + 156
3   libswiftRemoteMirror.dylib    	       0x1047558b4 swift::remote::MetadataReader<swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8u>>>, swift::reflection::TypeRefBuilder>::readNominalTypeFromClassMetadata(swift::remote::RemoteRef<swift::TargetMetadata<swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8u>>>> const>, int, bool) + 124
4   libswiftRemoteMirror.dylib    	       0x1047351cc swift::remote::MetadataReader<swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8u>>>, swift::reflection::TypeRefBuilder>::readTypeFromMetadata(unsigned long long, bool, int) + 1112
5   swift-inspect                 	       0x104017b68 0x10400c000 + 47976
6   swift-inspect                 	       0x1040212c8 0x10400c000 + 86728
7   swift-inspect                 	       0x1040212a0 0x10400c000 + 86688
8   swift-inspect                 	       0x10401abcc 0x10400c000 + 60364
9   libsystem_malloc.dylib        	       0x19ddb54c8 nanov2_ptr_in_use_enumerator + 1256
10  Symbolication                 	       0x1dfe7c4b4 VMUTask_foreach_malloc_zone + 3476
11  Symbolication                 	       0x1dfe7b6f4 task_foreach_malloc_zone + 72
12  Symbolication                 	       0x1dfe7c910 task_enumerate_malloc_blocks + 100
13  swift-inspect                 	       0x104017a80 0x10400c000 + 47744
14  swift-inspect                 	       0x104014b34 0x10400c000 + 35636
15  swift-inspect                 	       0x1040149cc 0x10400c000 + 35276
16  swift-inspect                 	       0x1040181b0 0x10400c000 + 49584
17  swift-inspect                 	       0x104015884 0x10400c000 + 39044
18  dyld                          	       0x19dbfa0e0 start + 2360

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib      	       0x19dfb3344 _platform_memmove + 420
1   libswiftRemoteMirror.dylib    	       0x105673938 swift::remote::MemoryReader::readBytes(swift::remote::RemoteAddress, unsigned char*, unsigned long long) + 100
2   libswiftRemoteMirror.dylib    	       0x10568d50c swift::remote::MetadataReader<swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8u>>>, swift::reflection::TypeRefBuilder>::readMetadata(unsigned long long) + 256
3   libswiftRemoteMirror.dylib    	       0x10566e440 swift::reflection::ReflectionContext<swift::External<swift::WithObjCInterop<swift::RuntimeTarget<8u>>>>::metadataIsActor(unsigned long long) + 32
4   libswiftRemoteMirror.dylib    	       0x10566e418 swift_reflection_metadataIsActor + 20
5   swift-inspect                 	       0x104f5b01c 0x104f44000 + 94236
6   swift-inspect                 	       0x104f5a404 0x104f44000 + 91140
7   swift-inspect                 	       0x104f64b40 0x104f44000 + 133952
8   swift-inspect                 	       0x104f64ba8 0x104f44000 + 134056
9   swift-inspect                 	       0x104f52bcc 0x104f44000 + 60364
10  libsystem_malloc.dylib        	       0x19ddb54c8 nanov2_ptr_in_use_enumerator + 1256
11  Symbolication                 	       0x1dfe7c4b4 VMUTask_foreach_malloc_zone + 3476
12  Symbolication                 	       0x1dfe7b6f4 task_foreach_malloc_zone + 72
13  Symbolication                 	       0x1dfe7c910 task_enumerate_malloc_blocks + 100
14  swift-inspect                 	       0x104f59dc4 0x104f44000 + 89540
15  swift-inspect                 	       0x104f5a5e8 0x104f44000 + 91624
16  swift-inspect                 	       0x104f5a1c0 0x104f44000 + 90560
17  swift-inspect                 	       0x104f5c2f8 0x104f44000 + 99064
18  swift-inspect                 	       0x104f4ce5c 0x104f44000 + 36444
19  swift-inspect                 	       0x104f59b18 0x104f44000 + 88856
20  swift-inspect                 	       0x104f4d884 0x104f44000 + 39044
21  dyld                          	       0x19dbfa0e0 start + 2360
1 Like

Thank-you :-) Much appreciated.

1 Like