Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-254

Errors inside Subscription listener will cause native crash

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: None

      In ReactNative If an error is thrown into a subscription's listener, this will crash the entire app

      var dogs = realm.objects('Dog')
      subscription = dogs.subscribe()
      subscription.addListener((collection, state) => {
                  if (state === Realm.Sync.SubscriptionState.Complete) {
                    throw "error";
                  }
      })
      

      will crash with

      9-18 17:56:26.619   144   144 I /system/bin/tombstoned: received crash request for pid 3278
      09-18 17:56:26.619  3548  3548 I crash_dump32: performing dump of process 3278 (target tid = 3536)
      09-18 17:56:26.620  3548  3548 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
      09-18 17:56:26.620  3548  3548 F DEBUG   : Build fingerprint: 'Android/vbox86p/vbox86p:8.0.0/OPR6.170623.017/32:userdebug/test-keys'
      09-18 17:56:26.620  3548  3548 F DEBUG   : Revision: '0'
      09-18 17:56:26.620  3548  3548 F DEBUG   : ABI: 'x86'
      09-18 17:56:26.620  3548  3548 F DEBUG   : pid: 3278, tid: 3536, name: mqt_js  >>> com.rnwithsync <<<
      09-18 17:56:26.620  3548  3548 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
      09-18 17:56:26.620  3548  3548 F DEBUG   :     eax 00000000  ebx 00000cce  ecx 00000dd0  edx 00000006
      09-18 17:56:26.620  3548  3548 F DEBUG   :     esi 00000dd0  edi cc85b188
      09-18 17:56:26.620  3548  3548 F DEBUG   :     xcs 00000023  xds 0000002b  xes 0000002b  xfs 0000006b  xss 0000002b
      09-18 17:56:26.620  3548  3548 F DEBUG   :     eip ee746ba9  ebp cc85b1a8  esp cc85b13c  flags 00000296
      09-18 17:56:26.761  3548  3548 F DEBUG   :
      09-18 17:56:26.761  3548  3548 F DEBUG   : backtrace:
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #00 pc 00000ba9  [vdso:ee746000] (__kernel_vsyscall+9)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #01 pc 00075dcc  /system/lib/libc.so (tgkill+28)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #02 pc 0001f05e  /system/lib/libc.so (abort+110)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #03 pc 0065c274  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so (_ZN9__gnu_cxx27__verbose_terminate_handlerEv+452)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #04 pc 006071e7  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so (_ZN10__cxxabiv111__terminateEPFvvE+23)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #05 pc 0060727f  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so (_ZSt9terminatev+31)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #06 pc 006073c0  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so (__cxa_throw+112)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #07 pc 000e799b  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #08 pc 000e7a03  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #09 pc 00139e4c  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #10 pc 001552a7  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #11 pc 0025eee2  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #12 pc 0029b209  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #13 pc 002ad421  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #14 pc 001ddb67  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #15 pc 001e2199  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #16 pc 001e2280  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #17 pc 001dfe51  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #18 pc 001e0b98  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #19 pc 0021d9bd  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #20 pc 0021ab9d  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #21 pc 001f87a5  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #22 pc 00289097  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #23 pc 00233417  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #24 pc 00233c8a  /data/app/com.rnwithsync-bNTA7wkX8jMlEymz6LceLQ==/lib/x86/librealmreact.so
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #25 pc 00014977  /system/lib/libutils.so (_ZN7android20SimpleLooperCallback11handleEventEiiPv+39)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #26 pc 000157ac  /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+988)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #27 pc 00015346  /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+118)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #28 pc 000e4c7b  /system/lib/libandroid_runtime.so (_ZN7androidL38android_os_MessageQueue_nativePollOnceEP7_JNIEnvP8_jobjectxi+59)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #29 pc 007b4198  /system/framework/x86/boot-framework.oat (offset 0x5e6000) (android.app.NativeActivity.onWindowFocusChangedNative [DEDUPED]+136)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #30 pc 0000cf50  /dev/ashmem/dalvik-jit-code-cache (deleted)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #31 pc 4e0cbedf  <unknown>
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #32 pc 0d3fffff  /dev/ashmem/dalvik-main space (region space) (deleted)
      09-18 17:56:26.761  3548  3548 F DEBUG   :     #33 pc 0d3fffff  /dev/ashmem/dalvik-main space (region space) (deleted)
      

      @kneth not sure if this is a known issue?

            Assignee:
            Unassigned Unassigned
            Reporter:
            nabil.hachicha@mongodb.com Nabil Hachicha
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: