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

Regression: iOS upgrading 57 -> 59 lots of crashes "Exception in HostObject::get: <unknown>" #24607

Closed
DimitryDushkin opened this issue Apr 25, 2019 · 4 comments
Labels
Bug Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@DimitryDushkin
Copy link

DimitryDushkin commented Apr 25, 2019

💥 Regression Report

We've released iOS app with upgrade RN from 0.57 to 0.59.4 and receiving a lot of crash reports (like 5% of users so far)

Crash:
Crash file

Application Specific Information:
*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Exception in HostObject::get: <unknown>', reason: 'Unhandled JS Exception: Exception in HostObject::get: <unknown>, stack:
h@2:1670
h@2:1670
h@2:1670
h@2:1670
h@2:1670
h@2:1670
h@2:1670
d@2:868
global code@12:4
'

Thread 7 crashed with ARM-64 Thread State:

Extra Information:

Application Stats:
{
    "active_time_since_last_crash": 7.45225e+10,
    "active_time_since_launch": 0,
    "application_active": false,
    "application_in_foreground": true,
    "background_time_since_last_crash": 4.64477e+10,
    "background_time_since_launch": 0,
    "launches_since_last_crash": 419,
    "sessions_since_last_crash": 727,
    "sessions_since_launch": 1
}

CrashDoctor Diagnosis: Application threw exception RCTFatalException: Unhandled JS Exception: Exception in HostObject::get: <unknown>: Unhandled JS Exception: Exception in HostObject::get: <unknown>, stack:
h@2:1670
h@2:1670
h@2:1670
h@2:1670
h@2:1670
h@2:1670
h@2:1670
d@2:868
global code@12:4

Originated at or in a subcall of facebook::react::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)

Last working version

0.57

Worked up to version:

Stopped working in version:
0.59.4

To Reproduce

Random and rare crash on app startup.

Expected Behavior

Code Example

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 50.57 MB / 16.00 GB
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 11.5.0 - ~/.nvm/versions/node/v11.5.0/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v11.5.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5264788
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.6 => 16.8.6
      react-native: 0.59.4 => 0.59.4
@DimitryDushkin DimitryDushkin added Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Type: Bug Report labels Apr 25, 2019
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Apr 25, 2019
@DimitryDushkin
Copy link
Author

I've tried to put breakpoints near

auto proxy = static_cast<HostObjectProxy*>(JSObjectGetPrivate(object));
, but it is not executed in runtime.

@thymikee
Copy link
Contributor

@mhorowitz the error points to the code you wrote in a23fb1a, could you advise?

@DimitryDushkin
Copy link
Author

DimitryDushkin commented Apr 26, 2019

We've added this patch, hope it will help us to find crash source

--- node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp	2019-04-26 17:08:37.000000000 +0300
+++ node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp	2019-04-26 17:08:42.000000000 +0300
@@ -565,7 +565,7 @@
         auto excValue =
             rt.global()
                 .getPropertyAsFunction(rt, "Error")
-                .call(rt, "Exception in HostObject::get: <unknown>");
+                .call(rt, std::string("Exception in HostObject::get:") + JSStringToSTLString(propertyName));
         *exception = rt.valueRef(excValue);
         return JSValueMakeUndefined(ctx);
       }

@DimitryDushkin
Copy link
Author

DimitryDushkin commented Apr 28, 2019

We've found the problem — getting native module with buggy constantsToExport caused the error. So it is not RN 59 problem. Still native module name in crash will be very helpful, so I proposed some small change in #24633

facebook-github-bot pushed a commit that referenced this issue Apr 29, 2019
…oad (#24633)

Summary:
After upgrading RN from 0.57 to 0.59.4 we've received a lot of crash reports like `Exception in HostObject::get: <unknown>`  with no clue what native module caused the crash. This commit adds native module name on crash in this situations. Related to #24607.

[General] [Added] - Report native module name on crash when native module has failed to load
Pull Request resolved: #24633

Differential Revision: D15120225

Pulled By: cpojer

fbshipit-source-id: cf8e3e5953548a58f1d010eb70343da5ee946ae8
@facebook facebook locked as resolved and limited conversation to collaborators Apr 28, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants