Xcode Sanitizers and Runtime Issues

RSS for tag

Xcode Runtime Issues are reports of programming errors found at run time. Issues can be found by variety of tools, including Address Sanitizer (ASan), Main Thread Checker (MTC), Thread Sanitizer (TSan), and Undefined Behavior Sanitizer (UBSan).

Xcode Runtime Issues Documentation

Posts under Xcode Sanitizers and Runtime Issues tag

105 Posts
Sort by:
Post not yet marked as solved
4 Replies
2.5k Views
Hello! I'm working on a new app, and DYLD_PRINT_STATISTICS=1 is not working - i.e., not producing any output. Build platform: MacBook Pro (15-inch, 2018) macOS Monterey, 12.0 beta 6 (21A5506j) Xcode 13.0 beta 5 (13A5212g) Test device: iPad 8th generation iPadOS 15.0 beta 8 (19A5340a) I'm setting it as usual in Product -> Scheme -> Edit Scheme, then going to "Run" tab on the left and choosing "Arguments" on the top. In that screen I enter "DYLD_PRINT_STATISTICS" for Name and "YES" for Value. Nothing prints. I also tried: Using "1" for Value instead of "YES" Entering "DYLD_PRINT_STATISTICS=YES" as Name and leaving Value blank Entering "DYLD_PRINT_STATISTICS=1" as Name and leaving Value blank Every combination of the above, but as command-line arguments instead of environment variables. Also, I tried "DYLD_PRINT_APIS" as Name and "YES" as Value, and that works normally. What's going on here? Is it something with the all-SwiftUI lifecycle? An issue with the beta macOS/Xcode/iPadOS? Thanks!
Posted
by drewster.
Last updated
.
Post not yet marked as solved
0 Replies
190 Views
at time of update of Xcode,in middle some reason it failed but when I see it after that once again update it but this time it install the Xcode(there is two applications of Xcode in my device. after seeing it I will delete Xcode but some still remain in my device that create a problem when I am download Xcode once again at time of certain gb it failed but it doesn't download.please help me.......
Posted Last updated
.
Post not yet marked as solved
9 Replies
1.8k Views
Hello everyone! My app is getting a crash in the tableView(_:trailingSwipeActionsConfigurationForRowAt:) function. Apparently, the app is crashing when trying to get the indexPath.section value. I am attaching the crash log. This is not reproducible for me. I have the hunch that this might be related to some accessibility feature, but I have not been able to corroborate it yet. I am not sure how to solve this issue or how to move forward since I still don't know what is causing the app. Any advice or guidance is really appreciated. Thank you! Crashed: com.apple.main-thread EXC_BREAKPOINT 0x00000001bd99e0c8 Crashed: com.apple.main-thread 0&#9;libswiftUIKit.dylib&#9;&#9;&#9;&#9;&#9;&#9;0x1bd99e0c8 IndexPath.section.getter + 168 1&#9;MyApp&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1033697a4 TableDelegate.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 337 (TableDelegate.swift:337) 2&#9;MyApp&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x103369e58 @objc TableDelegate.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 4316896856 (<compiler-generated>:4316896856) 3&#9;UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad80b9cc -[UITableView _trailingSwipeConfigurationAtIndexPath:fromRemoveButton:] + 1892 4&#9;UIKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1f0935c34 -[UITableViewCellAccessibility _privateAccessibilityCustomActions] + 540 5&#9;UIAccessibility&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1bd9d8854 -[NSObject(AXPrivCategory) _retrieveCustomActionsForElement:] + 68 6&#9;UIAccessibility&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1bd9d8b0c -[NSObject(AXPrivCategory) _accessibilityCustomActions] + 220 7&#9;UIAccessibility&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1bd9f990c -[NSObjectAccessibility accessibilityRespondsToUserInteraction] + 424 8&#9;UIKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1f0952f6c -[UIViewAccessibility accessibilityRespondsToUserInteraction] + 124 9&#9;UIKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1f08f3440 -[UILabelAccessibility accessibilityRespondsToUserInteraction] + 120 10 UIKit&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1f0959678 -[UIViewAccessibility _isEligibleForFocusInteraction] + 124 11 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad07f4e4 _UIFocusEnvironmentIsEligibleForFocusInteraction + 64 12 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad0acb44 __UIFocusMapRecurseSearchForFocusSystemInEligibleContainer + 148 13 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad0c30f8 -[_UIFocusMapSnapshot addRegionsInContainer:] + 64 14 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad0c32fc -[_UIFocusMapSnapshot addRegionsInContainers:] + 196 15 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1adad78cc -[UIView _searchForFocusRegionsInContext:] + 924 16 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad0c3178 -[_UIFocusMapSnapshot addRegionsInContainer:] + 192 17 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad0c32fc -[_UIFocusMapSnapshot addRegionsInContainers:] + 196 50 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ada9595c -[_UIAfterCACommitBlock run] + 64 51 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad5ff79c _runAfterCACommitDeferredBlocks + 296 52 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad5eeb4c _cleanUpAfterCAFlushAndRunDeferredBlocks + 200 53 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad620260 _afterCACommitHandler + 76 54 CoreFoundation&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x1aad2fecc CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32 55 CoreFoundation&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x1aad2a5b0 __CFRunLoopDoObservers + 604 56 CoreFoundation&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x1aad2aaf8 __CFRunLoopRun + 960 57 CoreFoundation&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x1aad2a200 CFRunLoopRunSpecific + 572 58 GraphicsServices&#9;&#9;&#9;&#9;&#9;&#9;&#9; 0x1c0e25598 GSEventRunModal + 160 59 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad5f0004 -[UIApplication _run] + 1052 60 UIKitCore&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1ad5f55d8 UIApplicationMain + 164 61 MyApp&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x102d7d654 main + 16 (AppDelegate.swift:16) 62 libdyld.dylib&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;0x1aaa09598 start + 4 Full crash log - https://developer.apple.com/forums/content/attachment/4049d9cc-89db-4d2c-a4d9-d71127396799
Posted
by egalindo.
Last updated
.
Post not yet marked as solved
1 Replies
205 Views
My App had no such warnings before updating to 13.3, but now it claims I'm updating from a background thread. A simple print will make these warnings stop, so something is wrong:  @MainActor private func runOnMain(_ action: @escaping () async -> ()) async {         //print("", terminator: "")         await action()     } simply uncommenting that print() makes all the warnings go away, so I think 13.3 has an issue here... Is anyone else seeing this?
Posted
by remsleep.
Last updated
.
Post not yet marked as solved
0 Replies
241 Views
I receive random crashes during an ARWorldTrackingConfiguration Session with this message: Assert: in line 508 dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/usr/lib/libMTLCapture.dylib (lldb)  What shall I do? There is no reliable way to reproduce this error. It is thrown randomly - sometimes a few seconds after the completion of the relocalization process, but sometimes not at all.
Posted Last updated
.
Post not yet marked as solved
0 Replies
275 Views
I build my app using Unity3D with zlib.net, NativeGallery and libEasyWebcam IOS plug-ins then running on Xcode which has error log like: "Cannot find executable for CFBundle 0x7fc2158058d0 </Users/myName/Library/Developer/CoreSimulator/Devices/A8403824-30BE-41EE-AC63-844D3EC55724/data/Containers/Bundle/Application/D495B7E4-BB31-4AC9-BD08-0D90E2C2D8A3/myApp.app/Frameworks/UnityFramework.framework> (not loaded)". Do you know how to fix it? Thank!
Posted
by Thang Le.
Last updated
.
Post not yet marked as solved
0 Replies
274 Views
I wrote short code for the App using camera and that crushed when I tried to display preview. There is no error code, so where should I fix?     @State var image: Image?     @State var isPicking = false     var body: some View {         ZStack {             VStack {                 VStack {                         Spacer()                         image?                             .resizable()                             .scaledToFit()                         Spacer()                     }                 HStack {                     Spacer()                     Button(action: {                         self.isPicking = true                     }) {                         Image(systemName: "camera")                         Text("カメラ")                     }.padding()                 }             }             if isPicking {                 ImagePicker()                     .edgesIgnoringSafeArea(.all)                     .transition(.move(edge: .bottom))                     .animation(.easeInOut, value: isPicking)             }         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } ImagePicker↓ struct ImagePicker: UIViewControllerRepresentable{         func makeCoordinator() -&gt; Coordinator {       Coordinator(self)     }          func makeUIViewController(context: Context) -&gt;     UIImagePickerController{         let picker = UIImagePickerController()         picker.sourceType = .camera         picker.delegate = context.coordinator         return picker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {     } } struct ImagePicker_Previews: PreviewProvider {     static var previews: some View {         ImagePicker()     } } Coordinator↓ class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate{     var parent: ImagePicker     init(_ parent: ImagePicker){         self.parent = parent     }  func imagePickerController(_ picker: UIImagePickerController,                            didFinishPickingMediaWithInfo info:                                        [UIImagePickerController.InfoKey: Any]){     let uiImage = info[.originalImage] as! UIImage     UIImageWriteToSavedPhotosAlbum(uiImage, nil, nil, nil) } func imagePickerControllerDidCancel(_ picker: UIImagePickerController){ } }
Posted Last updated
.
Post not yet marked as solved
1 Replies
292 Views
I have uploaded an app twice now to have it rejected due to it crashing upon loading. I have tested and tried this on simulators it works fine, I also have this already working for the android store. Been trying to work this out for a while now but not sure how to fix this moving forwards. The crash log is as follows: Crash File. Any help would be amazing. Many Thanks,
Posted
by Zunoma.
Last updated
.
Post not yet marked as solved
1 Replies
222 Views
Hi everyone, Let me prefix this question by saying that I am not an iOS developer... so be gentle :-) A friend has an older codebase (written in xCode 11) that was abandoned by the developers that were working on it. He needed someone to fix Firebase logging (which I did) and everything was fine until recently. Now upon moving to any xCode > 12 there is a runtime error deep in the library code used throughout the app. The error (slightly generalized) is as follows: Could not cast value of type '() -> MyApp.TabBarFC' (0x111eda8a0) to '() -> LibraryKit.LibraryFC' (0x111eda8c0). the respective classes are declared as follows... in app code: class TabBarFC: LibraryTabBarFC { in library code: open class LibraryTabBarFC: LibraryFC { The line it specifically crashes on is in a flow controller (FC) repository in the library code where you can see an attempt to cast the app parameter to the class LibraryFC: var factories: [LibraryKit.Id.FC : () -> (LibraryFC)] = [:] open func register<FC: LibraryFC>(factory: @escaping () -> (FC), id: LibraryKit.Id.FC) { factories[id] = factory as! () -> (LibraryFC) } This code worked in xCode 11. It does not work now. If anyone could tell me if there is an obvious fix (it could be trivial), it would certainly be faster than giving the entire codebase to someone else or me reading documentation for a few nights. Thanks!
Posted Last updated
.
Post not yet marked as solved
1 Replies
498 Views
When I enable Thread Sanitiser, the app crashes at launch with: dyld: Symbol not found: _vfork   Referenced from: /Users/cyupa/Library/Developer/CoreSimulator/Devices/CC4C4E42-ED50-44EC-975F-EE359D6ADED7/data/Containers/Bundle/Application/6B59B224-9958-4405-8920-A96A932934E2/ClickDocDE.app/Frameworks/libclang_rt.tsan_iossim_dynamic.dylib   Expected in: /usr/lib/libSystem.B.dylib dyld: launch, loading dependent libraries DYLD_SHARED_CACHE_DIR=/Users/cyupa/Library/Developer/CoreSimulator/Caches/dyld/21A5294g/com.apple.CoreSimulator.SimRuntime.iOS-14-5.18E182 DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/cyupa/Library/Developer/Xcode/DerivedData/ClickDoc-czbdfskrwvaneubcallbzipphltx/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=@executable_path/Frameworks/libclang_rt.tsan_iossim_dynamic.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Content (lldb)  dyld`__abort_with_payload:     0x11162e750 <+0>:  movl   $0x2000209, %eax          ; imm = 0x2000209      0x11162e755 <+5>:  movq   %rcx, %r10     0x11162e758 <+8>:  syscall  ->  0x11162e75a <+10>: jae    0x11162e764               ; <+20>     0x11162e75c <+12>: movq   %rax, %rdi     0x11162e75f <+15>: jmp    0x1115ec120               ; cerror_nocancel     0x11162e764 <+20>: retq        0x11162e765 <+21>: nop         0x11162e766 <+22>: nop         0x11162e767 <+23>: nop     This fails on multiple machines with different OS and Xcode versions.
Posted
by Cyupa.
Last updated
.
Post not yet marked as solved
2 Replies
374 Views
I used animation in these codes, and there was warning like "'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead." I am beginner, so please tell me how to fix it specifically. struct ContentView: View {     @State var image: Image?     @State var isPicking = false     var body: some View {         ZStack {             VStack {                 VStack {                         Spacer()                         image?                             .resizable()                             .scaledToFit()                         Spacer()                     }                 HStack {                     Spacer()                     Button(action: {                         self.isPicking = true                     }) {                         Image(systemName: "camera")                         Text("カメラ")                     }.padding()                 }             }             if isPicking {                 ImagePicker()                     .edgesIgnoringSafeArea(.all)                     .transition(.move(edge: .bottom))                     .animation(.easeInOut)             }         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
Posted Last updated
.
Post not yet marked as solved
1 Replies
244 Views
Hi, I am trying to do Flutter Run and I am keep getting this error bin/slim-build-frameworks.sh: No such file or directory command PhaseScriptExecution failed with a nonzero exit code error. This command used to work for me not, I am still in the learning phase of Flutter, any help is appreciated. If you need any further details please let me know.
Posted Last updated
.
Post not yet marked as solved
1 Replies
399 Views
While generating the Xcode build with Address Sanitizer enabled, I am unable to launch the PacketTunnelProvider provider. The process is getting killed by the Operating System with the below exception "Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=50 MB, unused=0x0)" I understood that since Packettunnel Provider extension has only a memory limit of 50 MB, Operating System is killing the process. Is there any other way, we can overcome this limitation and perform Address Sanitizer testing ?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
Just Created one Login screen and its UI, UI is custom reads all properties from the local JSON file, like color, button shape, background color, icon URL, etc. Used one Framework which I have created for my UI, and just drag and drop that framework (No API calls in that Framework) but when I run my project my UI gets stuck, Not able to click any button or text field. and I am getting the following error boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics  also, My CPU use is 100% and my app is getting stuck (see screenshot) Memory is increasing to 6 to 7 GB. but the same thing is working fine in Xcode 10.2.1, right now I am using Xcode 13.2. If I run the same code in Xcode 10.2.1 then its works fine, but the same code not working in Xcode 13.2 can Anyone Help me?
Posted
by Narijayu.
Last updated
.
Post not yet marked as solved
0 Replies
196 Views
Hi, I can build my app normally, but enabling Address sanitizer in the app target's scheme (Edit scheme -> Run -> Diagnostic -> Address Sanitizer) make the linking step fails. The failure looks like this: Ld /Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Products/Debug-iphoneos/libxxxxxMain.a normal (in target 'xxxxxMain' from project 'xxxxxxxx') cd /Users/giober/workspace/my-sdk /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios11.0 -r -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -L/Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Products/Debug-iphoneos -F/Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Products/Debug-iphoneos -filelist /Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Intermediates.noindex/xxxxxxxx.build/Debug-iphoneos/xxxxxMain.build/Objects-normal/arm64/xxxxxMain.LinkFileList -Xlinker -map -Xlinker /Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Intermediates.noindex/xxxxxxxx.build/Debug-iphoneos/xxxxxMain.build/xxxxxMain-LinkMap-normal-arm64.txt -Xlinker -object_path_lto -Xlinker /Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Intermediates.noindex/xxxxxxxx.build/Debug-iphoneos/xxxxxMain.build/Objects-normal-asan/arm64/xxxxxMain_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -Xlinker -debug_variant -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -fsanitize\=address -ObjC -lrebrtc_multi -lxxxxxxxxxx -lxxxxxxxxxxxx -Xlinker -dependency_info -Xlinker /Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Intermediates.noindex/xxxxxxxx.build/Debug-iphoneos/xxxxxMain.build/Objects-normal-asan/arm64/xxxxxMain_dependency_info.dat -o /Users/giober/Library/Developer/Xcode/DerivedData/xxxxxxxx-fsaitgomjihmgxhepmdwyfkrmmyu/Build/Products/Debug-iphoneos/libxxxxxMain.a ld: -rpath can only be used when creating a dynamic final linked image clang: error: linker command failed with exit code 1 (use -v to see invocation) I tried googling around, with no luck. I'm on XCode 13.1.
Posted Last updated
.