Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RLMGetSwiftPropertyString(obj, key) #7941

Open
mr-grey opened this issue Sep 2, 2022 · 8 comments
Open

RLMGetSwiftPropertyString(obj, key) #7941

mr-grey opened this issue Sep 2, 2022 · 8 comments

Comments

@mr-grey
Copy link

mr-grey commented Sep 2, 2022

How frequently does the bug occur?

Sometimes

Description

I think in old data there was set object NSNULL

from crash logs discovered:
public static func rlmGetPropertyOptional( obj: ObjectBase, _ key: PropertyKey) -> String? {
return RLMGetSwiftPropertyString(obj, key) <--- crash
}

Screenshot 2022-09-02 at 10 15 44

Fatal Exception: NSInvalidArgumentException
-[NSNull _fastCStringContents:]: unrecognized selector sent to instance 0x1e19bd120

in old model was String as optional

used library UNRealm
after update to clear realm we discovered some crashes like:

Crashed: serial-queue
0 libobjc.A.dylib 0x5bd0 class_getSuperclass + 4
1 Realm 0x5cf84 RLMIsObjectSubclass + 76
2 Realm 0x13a3a0 RLMRegisterClassLocalNames(objc_class**, unsigned long) + 128
3 Realm 0x13ac08 +[RLMSchema sharedSchema] + 104
4 Realm 0x12cb90 +[RLMRealm realmWithConfiguration:queue:error:] + 1580


Stacktrace & log output

No response

Can you reproduce the bug?

Not yet

Reproduction Steps

No response

Version

10.28.2

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

iOS

Build environment

Xcode Version 13.3.1 (13E500a)

@mr-grey
Copy link
Author

mr-grey commented Sep 2, 2022

also how about :
Fatal Exception: RLMException
std::bad_alloc

Fatal Exception: RLMException
0 CoreFoundation 0x99d78 __exceptionPreprocess
1 libobjc.A.dylib 0x16734 objc_exception_throw
2 Realm 0x1305e4 -[RLMRealm frozenCopy] + 1186 (RLMRealm.mm:1186)
3 Realm 0x1353f4 RLMGetFrozenRealmForSourceRealm(RLMRealm*) + 91 (RLMRealmUtil.mm:91)
4 Realm 0x1303c8 -[RLMRealm freeze] + 1167 (RLMRealm.mm:1167)
5 Realm 0x5f9b8 RLMObjectFreeze + 511 (RLMObjectBase.mm:511)
6 RealmSwift 0x6d5a4 specialized Realm.freeze(_:) + 953 (Realm.swift:953)
7 RealmSwift 0x4d544 RealmSwiftObject.freeze() + 112 (Object.swift:112)

@leemaguire
Copy link
Contributor

@mr-grey we will investigate the NSNull issue. For the second stack trace, could you send us a code sample of how you were using Realm? Were threads involved, was the app in the background etc?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Sep 2, 2022
@mr-grey
Copy link
Author

mr-grey commented Sep 2, 2022

there is callback:
Screenshot 2022-09-02 at 11 20 38

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Sep 2, 2022
@mr-grey
Copy link
Author

mr-grey commented Sep 2, 2022

 static func getByPrimaryKey(uuid: String, realm: Realm? = try? Realm()) -> RealmUser? {
        guard let realm = realm else { return nil }
        return realm.object(ofType: RealmUser.self, forPrimaryKey: uuid)
    }

@leemaguire
Copy link
Contributor

What is the objective-c exception that it is throwing? Can you send the complete stack trace which would show this?

@mr-grey
Copy link
Author

mr-grey commented Sep 2, 2022

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

Last Exception Backtrace:
0   CoreFoundation                	0x18c3b1d78 __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib               	0x1a5016734 objc_exception_throw + 60 (objc-exception.mm:565)
2   Realm                         	0x10ae545e4 -[RLMRealm frozenCopy] + 344 (RLMRealm.mm:1186)
3   Realm                         	0x10ae593f4 RLMGetFrozenRealmForSourceRealm(RLMRealm*) + 300 (RLMRealmUtil.mm:91)
4   Realm                         	0x10ae543c8 -[RLMRealm freeze] + 72 (RLMRealm.mm:1167)
5   Realm                         	0x10ad839b8 RLMObjectFreeze + 116 (RLMObjectBase.mm:511)
6   RealmSwift                    	0x10b7a95a4 specialized Realm.freeze<A>(_:) + 24 (Realm.swift:953)
7   RealmSwift                    	0x10b789544 $s10RealmSwift0A0V6freezeyxxSo13RLMObjectBaseCRbzlFSo0aB6ObjectCXD_Ti5 + 12 (Object.swift:0)
8   RealmSwift                    	0x10b789544 RealmSwiftObject.freeze() + 68
9   Me                            	0x1053ab414 MergedUser.init(uuid:) + 444 (MergedUser.swift:89)
10  Me                            	0x104fe4d6c $s2Me20RealmNamesUserEntityV04fullD0AA06MergedD0Vvg + 28 (RealmNamesUserEntity.swift:38)
11  Me                            	0x104fe4d6c specialized SmallUser.init(nameUser:) + 164 (SmallUser.swift:348)
12  Me                            	0x104fe5a34 $s2Me9SmallUserV04nameC0AcA010RealmNamesC6EntityV_tcfC + 12 (<compiler-generated>:0)
13  Me                            	0x104fe5a34 specialized static SmallUser.update(nameUser:) + 1104 (SmallUser.swift:195)
14  Me                            	0x10549e674 $s2Me9SmallUserV6update04nameC0AcA010RealmNamesC6EntityV_tFZ + 12 (<compiler-generated>:0)
15  Me                            	0x10549e674 RealmNamesUserEntity.smallUser.getter + 768
16  Me                            	0x104fef730 closure #1 in NamesGroupTVC.setup(entity:searchText:filter:onCellTapAction:) + 80 (NamesGroupTVC.swift:69)
17  Me                            	0x10525a6dc specialized MutableCollection<>._insertionSort(within:sortedEnd:by:) + 360
18  Me                            	0x105257db0 $sSMsSKRzrlE14_insertionSort6within2byySny5IndexSlQzG_Sb7ElementSTQz_AHtKXEtKFSry2Me20RealmNamesUserEntityVG_Tg5 + 68 (<compiler-generated>:0)
19  Me                            	0x105257db0 specialized UnsafeMutableBufferPointer._stableSortImpl(by:) + 204
20  Me                            	0x105257530 specialized MutableCollection<>.sort(by:) + 140
21  Me                            	0x105257470 specialized MutableCollection<>.sort(by:) + 36
22  Me                            	0x104fef230 $sSTsE6sorted2bySay7ElementQzGSbAD_ADtKXE_tKFSay2Me20RealmNamesUserEntityVG_Tg5 + 36 (<compiler-generated>:0)
23  Me                            	0x104fef230 NamesGroupTVC.setup(entity:searchText:filter:onCellTapAction:) + 636 (NamesGroupTVC.swift:68)
24  Me                            	0x1050f5f1c NamesDataManager.tableView(_:cellForRowAt:) + 676 (NamesDataManager.swift:250)
25  Me                            	0x1050f7be4 @objc NamesDataManager.tableView(_:cellForRowAt:) + 140 (<compiler-generated>:0)
26  UIKitCore                     	0x18ea0ef20 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1532 (UITableView.m:16287)
27  UIKitCore                     	0x18ec0c330 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 732 (UITableView.m:3093)
28  UIKitCore                     	0x18ea34118 -[UITableView _updateVisibleCellsNow:] + 1432 (UITableView.m:3230)
29  UIKitCore                     	0x18e811b98 -[UITableView _cellForRowAtIndexPath:usingPresentationValues:] + 248 (UITableView.m:7732)
30  UIKitCore                     	0x18ebb06bc -[UITableView cellForRowAtIndexPath:] + 80 (UITableView.m:7690)
31  Me                            	0x1050b0064 $sSo11UITableViewC2MeE27screenshotOfCellAtIndexPath05indexI0So7UIImageCSgSo07NSIndexI0C_tF + 72 (UITableView+Additions.swift:17)
32  Me                            	0x1050b0064 specialized UITableView.screenshotExcludingHeadersAtSections(excludedHeaderSections:excludingFootersAtSections:excludingRowsAtIndexPaths:) + 1148 (UITableView+Additions.swift:103)
33  Me                            	0x1050afbc0 $sSo11UITableViewC2MeE36screenshotExcludingHeadersAtSections014excludedHeaderH0016excludingFootersgH00k4RowsG10IndexPathsSo7UIImageCSgSo5NSSetCSg_A2MtF + 12 (UITableView+Additions.swift:7)
34  Me                            	0x1050afbc0 $sSo11UITableViewC2MeE10screenshotSo7UIImageCSgvg + 12 (<compiler-generated>:0)
35  Me                            	0x1050afbc0 @objc UITableView.screenshot.getter + 36
36  Me                            	0x1052291c4 closure #2 in NamesViewController.shareNameIntent(social:) + 84 (NamesViewController.swift:810)
37  Me                            	0x1051e7308 $sSo11UITableViewC2MeE10reloadData10completionyyyc_tFySbcfU_ + 4 (UITableView+.swift:51)
38  Me                            	0x1051e7308 partial apply for closure #1 in UITableView.reloadData(completion:) + 20 (<compiler-generated>:0)
39  Me                            	0x10500cc34 thunk for @escaping @callee_guaranteed (@unowned Bool) -> () + 40 (<compiler-generated>:0)
40  UIKitCore                     	0x18fa30e4c __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ + 36 (UIView.m:14960)
41  UIKitCore                     	0x18ea1a7f4 -[UIViewAnimationBlockDelegate _sendDeferredCompletion:] + 120 (UIView.m:15004)
42  libdispatch.dylib             	0x18c016e68 _dispatch_call_block_and_release + 32 (init.c:1517)
43  libdispatch.dylib             	0x18c018a2c _dispatch_client_callout + 20 (object.m:560)
44  libdispatch.dylib             	0x18c026f48 _dispatch_main_queue_drain + 928 (inline_internal.h:2622)
45  libdispatch.dylib             	0x18c026b98 _dispatch_main_queue_callback_4CF + 44 (queue.c:7770)
46  CoreFoundation                	0x18c36a2f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
47  CoreFoundation                	0x18c3241f4 __CFRunLoopRun + 2532 (CFRunLoop.c:3144)
48  CoreFoundation                	0x18c3376b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
49  GraphicsServices              	0x1a83d1374 GSEventRunModal + 164 (GSEvent.c:2200)
50  UIKitCore                     	0x18ec9ce88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
51  UIKitCore                     	0x18ea1e5ec UIApplicationMain + 364 (UIApplication.m:5064)
52  Me                            	0x104f152a8 main + 68 (AppDelegate.swift:33)
53  dyld                          	0x109051ce4 start + 520 (dyldMain.cpp:879)

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage


Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001c3d20b78 __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001fd33c3bc pthread_kill + 268 (pthread.c:1668)
2   libsystem_c.dylib             	0x00000001974ec44c __abort + 128 (abort.c:155)
3   libsystem_c.dylib             	0x0000000197494528 abort + 180 (abort.c:126)
4   libc++abi.dylib               	0x00000001a5121b7c abort_message + 132 (abort_message.cpp:78)
5   libc++abi.dylib               	0x00000001a51119c4 demangling_terminate_handler() + 336 (cxa_default_handlers.cpp:71)
6   libobjc.A.dylib               	0x00000001a501cc88 _objc_terminate() + 144 (objc-exception.mm:701)
7   FirebaseCrashlytics           	0x0000000109d11264 FIRCLSTerminateHandler() + 340 (FIRCLSException.mm:452)
8   Me                            	0x000000010550ca54 hmd_cpp_terminate_handle() + 380 (HMDCrashDetectCPP.mm:114)
9   libc++abi.dylib               	0x00000001a5120f18 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
10  libc++abi.dylib               	0x00000001a5120eb4 std::terminate() + 64 (cxa_handlers.cpp:88)
11  libdispatch.dylib             	0x000000018c018a40 _dispatch_client_callout + 40 (object.m:563)
12  libdispatch.dylib             	0x000000018c026f48 _dispatch_main_queue_drain + 928 (inline_internal.h:2622)
13  libdispatch.dylib             	0x000000018c026b98 _dispatch_main_queue_callback_4CF + 44 (queue.c:7770)
14  CoreFoundation                	0x000000018c36a2f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
15  CoreFoundation                	0x000000018c3241f4 __CFRunLoopRun + 2532 (CFRunLoop.c:3144)
16  CoreFoundation                	0x000000018c3376b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
17  GraphicsServices              	0x00000001a83d1374 GSEventRunModal + 164 (GSEvent.c:2200)
18  UIKitCore                     	0x000000018ec9ce88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
19  UIKitCore                     	0x000000018ea1e5ec UIApplicationMain + 364 (UIApplication.m:5064)
20  Me                            	0x0000000104f152a8 main + 68 (AppDelegate.swift:33)
21  dyld                          	0x0000000109051ce4 start + 520 (dyldMain.cpp:879)

Thread 1:
0   libsystem_pthread.dylib       	0x00000001fd335e54 start_wqthread + 0 (:-1)

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Sep 7, 2022
@mr-grey
Copy link
Author

mr-grey commented Sep 27, 2022

also found some crash report from users
then try to read :

@persisted var phoneNumber

Screenshot 2022-09-27 at 11 26 55

Screenshot 2022-09-27 at 11 29 06

@nirinchev
Copy link
Member

This may be related to #8463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants