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

Segmentation fault when performing await realm.open(config)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      How frequently does the bug occur?

      All the time

      Description

      Trying to load an existing local realm file into a test MongoDB Realm App and using a node.js script to do so. However when calling realm.open() we are getting a segmentation fault.

      Node v16.13.0
      realm-js v10.10.1

      log in appears to work fine but the subsequent call results in a segmentation fault.

      const realmConfig = {
              schema: target_realm_schema,
              sync: {
                  user: app.currentUser,
                  partitionValue: partitionKey,
                  // The behavior to use when this is the first time opening a realm.
                  newRealmFileBehavior: {
                      type: "downloadBeforeOpen",
                      timeout: 120,
                      timeOutBehaviour: "openLocalRealm"
                  },
                  // The behavior to use when a realm file already exists locally,
                  // i.e. you have previously opened the realm.
                  existingRealmFileBehavior: {
                      type: "openImmediately",
                      timeout: 30,
                      timeOutBehaviour: "openLocalRealm"
                  },
              },
          };
      
          log("async open realm...")
          const target_realm = await Realm.open(realmConfig);
      

      Anyone have any suggestions on how to debug the cause of the segmentation fault ?

      Is the realm-js compatible with node v16.13.0 ?

      Thanks

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      There is no stack trace.
      

      Can you reproduce the bug?

      Yes, always

      Reproduction Steps

      Script can be provided

      Version

      V10.10.1

      What SDK flavour are you using?

      MongoDB Realm (i.e. Sync, auth, functions)

      Are you using encryption?

      No, not using encryption

      Platform OS and version(s)

      macOS 12.0.1

      Build environment

      Which debugger for React Native: N/A

      Here is the set fault

      PID 90660 received SIGSEGV for address: 0x3
      0 segfault-handler.node 0x0000000106bd1458 ZL16segfault_handleriP9_siginfoPv + 272
      1 libsystem_platform.dylib 0x000000019a6584e4 _sigtramp + 56
      2 realm.node 0x000000010f7a5928 ZZN5realm6common6logger6Logger17build_sync_loggerERNSt318functionIFviNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEENKUlNS_4util6Logger5LevelEE_clESG

      • 172
        3 realm.node 0x000000010f7a5928 ZZN5realm6common6logger6Logger17build_sync_loggerERNSt318functionIFviNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEENKUlNS_4util6Logger5LevelEE_clESG + 172
        4 realm.node 0x000000010f7a57e0 ZNSt3110function6funcIZN5realm6common6logger6Logger17build_sync_loggerERNS_8functionIFviNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEEEUlNS2_4util6Logger5LevelEE_NSA_ISJ_EEFNS_10unique_ptrISH_NS_14default_deleteISH_EEEESI_EEclEOSI + 36
        5 realm.node 0x000000010f8d394c _ZNK5realm11SyncManager18create_sync_clientEv + 68
        6 realm.node 0x000000010f8d2a48 ZN5realm11SyncManager11get_sessionENSt3_110shared_ptrINS_2DBEEERKNS_10SyncConfigE + 92
        7 realm.node 0x000000010f87731c _ZN5realm5_impl16RealmCoordinator19create_sync_sessionEv + 204
        8 realm.node 0x000000010f879d24 _ZN5realm5_impl16RealmCoordinator22get_synchronized_realmENS_5Realm6ConfigE + 88
        9 realm.node 0x000000010f850538 _ZN5realm5Realm22get_synchronized_realmENS0_6ConfigE + 108
        10 realm.node 0x000000010f6b85f8 _ZN5realm2js10RealmClassINS_4node5TypesEE16async_open_realmEN4Napi3EnvENS5_6ObjectERNS0_9ArgumentsIS3_EERNS0_11ReturnValueIS3_EE + 652
        11 realm.node 0x000000010f69ebf4 _ZN5realm2js4wrapIXadL_ZNS0_10RealmClassINS_4node5TypesEE16async_open_realmEN4Napi3EnvENS6_6ObjectERNS0_9ArgumentsIS4_EERNS0_11ReturnValueIS4_EEEEEENS6_5ValueERKNS6_12CallbackInfoE + 244
        12 realm.node 0x000000010f6ed4b0 ZN4Napi7details12WrapCallbackIZNS_10ObjectWrapIN5realm4node13WrappedObjectINS3_2js10RealmClassINS4_5TypesEEEEEE27StaticMethodCallbackWrapperEP10napi_envP20napi_callback_infoEUlvE_EEP12napi_valueT + 60
        13 realm.node 0x000000010f6ed468 ZN4Napi10ObjectWrapIN5realm4node13WrappedObjectINS1_2js10RealmClassINS2_5TypesEEEEEE27StaticMethodCallbackWrapperEP10napi_envP20napi_callback_info_ + 28
        14 node 0x000000010242c6f8 ZN6v8impl12_GLOBAL_N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE + 104
        15 node 0x000000010262032c _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 276
        16 node 0x000000010261fe24 ZN2v88internal12_GLOBAL_N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 468
        17 node 0x000000010261f6b0 _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE + 228
        18 node 0x0000000102d5d1cc Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
        19 node 0x0000000102cf0d18 Builtins_InterpreterEntryTrampoline + 248
        20 node 0x0000000102da3700 Builtins_PromiseConstructor + 2176
        21 node 0x0000000102cedf50 Builtins_JSBuiltinsConstructStub + 368
        22 node 0x0000000102dec070 Builtins_ConstructHandler + 656
        23 node 0x0000000102cf0d18 Builtins_InterpreterEntryTrampoline + 248
        24 node 0x0000000102cf0d18 Builtins_InterpreterEntryTrampoline + 248
        25 node 0x0000000102cf0d18 Builtins_InterpreterEntryTrampoline + 248
        26 node 0x0000000102d20314 Builtins_AsyncFunctionAwaitResolveClosure + 84
        27 node 0x0000000102da51b8 Builtins_PromiseFulfillReactionJob + 56
        28 node 0x0000000102d126f4 Builtins_RunMicrotasks + 596
        29 node 0x0000000102cee9e4 Builtins_JSRunMicrotasksEntry + 164
        30 node 0x00000001026c31e8 ZN2v88internal12_GLOBAL_N_16InvokeEPNS0_7IsolateERKNS1_12InvokeParamsE + 2332
        31 node 0x00000001026c361c ZN2v88internal12_GLOBAL_N_118InvokeWithTryCatchEPNS0_7IsolateERKNS1_12InvokeParamsE + 88

            Assignee:
            franck.franck@mongodb.com Franck Franck (Inactive)
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: