element-hq / element-hq/element-ios
Crash in CommonConfiguration.setupSettingsWhenLoaded(for:)
- Dominant language
- Swift
- Stars
- 1.8k
- Forks
- 544
- PR merge metrics
- PR metrics pending
Description
It happens on 1.6.1:
```
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000104b20d2c
Exception Note: EXC_CORPSE_NOTIFY
Terminating Process: exc handler [7856]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 Riot 0x0000000104b20d2c Swift runtime failure: Unexpectedly found nil while implicitly unwrapping an Optional value + 0 (CommonConfiguration.swift:0)
1 Riot 0x0000000104b20d2c CommonConfiguration.setupSettingsWhenLoaded(for:) + 0 (CommonConfiguration.swift:108)
2 Riot 0x0000000104b20d2c @objc CommonConfiguration.setupSettingsWhenLoaded(for:) + 124 (:106)
3 Riot 0x0000000104b20cf0 CommonConfiguration.setupSettingsWhenLoaded(for:) + 16 (CommonConfiguration.swift:108)
4 Riot 0x0000000104b20cf0 @objc CommonConfiguration.setupSettingsWhenLoaded(for:) + 64 (:106)
5 Riot 0x00000001049d7814 __39-[LegacyAppDelegate initMatrixSessions]_block_invoke + 538644 (LegacyAppDelegate.m:1840)
6 Foundation 0x00000001850f05f8 -[__NSObserver _doit:] + 316 (NSNotification.m:327)
7 CoreFoundation 0x00000001839a0c5c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:652)
8 CoreFoundation 0x0000000183a35564 ___CFXRegistrationPost_block_invoke + 48 (CFNotificationCenter.c:173)
9 CoreFoundation 0x0000000183a0ab44 _CFXRegistrationPost + 416 (CFNotificationCenter.c:199)
10 CoreFoundation 0x00000001839b5764 _CFXNotificationPost + 696 (CFNotificationCenter.c:1147)
11 Foundation 0x00000001850d6c98 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (NSNotification.m:560)
12 MatrixSDK 0x00000001093702b0 -[MXSession setState:] + 396 (MXSession.m:317)
13 MatrixSDK 0x000000010937baa0 __63-[MXSession handleBackgroundSyncCacheIfRequiredWithCompletion:]_block_invoke_4 + 2013856 (MXSession.m:1954)
14 MatrixSDK 0x00000001093a7678 thunk for @escaping @callee_unowned @convention(block) (@unowned @escaping @callee_unowned @convention(block) () -> ()) -> () + 84 (:0)
15 MatrixSDK 0x00000001093a7678 partial apply for thunk for @escaping @callee_unowned @convention(block) (@unowned @escaping @callee_unowned @convention(block) () -> ()) -> () + 112
16 MatrixSDK 0x00000001093a7734 closure #1 in closure #1 in MXAsyncTaskQueue.async(execute:) + 56 (MXAsyncTaskQueue.swift:48)
17 MatrixSDK 0x00000001093a7734 partial apply for closure #1 in closure #1 in MXAsyncTaskQueue.async(execute:) + 80 (:0)
18 MatrixSDK 0x00000001093a4c44 thunk for @escaping @callee_guaranteed () -> () + 20 (:0)
19 libdispatch.dylib 0x00000001836d52ec _dispatch_call_block_and_release + 24 (init.c:1516)
20 libdispatch.dylib 0x00000001836d62f0 _dispatch_client_callout + 16 (object.m:560)
21 libdispatch.dylib 0x00000001836829a0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 936 (inline_internal.h:2597)
22 CoreFoundation 0x00000001839c57f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1795)
23 CoreFoundation 0x00000001839830f8 __CFRunLoopRun + 2528 (CFRunLoop.c:3144)
24 CoreFoundation 0x0000000183995d8c CFRunLoopRunSpecific + 572 (CFRunLoop.c:3268)
25 GraphicsServices 0x000000019daa29a0 GSEventRunModal + 160 (GSEvent.c:2200)
26 UIKitCore 0x00000001861cb018 -[UIApplication _run] + 1080 (UIApplication.m:3457)
27 UIKitCore 0x0000000185f5f29c UIApplicationMain + 2060 (UIApplication.m:5013)
28 Riot 0x0000000104ae6078 main + 68 (AppDelegate.swift:21)
29 dyld 0x00000001066b0190 start + 444 (dyldMain.cpp:876)
Contributor guide
Research direction
Start at CommonConfiguration.swift line 108 and trace setupSettingsWhenLoaded(for:) from the MXSession state notification shown in the stack trace. Inspect the related LegacyAppDelegate.m call path to determine which implicitly unwrapped value is nil; done means the reported crash no longer occurs for the affected startup or session-loading flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100