Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS8 / iPhone6+ XPC crash

I have an app build on the iOS8 SDK which I archive and then sign for adhoc distribution.

This has been working for 2 years on all devices with various updates. Now I have an iPhone 6 plus.

The app ran fine the first after a new install but now it keeps crashing with error:

"XPC API Misuse: Given object not of required type"

This happens before it gets into didFinishLaunchingWithOptions

Call stack:

Thread 0 name: XPC API Misuse: Given object not of required type. Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libxpc.dylib 0x0000000197dd99d8 _xpc_api_misuse + 60 1 libxpc.dylib 0x0000000197dd99d4 _xpc_api_misuse + 56 2 libxpc.dylib 0x0000000197dc9ae8 xpc_dictionary_set_value + 88 3 libxpc.dylib 0x0000000197dc5538 xpc_dictionary_set_string + 48 4 CoreFoundation 0x0000000186e4b590 _CFXNotificationRemoveObservers + 912 5 Foundation 0x0000000187d1ff20 -[NSNotificationCenter removeObserver:name:object:] + 252 6 UIKit 0x000000018b8588e4 -[UITableView dealloc] + 96 7 UIKit 0x000000018b6bf510 -[UIView(Hierarchy) removeFromSuperview] + 696 8 UIKit 0x000000018b79cb24 -[UIScrollView removeFromSuperview] + 76 9 UIKit 0x000000018b6c219c -[UIView dealloc] + 444 10 CoreFoundation 0x0000000186e217e4 CFRelease + 520 11 CoreFoundation 0x0000000186e2dda4 -[__NSArrayM dealloc] + 148 12 libobjc.A.dylib 0x0000000197599720 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 560 13 CoreFoundation 0x0000000186e25400 _CFAutoreleasePoolPop + 24 14 Foundation 0x0000000187d1f180 -[NSAutoreleasePool release] + 144 15 UIKit 0x000000018b72f9ac -[UIApplication _run] + 584 16 UIKit 0x000000018b72a980 UIApplicationMain + 1484 17 HelloWorld 0x000000010000636c main (main.m:16) 18 libdyld.dylib 0x0000000197beea04 start + 0

Can anyone help?

like image 467
techsMex Avatar asked Nov 01 '22 15:11

techsMex


2 Answers

I fixed the crash in my own app but I can't 100% pin point the root cause. I suspect it was memory corruption or over retaining an object.

The key was [UITableView dealloc] I implemented dealloc in my table view to see where problem was occurring. I eventually traced it down to a UITableViewCell instantiated from a .xib file. This particular .xib contained multiple UITableViewCells. After giving each table view it's own .xib the crash disappeared.

like image 62
techsMex Avatar answered Nov 15 '22 07:11

techsMex


for me, I got xpc api Misuse crash when I ran some video editing code from the simulator!(iOS 13), the problem doesn't appear on real device.

like image 27
Mostfa Essam Avatar answered Nov 15 '22 07:11

Mostfa Essam