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

[ios] App crash on concurrent native modules call #518

Open
1 task
seland opened this issue Sep 11, 2018 · 1 comment
Open
1 task

[ios] App crash on concurrent native modules call #518

seland opened this issue Sep 11, 2018 · 1 comment

Comments

@seland
Copy link
Contributor

seland commented Sep 11, 2018

Feature / Issue

Observation

It was tried to call PanthalassaCall to get contacts and documents on login. Since the calls are driven by sagas, they was called almost at the same time. It turns out into a crash (means the app crash, not a red screen).

Investigation

It was found that arguments on native modules methods are incorrect in the case described above. Specifically, all of them are nil. That cause the crash when trying to call a callback - resolve or reject.

Explanation

It looks like initialization code of RCTModuleMethod is not thread-safe, therefore when we are calling some native method at the same cycle twice (when it's the first call of that method till now) it cause concurrent initialization, which cause some arguments to not be retained correctly, which in turn cause them to be nil.

Acceptance criteria

  • No crash on concurrent call

Additional information

As a quick workaround we can just call each method one time somewhere at start of the app to be sure that initialization is done.

@seland seland added bug and removed bug labels Sep 11, 2018
@seland
Copy link
Contributor Author

seland commented Sep 12, 2018

Related to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant