xbmc / Official-Kodi-Remote-iOS

Full-featured remote control for XBMC Media Center. It features library browsing, now playing informations and a direct remote control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash -[UINib instantiateWithOwner:options:] + 456 (UINib.m:403)

wutschel opened this issue · comments

@kambala-decapitator, these issues were reported a few times with older App version as well -- for RightMenuViewController and and also for DetailViewController. Any idea where to look at?

Incident Identifier: CD9D10C6-33E5-4C91-9CF5-7B46EA19FAAE
Hardware Model:      iPhone12,1
Process:             Kodi Remote [48120]
Path:                /private/var/containers/Bundle/Application/B7754C50-469B-4A21-B663-8D11A317EB2D/Kodi Remote.app/Kodi Remote
Identifier:          it.joethefox.XBMC-Remote
Version:             1.11 (3475)
AppStoreTools:       14A305
AppVariant:          1:iPhone12,1:15
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           it.joethefox.XBMC-Remote [891]

Date/Time:           2022-10-22 06:39:58.3602 +0200
Launch Time:         2022-10-17 08:49:58.8137 +0200
OS Version:          iPhone OS 15.6.1 (19G82)
Release Type:        User
Baseband Version:    3.04.01
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x1adebd288 __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib               	0x1c6bed744 objc_exception_throw + 60 (objc-exception.mm:565)
2   CoreFoundation                	0x1adf14390 +[NSException raise:format:] + 112 (NSException.m:156)
3   UIKitCore                     	0x1b07d6648 -[UINib instantiateWithOwner:options:] + 456 (UINib.m:403)
4   UIKitCore                     	0x1b0e8d814 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 148 (UINibLoading.m:24)
5   Kodi Remote                   	0x100be49bc -[RightMenuViewController tableView:cellForRowAtIndexPath:] + 180 (RightMenuViewController.m:79)
6   UIKitCore                     	0x1b05289c4 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1532 (UITableView.m:16287)
7   UIKitCore                     	0x1b0726030 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 732 (UITableView.m:3093)
8   UIKitCore                     	0x1b054dbbc -[UITableView _updateVisibleCellsNow:] + 1432 (UITableView.m:3230)
9   UIKitCore                     	0x1b041ded8 -[UITableView layoutSubviews] + 456 (UITableView.m:10423)
10  UIKitCore                     	0x1b042e17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592 (UIView.m:18426)
11  QuartzCore                    	0x1b1ba67fc CA::Layer::layout_if_needed(CA::Transaction*) + 532 (CALayer.mm:10118)
12  QuartzCore                    	0x1b1b98c60 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136 (CALayer.mm:2480)
13  QuartzCore                    	0x1b1bad5b4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452 (CAContextInternal.mm:2612)
14  QuartzCore                    	0x1b1bb64a8 CA::Transaction::commit() + 704 (CATransactionInternal.mm:449)
15  QuartzCore                    	0x1b1b983a0 CA::Transaction::flush_as_runloop_observer(bool) + 88 (CATransactionInternal.mm:956)
16  CoreFoundation                	0x1ade650c4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1804)
17  CoreFoundation                	0x1ade34080 __CFRunLoopDoObservers + 592 (CFRunLoop.c:1917)
18  CoreFoundation                	0x1ade2f13c __CFRunLoopRun + 1052 (CFRunLoop.c:2979)
19  CoreFoundation                	0x1ade42bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
20  GraphicsServices              	0x1c9fae374 GSEventRunModal + 164 (GSEvent.c:2200)
21  UIKitCore                     	0x1b07b6b58 -[UIApplication _run] + 1100 (UIApplication.m:3511)
22  UIKitCore                     	0x1b0538090 UIApplicationMain + 364 (UIApplication.m:5064)
23  Kodi Remote                   	0x100b2678c main + 88 (main.m:15)
24  dyld                          	0x100e79da4 start + 520 (dyldMain.cpp:879)

Kernel Triage:
VM - Compressor failed a blocking pager_get

Code for RightMenuViewController:

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rightMenuCell"];
    [[NSBundle mainBundle] loadNibNamed:@"rightCellView" owner:self options:NULL];
    if (cell == nil) {
        cell = rightMenuCell;
...

Code for DetailViewController:

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
    jsonDataCell *cell = [tableView dequeueReusableCellWithIdentifier:@"jsonDataCellIdentifier"];
    NSDictionary *item = [self getItemFromIndexPath:indexPath];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"jsonDataCell" owner:self options:nil];
        cell = nib[0];
...

Can this somehow be related to xib files which were last changed using an old toolsVersion?

I'd suggest to get rid of xibs and create those cells in code - I doubt they're quite complex

So, can be related to xib or corrupt nibs, and nothing I can do about this in the current code. Right?

I'm not sure what's the reason tbh, although I doubt that it has something to do with old toolsVersion.

If other xib-loading code follows the same logic and doesn't crash, then it's probably related to the xibs themselves somehow.

I did a change which unifies the usage of loadNibNamed and the use of cell identifiers. This also updates some xibs to the current tool version. Not sure, if this somehow helps, but it improves consistency.

Branch: loadNibNamed

unification is an improvement for sure, although I doubt it'd fix anything.

I've checked the nib crashes: they occur only on iOS 15 devices, this is already a pattern. You could check SO and apple developer forums, maybe others also suffer from that.

unification is an improvement for sure, although I doubt it'd fix anything.

I've checked the nib crashes: they occur only on iOS 15 devices, this is already a pattern. You could check SO and apple developer forums, maybe others also suffer from that.

Sadly you were right. The first crash reported for 1.12 is again

Last Exception Backtrace:
0   CoreFoundation                	0x1bdb00e38 __exceptionPreprocess + 164 (NSException.m:202)
1   libobjc.A.dylib               	0x1b6c978d8 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                	0x1bdbf0c28 +[NSException raise:format:] + 112 (NSException.m:0)
3   UIKitCore                     	0x1bff6357c -[UINib instantiateWithOwner:options:] + 336 (UINib.m:404)
4   UIKitCore                     	0x1c06f9524 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 116 (UINibLoading.m:24)
5   Kodi Remote                   	0x1003f4758 -[RightMenuViewController tableView:cellForRowAtIndexPath:] + 124 (RightMenuViewController.m:97)
...