Post

Replies

Boosts

Views

Activity

[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] Crash
In iOS 18, we encountered a crash: Thread 4 name: com.apple.root.user-interactive-qos Thread 4 Crashed: 0 CoreFoundation 0x18c4f9b10 __CFCheckCFInfoPACSignature + 4 1 CoreFoundation 0x18c53ed64 CFBundleGetInfoDictionary + 24 2 CoreFoundation 0x18c53ed1c CFBundleGetIdentifier + 16 3 Foundation 0x18b153740 -[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] + 84 4 UIKitCore 0x18ef26ef0 ___UIKitUserDefaults_block_invoke + 40 5 libdispatch.dylib 0x1941ee0d0 _dispatch_client_callout + 20 6 libdispatch.dylib 0x1941ef918 _dispatch_once_callout + 32 7 UIKitCore 0x18ef9de28 _UIKitUserDefaults + 80 8 UIKitCore 0x18f058a7c ___UIKitPreferencesOnce_block_invoke + 20 9 libdispatch.dylib 0x1941ee0d0 _dispatch_client_callout + 20 10 libdispatch.dylib 0x1941ef918 _dispatch_once_callout + 32 11 UIKitCore 0x18f056c8c _UIKitPreferencesOnce + 80 12 UIKitCore 0x18f0563b8 ___UIApplicationMainPreparations_block_invoke + 20 13 libdispatch.dylib 0x1941ec370 _dispatch_call_block_and_release + 32 14 libdispatch.dylib 0x1941ee0d0 _dispatch_client_callout + 20 15 libdispatch.dylib 0x1941fff60 _dispatch_root_queue_drain + 860 16 libdispatch.dylib 0x194200590 _dispatch_worker_thread2 + 156 17 libsystem_pthread.dylib 0x2136ffc40 _pthread_wqthread + 228 18 libsystem_pthread.dylib 0x2136fc488 start_wqthread + 8 Below image show more details: And after set a symbol breakpoint: [NSUserDefaults _initWithSuiteName:container:] We found that at the beginning of app launch, the system will call it: It not always crash, but sometimes especially when app upgrade, what the root cause maybe?
2
0
73
1d
[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] Crash
When using: [[NSUserDefaults alloc] initWithSuiteName:@"TestSuiteName"]; It sometimes cause crash, the crash detail is: Thread 4 name: com.apple.root.user-interactive-qos Thread 4 Crashed: 0 CoreFoundation 0x1963f9b10 __CFCheckCFInfoPACSignature + 4 1 CoreFoundation 0x19643ed64 CFBundleGetInfoDictionary + 24 2 CoreFoundation 0x19643ed1c CFBundleGetIdentifier + 16 3 Foundation 0x195053740 -[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] + 84 4 UIKitCore 0x198e26ef0 ___UIKitUserDefaults_block_invoke + 40 5 libdispatch.dylib 0x19e0ee0d0 _dispatch_client_callout + 20 6 libdispatch.dylib 0x19e0ef918 _dispatch_once_callout + 32 7 UIKitCore 0x198e9de28 _UIKitUserDefaults + 80 8 UIKitCore 0x198f58a7c ___UIKitPreferencesOnce_block_invoke + 20 9 libdispatch.dylib 0x19e0ee0d0 _dispatch_client_callout + 20 10 libdispatch.dylib 0x19e0ef918 _dispatch_once_callout + 32 11 UIKitCore 0x198f56c8c _UIKitPreferencesOnce + 80 12 UIKitCore 0x198f563b8 ___UIApplicationMainPreparations_block_invoke + 20 13 libdispatch.dylib 0x19e0ec370 _dispatch_call_block_and_release + 32 14 libdispatch.dylib 0x19e0ee0d0 _dispatch_client_callout + 20 15 libdispatch.dylib 0x19e0fff60 _dispatch_root_queue_drain + 860 16 libdispatch.dylib 0x19e100590 _dispatch_worker_thread2 + 156 17 libsystem_pthread.dylib 0x21d7dfc40 _pthread_wqthread + 228 18 libsystem_pthread.dylib 0x21d7dc488 start_wqthread + 8 and for more detail crash info can see the attachment image . And Refer to the API's description: /// -initWithSuiteName: initializes an instance of NSUserDefaults that searches the shared preferences search list for the domain 'suitename'. For example, using the identifier of an application group will cause the receiver to search the preferences for that group. Passing the current application's bundle identifier, NSGlobalDomain, or the corresponding CFPreferences constants is an error. Passing nil will search the default search list. - (nullable instancetype)initWithSuiteName:(nullable NSString *)suitename API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) NS_DESIGNATED_INITIALIZER; It seems using a constants string is a wrong way. Does any one know what to root cause?
2
0
83
1d
Fatal Exception: NSInternalInconsistencyException Attempting to select a view controller that isn't a child! (null)
When call: [UITabBarController setViewControllers:animated:] It crashed and raise an Fatal Exception: Fatal Exception: NSInternalInconsistencyException Attempting to select a view controller that isn't a child! (null) the crash stack is: Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x8408c __exceptionPreprocess 1 libobjc.A.dylib 0x172e4 objc_exception_throw 2 Foundation 0x82215c _userInfoForFileAndLine 3 UIKitCore 0x38a468 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] 4 UIKitCore 0x3fa8a4 -[UITabBarController _setSelectedViewController:performUpdates:] 5 UIKitCore 0x3fa710 -[UITabBarController setSelectedIndex:] 6 UIKitCore 0x8a5fc +[UIView(Animation) performWithoutAnimation:] 7 UIKitCore 0x3e54e0 -[UITabBarController _setViewControllers:animated:] 8 UIKitCore 0x45d7a0 -[UITabBarController setViewControllers:animated:] And it appear sometimes, what's the root cause?
2
0
414
Nov ’24
App crash on launch using Xcode 15 and iOS 14 simulator
When use Xcode15 and iOS 14 simulator to run app, it will crash, and the crash stack is: Thread 1 Queue : com.apple.main-thread (serial) #0 0x0000000104b074a5 in __cxx_global_var_init.4 () #1 0x000000014fb6ec95 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) () #2 0x000000014fb6f08a in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) () #3 0x000000014fb69bb7 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) () #4 0x000000014fb67ec7 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) () #5 0x000000014fb67f68 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) () #6 0x000000014fb5b26b in dyld::initializeMainExecutable() () #7 0x000000014fb5ff56 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) () #8 0x000000014fb5a1c2 in start_sim () #9 0x000000024760e424 in dyld4::prepareSim(dyld4::RuntimeState&, char const*) () #10 0x000000024760cabc in dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) () #11 0x000000024760c3bd in start () And I found two same issues: 1.https://issuetracker.google.com/issues/301372178; 2.https://github.com/realm/realm-swift/issues/8369 From these two issue, I know Xcode15 use new linker(ld_prime), and not support iOS <15; So if we want to support iOS 14, we only have one solution that add the -Wl,-ld_classic options to the OTHER_LDFLAGS? And for now, the crash only happened in iOS 14 simulator, but will it affect the iPhone device if we don't add the -Wl,-ld_classic options to the OTHER_LDFLAGS?
0
0
860
Nov ’23
dyld load 'libbz2.1.0.dylib' fail
I have a app that need to use libbz, and when use Xcode to build and launch, it will crash and the console will print: dyld log And I found when I set the compiler settings for debug: Optimization Level -> Fastest, smallest[-Os] Link Time Optimization -> No the crash does not appear. but for debug, I think the the right compiler settings is: Optimization Level -> None[-O0] Link Time Optimization -> Increment why this happened and what can I do to fix it?
0
0
740
Feb ’23
UINavigarionBar height maybe incorrect
in iOS16, there are A viewController, and when push to a new ViewController, and the new ViewController sets it's navigationItem.titleView to a UISearchBar, and then pop back to A viewController, the UINavigarionBar's height is incorrect. is there any methods I can recover the UINavigarionBar's height?
0
0
293
Nov ’22