Skip to content

Commit

Permalink
Document process to symbolicate with new npms
Browse files Browse the repository at this point in the history
Reviewed By: dulinriley, Huxpro

Differential Revision: D22407294

fbshipit-source-id: 31e8c30214f0a0c53b32f20e55632e8b56f25cdc
  • Loading branch information
mhorowitz authored and facebook-github-bot committed Aug 4, 2020
1 parent c48be7c commit 67c1681
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/01_bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ labels:
the red background section). Please also include a few lines of the JavaScript
source before and after the line in which the error occurs.
If it's an abort (e.g. app crashes), please try to provide native stack trace
to assist with debugging.
If it's an abort (e.g. app crashes), please see "Reporting crashes" from
<https://github.com/facebook/hermes/blob/master/doc/ReactNativeIntegration.md#reporting-native-crashes>
for instructions on reporting a native crash, including symbolicating the native
stack trace. Note this will only work with some versions of Hermes.
-->

- [ ] I have run `gradle clean` and confirmed this bug does not occur with JSC
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you want to know how to build and hack on Hermes directly, and/or integrate H
The instructions here very briefly cover steps to build the Hermes CLI. They assume you have typical native development tools setup for your OS, and support for cmake and Ninja. For more details of required dependencies, building Hermes with different options, etc. follow these links instead:

* [Building and Running Hermes](doc/BuildingAndRunning.md)
* [Using a custom Hermes build in a React Native app](doc/ReactNativeIntegration.md)
* [Using a custom Hermes build in a React Native app](doc/ReactNativeIntegration.md#using-a-custom-hermes-build-in-a-react-native-app)

To build a local debug version of the Hermes CLI tools the following steps should get you started on macOS/Linux:

Expand Down
18 changes: 18 additions & 0 deletions doc/ReactNativeIntegration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Reporting native crashes

If Hermes causes a native crash in your application, a stack trace is critical for us to be able to understand where the crash occurred. If you have a native crash to report, please be aware that in most cases, it is not feasible for us to debug crashes in earlier versions of Hermes. Please update your app to a hermes-engine npm versions 0.5.1, 0.5.2-rc1, or later. Version 0.5.0 is too old. This may require you to update React Native as well.

At a minimum, you should include in your bug report the native stack trace as described in the [the `ndk-stack` documentation.](https://developer.android.com/ndk/guides/ndk-stack) documentation

Including 10-20 lines from the logs before the line of asterisks can also help us understand what went wrong.

Additionally, you can also symbolicate the stack trace in order to indicate where in the Hermes source the failure is occurring. Symbolication will only work with the newer versions of Hermes listed above. It will not work with 0.5.0 or any earlier version.

The necessary unstripped libraries can be found in the [GitHub release](https://github.com/facebook/hermes/releases) corresponding to the Hermes NPM you used to build your application. Download the `hermes-runtime-android-vX.Y.Z.tar.gz` file for your version. Unpack the tar file, then run `ndk-stack` using the contained directory corresponding to the build flavor and architecture for your app. For example, for a release arm64 build:

```
$ANDROID_NDK/ndk-stack -sym .../unstripped-release/0/lib/arm64-v8a < crash.txt
```

Including the symbolicated stack trace will make it easier for us to address your bug report more quickly.

# Using a custom Hermes build in a React Native app

To make Hermes usable in a React Native app we need to perform the following steps:
Expand Down

0 comments on commit 67c1681

Please sign in to comment.