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

Segmentation fault when passing unexpected user object to sync #1348

Closed
kraenhansen opened this issue Sep 26, 2017 · 5 comments
Closed

Segmentation fault when passing unexpected user object to sync #1348

kraenhansen opened this issue Sep 26, 2017 · 5 comments

Comments

@kraenhansen
Copy link
Member

kraenhansen commented Sep 26, 2017

Goals

Passing unexpected arguments to the Realm.open, specifically passing a promise as user on the sync config object.

Expected Results

An error message describing the issue.

Actual Results

 Segmentation fault: 11

Steps to Reproduce

Create a new directory, initialize an npm package and install Realm JS

npm init && npm install realm

And then run the code sample.

Code Sample

const Realm = require("realm");
Realm.open({
  sync: {
    user: Promise.resolve()
  }
});

Version of Realm and Tooling

  • Realm JS SDK Version: 2.15.3
  • Node or React Native: Node v8.4.0
  • Client OS & Version: Mac
  • Which debugger for React Native: None
@kneth
Copy link
Contributor

kneth commented Sep 26, 2017

I imagine that parameter validation in JavaScript can be hard, while TypeScript we are stricter (see for example https://github.com/realm/realm-js/blob/2.0.x/lib/index.d.ts#L347).

@roberhofer
Copy link
Contributor

@kneth , @kraenhansen : is this still an outstanding issue? Should this be part of the Robustification effort?

@kraenhansen
Copy link
Member Author

I just reproduced this crash with the latest Realm JS (v2.15.3) and updated the description to match this. As to @kneth's comment above, TypeScript parameter validation doesn't exist at runtime, so that won't help our users much.

@kneth
Copy link
Contributor

kneth commented Sep 20, 2018

We should go through populate_sync_config to see if we can add more validation to avoid situation like this.

@kneth
Copy link
Contributor

kneth commented Jan 4, 2022

Released in v11.10.0

@kneth kneth closed this as completed Jan 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants