Xcode Sanitizers and Runtime Issues

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

87 results found
Post marked as solved
932 Views

Lexical or Preprocessor Issue

I updated my MacOS and XCode this past week and now I have 15 errors that weren't there before and all dealing with the Podfiles. Most are can't build modules and not liking double quotes which the headers are supposed to be. How do I fix this as the XCode recommended fix makes it worse. Do I need to create new pods?
Asked
Last updated .
Post marked as unsolved
61 Views

Xcode doesn't run simple code

Whenever I try to run a code(any C++ code that takes input) in Xcode, it builds successfully, but it never completes running. The bar on the top keeps saying running, and the input is never registered. On a similar note, while trying to setup VS Code also, I was faced with an error that wchar file was not found. Kindly help
Asked
by Grasin07.
Last updated .
Post marked as unsolved
84 Views

Unable to obtain permission for xcode app to use NSEvent.addGlobalMonitorForEvents(matching: NSEvent.EventTypeMask.keyUp, handler: {(event: NSEvent) in print("\(event)")})

I am building a mouse and keyboard tracking software as a piece of a user assistant AI, but have hit a major block in progress since I can't gather data from the keyboard globally despite already having enabled the app in Accessibility and disabled sandbox like it was suggested I do. I'm using "NSEvent.addGlobalMonitorForEvents(matching: NSEvent.EventTypeMask.keyUp, handler: {(event: NSEvent) in print("\(event)")})" and it works perfectly with the "NSEvent.EventTypeMask.mouseMoved" mask Any suggestions as to what it could be? A checkbox I forgot to click somewhere? Another class/function that can be used for global keyboard input?
Asked
Last updated .
Post marked as unsolved
128 Views

Xcode 12.0.1 crashes in Carthage build after installing 12.3 Beta

With releases of 12.2 and 12.3 Beta, xcodebuild times out in the phase of carthage update or build. No Carthage logs left in the archive directory(which starts with /var) It just shows after API fails. 16:00:30 * Skipped downloading ocmock.framework binary due to the error: 16:00:30  "API rate limit exceeded for ***.***.***.***. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)" 16:00:49 * Building scheme "OCMock iOS" in OCMock.xcodeproj 16:13:30 xcodebuild timed out while trying to read ***.xcodeproj(censoring due to private project) Maybe I can suggest for those who using 12.0.1 in the company to use newer version of Xcode, but that is not a solution for 12.0.1 crashes with 12.3 installed build machines on CI. Is there any workarounds?
Asked
by dokimyj.
Last updated .
Post marked as solved
95 Views

Xcode New File

When ever I create a new program in Xcode(c family language) the main file created works perfectly fine in compiling the code and running it but when I create a new c++ file in the same program then Xcode just shows a duplicate error while compiling it(the code is fine, I checked it). After this the main file also shows a similar error. What to do? I am a beginner.
Asked
Last updated .
Post marked as unsolved
427 Views

Xcode 12.2 - "Any Mac ( Apple Silicon, Intel)" not available when opening existing Mac project

I'm running the just-released Xcode 12.2 (12B45b) on macOS 10.15.7. When I open an existing Mac project ( just a standard AppKit, Foundation app, nothing extra - Objective-C with nib ) it does NOT offer "Any Mac ( Apple Silicon, Intel)". Instead it offers "Any Mac (Intel)". Curiously, if I start a new Mac project it offers the Apple Silicon option and builds a universal app. I'm using Architecture ( in Build Settings ) of "Standard Architectures" and Base SDK set to "macOS" ( which is the only option show ). Any ideas what could be wrong? Thanks, Brian
Asked
Last updated .
Post marked as unsolved
961 Views

NSKeyValuePopPendingNotificationLocal crash iOS 13 and 14

We are observing many crashes in our application related to NSKeyValuePopPendingNotificationLocal in Foundation. They appeared in the last 5 days, the Xcode version used for the build is 12.0.1 (12A7300). Versions built with previous xcode are not affected The stack below: Crash log - https://developer.apple.com/forums/content/attachment/5db85801-6405-4483-ac9b-1f2d986482de
Asked
by andr3a88.
Last updated .
Post marked as unsolved
350 Views

Launch Screen Transition

How do I create a seamless transition between my launch screen storyboard and my main storyboard? At the moment, I only have a solid color for my launch screen for simplicity, and the first screen of my app is the same color, but with a logo, so it should be a rather smooth transition. Yet when I run my app, there's always a jarring flash in between the launch screen and the first screen of my main storyboard. How do I add some sort of transition between the two, such as fade or crossfade or blur in etc.? Thank you!
Asked
Last updated .
Post marked as unsolved
161 Views

Could please better understand what is problems with AddressSanitizer: allocator is out of memory?

I did not change nothing in my code, but after iOS 14 and Xcode 12 I started to get the crashes. Previous build was on Xcode 11 and I didn't see the crashes, I tried to create same test cases for deferent iOS and Xcode, and I don’t see the crashes in previous build. I started to get the crashes, only for iOS 14 operating systems and after using Xcode 12.  My function, where I think I have the crash, but I don't understand where exactly, because I didn't change nothing. Maybe something changed in Core Data? (NSMutableArray *)getObjectsforEntity:(NSString *)strEntity sortBy:(NSString *)strSort isAscending:(BOOL)ascending predicate:(NSPredicate *)predicate {     NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:strEntity];     if (strSort) {         NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:strSort ascending:ascending];         [fetchRequest setSortDescriptors:[NSArray arrayWithObject:sort]];     }     if (predicate) {         [fetchRequest setPredicate:predicate];     }     NSError *error;     NSMutableArray *result = [[[[self managedObjectContext] executeFetchRequest:fetchRequest error:&error] mutableCopy ]autorelease];     if (result == nil) {         return [[NSMutableArray alloc] init];     }     return result; } I tried to caught it and this is what I found: ==13048==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x1a0 bytes ==13048==FATAL: AddressSanitizer: internal allocator is out of memory trying to allocate 0x50 bytes AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb)  thread info -s thread #1: tid = 0x12fa63, 0x00000001041961f8 libclangrt.asaniosdynamic.dylib`asan::AsanDie(), queue = 'SQLQueue 0x16572e2c0 for MyApp.sqlite', stop reason = AddressSanitizer detected: out-of-memory {   "accesssize": 0,   "accesstype": 0,   "address": 0,   "description": "out-of-memory",   "instrumentationclass": "AddressSanitizer",   "pc": 0,   "stoptype": "fatalerror" } This is what I see in log: self RMNDatabaseManager * 0x164416210 0x0000000164416210 NSObject NSObject isa _unsafeunretained Class RMNDatabaseManager 0x000021a1019b6131 predicate NSPredicate * 0x2d7143b90 0x00000002d7143b90 NSObject NSObject predicateFlags struct predicateFlags evaluationBlocked unsigned int 0 reservedPredicateFlags unsigned int 0 reserved uint32t 0 fetchRequest NSFetchRequest * 0x2ce26f2d0 0x00000002ce26f2d0 NSPersistentStoreRequest NSPersistentStoreRequest NSObject NSObject isa unsafeunretained Class 0x61a1fb9ef989 0x000061a1fb9ef989 error NSError * domain: nil - code: 1287 0x0000000102957960 NSObject NSObject isa _unsafeunretained Class 0x102957880 0x0000000102957880 reserved void * 0x10295792c 0x000000010295792c code NSInteger 1287 domain NSString * 0x303 0x0000000000000303 NSObject NSObject isa unsafeunretained Class 0x0 userInfo NSDictionary * 0x20ff 0x00000000000020ff NSObject NSObject isa unsafeunretained Class 0x0 result NSMutableArray * 0x2d5131420 0x00000002d5131420 NSArray NSArray NSObject NSObject isa _unsafeunretained Class 0x154000452 0x0000000154000452 Crashlog  details:  [[Crashed: 0 CoreData 0x000000019d9fb6b8 PFObjectIDFastHash64 + 36 (NSBasicObjectID.m:707) 1 CoreData 0x000000019d9fb6b4 PFObjectIDFastHash64 + 32 (NSBasicObjectID.m:706) 2 CoreFoundation 0x0000000197c1c10c CFBasicHashRehash + 996 (CFBasicHash.c:477) 3 CoreFoundation 0x0000000197c1fdf4 CFBasicHashRemoveValue + 2352 (CFBasicHash.c:1386) 4 CoreFoundation 0x0000000197b3e2f8 CFDictionaryRemoveValue + 224 (CFDictionary.c:471) 5 CoreData 0x000000019d94b8e8 -[NSManagedObjectContext(NSInternalAdditions) forgetObject:propagateToObjectStore:removeFromRegistry:] + 120 (NSManagedObjectContext.m:5088) 6 CoreData 0x000000019d92b450 -[PFManagedObjectReferenceQueue processReferenceQueue:] + 864 (NSManagedObjectContext.m:5077) 7 CoreData 0x000000019da43578 90-[NSManagedObjectContext(NSInternalNotificationHandling) registerAsyncReferenceCallback]blockinvoke + 68 (NSManagedObjectContext.m:8825) 8 CoreData 0x000000019da39b18 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3880) 9 libdispatch.dylib 0x000000019782b280 dispatchclientcallout + 16 (object.m:559) 10 libdispatch.dylib 0x00000001977d3fa8 dispatchlaneserialdrain$VARIANT$mp + 612 (inlineinternal.h:2548) 11 libdispatch.dylib 0x00000001977d4a84 dispatchlaneinvoke$VARIANT$mp + 424 (queue.c:3862) 12 libdispatch.dylib 0x00000001977de518 dispatchworkloopworkerthread + 712 (queue.c:6590) 13 libsystempthread.dylib 0x00000001dc7005a4 pthreadwqthread + 272 (pthread.c:2193) 14 libsystempthread.dylib 0x00000001dc703874 startwqthread + 8]]
Asked
Last updated .
Post marked as unsolved
46 Views

Duplicated Start Threads

I've been running into an issue where any programs I write in a main function continue to run after return 0. I noticed I have 2 start threads under main in the debug window when I'm running it, but I'm unsure how to get rid of the duplicated one. Anyone have this problem before?
Asked
by skomariv.
Last updated .
Post marked as unsolved
75 Views

Error In Project In The Beginning

I'm building a project that uses SwiftUi, Swift Ui template, CoreData and CloudKit and I automatically get the error "cannot find the item in scope" located in my content view twice. Why does that happen when I select CloudKit before building the project?
Asked
by ZoneX.
Last updated .
Post marked as unsolved
103 Views

xcode not completely removing a build from the device when pushing a new build

This started a couple of months ago. Every new build I send from Xcode over to my iPad appears to leave data from the previous build, which seems like it's cached somewhere and never used after that. Considering I am losing about 500M per session I get the device "out of memory" error often. Deleting my app completely erases everything so I can recover. More of an annoyance than critical bug, except when running my iPad mini. I have a 16G mini and normally only have about 2G free. Naturally that gets eaten up about every 3 or 4 runs. When I clear out things I have to reset a bunch of preferences to my test set. Waste of time. It doesn't do this when I launch from the device, only when Xcode is doing it. This is with iOS14 and Xcode 12.2B2. But seems to go back to the final days of Xcode 11 on my mac. Anyone else see this?
Asked
by proxima.
Last updated .
Post marked as unsolved
306 Views

Crash: IndexPath.section.getter + 168

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
Asked
by egalindo.
Last updated .
Post marked as unsolved
87 Views

xcode 12.0.1 issues

after downloading xcode 12.0.1 and invoking : xcode-select --install (in order to use gcc and gfortran) the following library is still missing: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/" only: "/Library/Developer/" exists Any help to solve this issue please Thank you all Richard
Asked
by radiela.
Last updated .
Post marked as unsolved
274 Views

xcode-select --install

I ve downloaded xcode version 12.0.1 my OSX is catalina When I invoked "xcode-select -- install" (terminal) I got this error: "xcode-select: note: install requested for command line developer tools" A prompt message appears to invite me to download it but the command line software or app is no longer on apple developper website (at the end) I have to use gfortran (gcc) which requires some libraries created by xcode but which are not ; so bug for xcode. Any help would be very much appreciated Thank you in advance Richard R.
Asked
by radiela.
Last updated .