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 Table handover failed: not a group level table #6234

Closed
RetVal opened this issue Aug 22, 2019 · 3 comments · Fixed by realm/realm-object-store#842
Closed

Crash Table handover failed: not a group level table #6234

RetVal opened this issue Aug 22, 2019 · 3 comments · Fixed by realm/realm-object-store#842

Comments

@RetVal
Copy link

RetVal commented Aug 22, 2019

Goals

add / remove notifications block.

Expected Results

Crash free.

Actual Results

RLMRealm Notification Listener crashed with Table handover failed: not a group level table.

libc++abi.dylib: terminating with uncaught exception of type realm::util::ExceptionWithBacktrace<std::runtime_error>: Table handover failed: not a group level table
Exception backtrace:
0   ****                                0x00000001047eb846 _ZN5realm4util22ExceptionWithBacktraceISt13runtime_errorEC1IJRA47_KcEEEDpOT_ + 38
1   ****                                0x00000001047eb788 _ZN5realm5Table14generate_patchEPKS0_RNSt3__110unique_ptrINS_18TableHandoverPatchENS3_14default_deleteIS5_EEEE + 344
2   ****                                0x0000000104710f3c _ZN5realm11SharedGroup25export_table_for_handoverERKNS_13BasicTableRefINS_5TableEEE + 108
3   ****                                0x00000001032e35fe _ZN5realm5_impl21PrimitiveListNotifier14do_detach_fromERNS_11SharedGroupE + 78
4   ****                                0x0000000103246cae _ZN5realm5_impl18CollectionNotifier6detachEv + 30
5   ****                                0x00000001032f0046 _ZN5realm5_impl16RealmCoordinator19run_async_notifiersEv + 1190
6   ****                                0x00000001032efad9 _ZN5realm5_impl16RealmCoordinator9on_changeEv + 25
7   ****                                0x000000010325d11f _ZN5realm5_impl20ExternalCommitHelper6listenEv + 735
8   ****                                0x0000000103260928 _ZZN5realm5_impl20ExternalCommitHelperC1ERNS0_16RealmCoordinatorEENK3$_0clEv + 24
9   ****                                0x00000001032608cd _ZNSt3__1L8__invokeIZN5realm5_impl20ExternalCommitHelperC1ERNS2_16RealmCoordinatorEE3$_0JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS7_DpOS8_ + 29
10  ****                                0x0000000103260835 _ZNSt3__1L16__thread_executeINS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEZN5realm5_impl20ExternalCommitHelperC1ERNS7_16RealmCoordinatorEE3$_0JEJEEEvRNS_5tupleIJT_T0_DpT1_EEENS_15__tuple_indicesIJXspT2_EEEE + 37
11  ****                                0x0000000103260106 _ZNSt3__114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN5realm5_impl20ExternalCommitHelperC1ERNS8_16RealmCoordinatorEE3$_0EEEEEPvSE_ + 118
12  libsystem_pthread.dylib             0x0000000113a4c2eb _pthread_body + 126
13  libsystem_pthread.dylib             0x0000000113a4f249 _pthread_start + 66
14  libsystem_pthread.dylib             0x0000000113a4b40d thread_start + 13

Steps to Reproduce

in multi-thread (with runloop) environment

  1. [thread 0] add notification to an rlm array, which one was a property of the target instance repeatedly. (get a PrimitiveListNotifier behind, committed to new_notifiers in coordinator, but was not processed by ExternalCommitHelper yet).

  2. [thread 1] delete the target instance repeatedly.

  3. [thread 2] addOrUpdate target instance repeatedly.

  4. crash happened.

Code Sample

reproduce code smaple

Version of Realm and Tooling

ProductName:    Mac OS X
ProductVersion: 10.14.4
BuildVersion:   18E226

/Applications/Xcode.app/Contents/Developer
Xcode 10.2.1
Build version 10E1001

/usr/local/bin/pod
1.7.5
Realm (3.17.3)
Realm (= 3.17.3)

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

/usr/local/bin/carthage
0.31.2
(not in use here)

/usr/bin/git
git version 2.20.1 (Apple Git-117)
@tgoyne tgoyne self-assigned this Aug 23, 2019
@RetVal
Copy link
Author

RetVal commented Aug 27, 2019

any update? @tgoyne

@RetVal
Copy link
Author

RetVal commented Sep 3, 2019

Hi, any update @tgoyne

@tgoyne
Copy link
Member

tgoyne commented Sep 18, 2019

realm/realm-object-store#842 will fix this. Turns out the problematic case was when the object containing the observed list was deleted before the notifier got the chance to run the first time (but as long as it's run at least once it worked).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants