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

Crash in realm::SlabAlloc::free_block during realm write #8152

Closed
Arthur-Guillaume opened this issue Feb 27, 2023 · 3 comments
Closed

Crash in realm::SlabAlloc::free_block during realm write #8152

Arthur-Guillaume opened this issue Feb 27, 2023 · 3 comments
Labels

Comments

@Arthur-Guillaume
Copy link

Arthur-Guillaume commented Feb 27, 2023

How frequently does the bug occur?

Sometimes

Description

Hello,

We have released a new version of our app with the latest realm-swift version (10.36.0).
Previous version was 10.32.3.

Since then we have many crashes in production. We are not able to reproduce at the moment.

Looking at the analytics events or OS version do not help find something similar to all occurrences.
Issue happens indifferently at the first run after the update or whatever a realm migration is executed or not.

Please, feel free to ask for any relevant information.

Stacktrace & log output

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x7674 __pthread_kill + 8
1  libsystem_pthread.dylib        0x71ac pthread_kill + 268
2  libsystem_c.dylib              0x20c8c abort + 180
3  app_name                        0xb109f0 realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 209340
4  app_name                        0xb10d30 realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 210172
5  app_name                        0xb10eac realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&) + 210552
6  app_name                        0x887e5c realm::SlabAlloc::free_block(unsigned long, realm::SlabAlloc::FreeBlock*) + 1275416
7  app_name                        0x887c38 realm::SlabAlloc::do_free(unsigned long, char*) + 1274868
8  app_name                        0x904a14 realm::Node::do_copy_on_write(unsigned long) + 31496
9  app_name                        0x88c20c realm::Array::set(unsigned long, long long) + 1292744
10 app_name                        0x9049e8 realm::Node::do_copy_on_write(unsigned long) + 31452
11 app_name                        0x88c20c realm::Array::set(unsigned long, long long) + 1292744
12 app_name                        0x9049e8 realm::Node::do_copy_on_write(unsigned long) + 31452
13 app_name                        0x88c20c realm::Array::set(unsigned long, long long) + 1292744
14 app_name                        0x9049e8 realm::Node::do_copy_on_write(unsigned long) + 31452
15 app_name                        0x88c20c realm::Array::set(unsigned long, long long) + 1292744
16 app_name                        0x9049e8 realm::Node::do_copy_on_write(unsigned long) + 31452
17 app_name                        0x88c20c realm::Array::set(unsigned long, long long) + 1292744
18 app_name                        0x9049e8 realm::Node::do_copy_on_write(unsigned long) + 31452
19 app_name                        0x88c108 realm::Array::truncate(unsigned long) + 1292484
20 app_name                        0x8de154 realm::StringIndex::clear() + 275408
21 app_name                        0xad60e8 realm::Table::clear_indexes() + 960896
22 app_name                        0x8b4864 realm::ClusterTree::clear(realm::CascadeState&) + 105184
23 app_name                        0xadc794 realm::Table::clear() + 987180
24 app_name                        0x96da48 realm::Results::clear() + 15356
25 app_name                        0x78d148 RLMClearTable(RLMClassInfo&) + 248068
26 app_name                        0x85fa78 -[RLMResults deleteObjectsFromRealm] + 1110580
27 app_name                        0x856ee8 -[RLMRealm deleteObjects:] + 1074852
28 app_name                        0x1605f4 specialized closure #1 in closure #1 in RealmRepository.allObjects.setter + 4334339572 (<compiler-generated>:4334339572)
29 app_name                        0x482d4 thunk for @callee_guaranteed () -> (@error @owned Error) + 4333191892 (<compiler-generated>:4333191892)
30 app_name                        0x1647dc partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) + 4334356444 (<compiler-generated>:4334356444)
31 app_name                        0x165904 thunk for @callee_guaranteed () -> (@error @owned Error)partial apply + 4334360836
32 app_name                        0xb80848 Realm.write<A>(withoutNotifying:_:) + 667668
33 app_name                        0x15c8fc specialized closure #1 in RealmRepository.allObjects.setter + 4334323964
34 app_name                        0x164ae0 partial apply for specialized closure #1 in RealmRepository.allObjects.setter + 4334357216 (<compiler-generated>:4334357216)
35 app_name                        0x1652fc partial apply for specialized closure #1 in RealmRepository.doWorkForApp(block:) + 4334359292 (<compiler-generated>:4334359292)
36 app_name                        0x4ae70c thunk for @escaping @callee_guaranteed () -> () + 4337805068 (<compiler-generated>:4337805068)
37 libdispatch.dylib              0x2460 _dispatch_call_block_and_release + 32
38 libdispatch.dylib              0x3f88 _dispatch_client_callout + 20
39 libdispatch.dylib              0x127f4 _dispatch_main_queue_drain + 928
40 libdispatch.dylib              0x12444 _dispatch_main_queue_callback_4CF + 44
41 CoreFoundation                 0x9a6c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
42 CoreFoundation                 0x7c02c __CFRunLoopRun + 2036
43 CoreFoundation                 0x80eb0 CFRunLoopRunSpecific + 612
44 GraphicsServices               0x1368 GSEventRunModal + 164
45 UIKitCore                      0x3a1668 -[UIApplication _run] + 888
46 UIKitCore                      0x3a12cc UIApplicationMain + 340
47 app_name                        0x10048 main + 4332961864 (<compiler-generated>:4332961864)

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

10.36.0

What Atlas Services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

iOS 15+

Build environment

Xcode version: 14.2
Dependency manager and version: Tuist & SPM

ProductName:		macOS
ProductVersion:		13.2.1
BuildVersion:		22D68

/Applications/Xcode.app/Contents/Developer
Xcode 14.2
Build version 14C18

/Users/arthur/.rbenv/shims/pod
1.11.3
(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin22)

carthage not found
(not in use here)

/usr/bin/git
git version 2.37.1 (Apple Git-137.1)
@jedelbo
Copy link

jedelbo commented Mar 7, 2023

@Arthur-Guillaume do you use Dictionaries in your schema?

@sync-by-unito sync-by-unito bot changed the title Crash during realm write Crash in realm::SlabAlloc::free_block during realm write Mar 15, 2023
@bmunkholm
Copy link
Contributor

Ping @Arthur-Guillaume

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Mar 15, 2023
@dianaafanador3
Copy link
Contributor

Closing this as there is no response from the user and there is already an open issue on core as well.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants