Reputation: 35002
I'm suddenly getting a SIGABRT
in dispatch_once
as shown in Xcode below.
No changes have been recently added that use dispatch_once
.
dispatch_once(predicate, block);
Thread 1: signal SIGABRT
#if DISPATCH_ONCE_INLINE_FASTPATH
DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
DISPATCH_SWIFT3_UNAVAILABLE("Use lazily initialized globals instead")
void
_dispatch_once(dispatch_once_t *predicate,
DISPATCH_NOESCAPE dispatch_block_t block)
{
if (DISPATCH_EXPECT(*predicate, ~0l) != ~0l) {
dispatch_once(predicate, block);
} else {
dispatch_compiler_barrier();
}
DISPATCH_COMPILER_CAN_ASSUME(*predicate == ~0l);
}
#undef dispatch_once
#define dispatch_once _dispatch_once
#endif
#endif // DISPATCH_ONCE_INLINE_FASTPATH
Upvotes: 6
Views: 2823
Reputation: 35002
In my case this issue occurred when a Storyboard and Class files were added to the project, and automatically added to the main Target, but not added to the Target Membership of the secondary Target.
The issue only occurred in the iOS Simulator, using the Target we use specifically for the simulator.
The issue was not caught by the compiler due to no real references to the class. Instead, a stringly-typed reference to the Storyboard name was used to construct the view:
[UIStoryboard storyboardWithName:@"storyboardFileThatWasNotAddedToThisTarget" bundle:nil];
Fixed by adding the new files to the secondary Target:
Found issue by adding an Exception Breakpoint to the Xcode debugger.
Upvotes: 1
Reputation: 40236
I was using Realm
and the crash happens when I updated the Xcode
but pod was not updated. Make sure you update your pods using,
pod repo update
pod update
If you get permission issue run with sudo
.
From realm website,
Realm model properties must have the @objc dynamic var attribute to become accessors for the underlying database data. Note that if the class is declared as @objcMembers (Swift 4 or later), the individual properties can just be declared as dynamic var.
Upvotes: 1