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

App repeatedly crashing seconds after start for one user #180

Open
torfluor opened this issue Apr 19, 2022 · 2 comments
Open

App repeatedly crashing seconds after start for one user #180

torfluor opened this issue Apr 19, 2022 · 2 comments

Comments

@torfluor
Copy link

One of my users reported that the app suddenly began crashing on his iPad whenever he opened it. This happened after he had installed the same app on his iPhone, enabled syncing with CloudKit and added some documents on his phone. Deleting the app and reinstalling it from App Store solved his issue.

I got his stack trace from Crashlytics. It was reported 11 times from the same device. Unfortunately I'm not able to reproduce the issue, but I though I should report it in case the stack trace makes sense to somebody.

Maybe this issue in realm-core is related? realm/realm-core#5387

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x7b78 __pthread_kill + 8
1  libsystem_pthread.dylib        0x73bc pthread_kill + 268
2  libsystem_c.dylib              0x2051c abort + 168
3  Timeline Pro                   0x92be24 std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_stringstream() + 803 (sstream:803)
4  Timeline Pro                   0x92c028 realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 123 (terminate.cpp:123)
5  Timeline Pro                   0x92c160 realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 140 (terminate.cpp:140)
6  Timeline Pro                   0x6e3f88 realm::ArrayBacklink::erase(unsigned long) + 138 (array_backlink.cpp:138)
7  Timeline Pro                   0x6e3f48 realm::ArrayBacklink::remove(unsigned long, realm::ObjKey) + 715 (array.hpp:715)
8  Timeline Pro                   0x76be70 realm::Obj::remove_one_backlink(realm::ColKey, realm::ObjKey) + 1724 (obj.cpp:1724)
9  Timeline Pro                   0x6f7618 realm::Cluster::remove_backlinks(realm::ObjKey, realm::ColKey, std::__1::vector<realm::ObjKey, std::__1::allocator<realm::ObjKey> > const&, realm::CascadeState&) const + 1468 (cluster.cpp:1468)
10 Timeline Pro                   0x6fd498 realm::Cluster::do_erase_key(unsigned long, realm::ColKey, realm::CascadeState&) + 245 (new:245)
11 Timeline Pro                   0x6fc95c realm::util::FunctionRef<bool (realm::ColKey)>::FunctionRef<realm::Cluster::erase(realm::ObjKey, realm::CascadeState&)::$_3&>(realm::Cluster::erase(realm::ObjKey, realm::CascadeState&)::$_3&)::'lambda'(void*, realm::ColKey)::__invoke(void*, realm::ColKey) + 893 (cluster.cpp:893)
12 Timeline Pro                   0x8ff338 realm::TableClusterTree::for_each_and_every_column(realm::util::FunctionRef<bool (realm::ColKey)>) const + 46832 (table.hpp:46832)
13 Timeline Pro                   0x6f6b78 realm::Cluster::erase(realm::ObjKey, realm::CascadeState&) + 1539 (vector:1539)
14 Timeline Pro                   0x703744 realm::ClusterTree::erase(realm::ObjKey, realm::CascadeState&) + 964 (cluster_tree.cpp:964)
15 Timeline Pro                   0x8f6008 realm::Table::remove_object(realm::ObjKey) + 3363 (table.cpp:3363)
16 Timeline Pro                   0x76744c realm::Obj::remove() + 187 (obj.cpp:187)
17 Timeline Pro                   0x53f934 RLMDeleteObjectFromRealm + 190 (RLMObjectStore.mm:190)
18 Timeline Pro                   0x4e1768 closure #1 in RealmSwiftAdapter.deleteRecords(with:) + 1096 (RealmSwiftAdapter.swift:1096)
19 Timeline Pro                   0x4ede34 partial apply for closure #1 in executeOnMainQueue(_:) + 4348501556 (<compiler-generated>:4348501556)
20 Timeline Pro                   0x4ede64 partial apply for thunk for @callee_guaranteed () -> () + 4348501604 (<compiler-generated>:4348501604)
21 Timeline Pro                   0x4d8a38 thunk for @escaping @callee_guaranteed () -> () + 4348414520 (<compiler-generated>:4348414520)
22 libdispatch.dylib              0x3a2c _dispatch_client_callout + 20
23 libdispatch.dylib              0x12d68 _dispatch_async_and_wait_invoke + 92
24 libdispatch.dylib              0x3a2c _dispatch_client_callout + 20
25 libdispatch.dylib              0x11f48 _dispatch_main_queue_drain + 928
26 libdispatch.dylib              0x11b98 _dispatch_main_queue_callback_4CF + 44
27 CoreFoundation                 0x522f0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
28 CoreFoundation                 0xc1f4 __CFRunLoopRun + 2532
29 CoreFoundation                 0x1f6b8 CFRunLoopRunSpecific + 600
30 GraphicsServices               0x1374 GSEventRunModal + 164
31 UIKitCore                      0x513e88 -[UIApplication _run] + 1100
32 UIKitCore                      0x2955ec UIApplicationMain + 364
33 Timeline Pro                   0xbbf4 main + 32 (SearchManager.swift:32)
34 ???                            0x1010b1ce4 (Missing)
@mentrena
Copy link
Owner

The trace alone doesn't ring any bells, but it seems to have to do with deleting objects. Did the user maybe add objects, then delete some of them, before installing the app on a second device and then syncing? Would you able to reproduce doing something like that?

@aehlke
Copy link

aehlke commented May 27, 2023

I recommend trying to make the deletion code more resilient to unexpected failure in this case, if the fallback results in valid state

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

No branches or pull requests

3 participants