expo: Expo Go Android SIGSEGV from eas update on uncaught exception

Summary

Crash only happens with eas update builds but not expo-cli publish builds. Seems to be related to:

const VERSION = Constants.manifest.version;
console.log("App started. version: " + VERSION + ", platform: " + Platform.OS);

Related adb logcat output (full output available if needed):

11-12 11:10:12.075 10888 11552 E ReactNativeJS: TypeError: null is not an object (evaluating 's.default.manifest.version')
11-12 11:10:12.085 10888 11552 E ReactNativeJS: Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
11-12 11:10:12.085 10888 11552 E ReactNativeJS:         A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
11-12 11:10:12.163 10888 11553 F libc    : Fatal signal 11 (SIGSEGV), code 2, fault addr 0x2f27778b80 in tid 11553 (mqt_native_modu), pid 10888 (st.exp.exponent)
11-12 11:10:12.323 11663 11663 F DEBUG   : pid: 10888, tid: 11553, name: mqt_native_modu  >>> host.exp.exponent <<<
11-12 11:10:12.323 11663 11663 F DEBUG   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x2f27778b80
11-12 11:10:12.323 11663 11663 F DEBUG   :     x0   0000002f27778b80  x1   0000000000000000  x2   0000002f1c25f1e0  x3   0000000000000000
11-12 11:10:12.323 11663 11663 F DEBUG   :     x4   0000000000000008  x5   0000002f0fdad8a0  x6   00000000ebad808a  x7   00000000ebad808b
11-12 11:10:12.323 11663 11663 F DEBUG   :     x8   434c4e47432b2b00  x9   0000002f0eded150  x10  0000002f0eded150  x11  0000000000000000
11-12 11:10:12.323 11663 11663 F DEBUG   :     x12  0000002f0edeb408  x13  0000000000000000  x14  0000000000000008  x15  0000000000000008
11-12 11:10:12.323 11663 11663 F DEBUG   :     x16  0000000000000020  x17  0000000000000020  x18  0000000000000000  x19  0000002f0edecb60
11-12 11:10:12.323 11663 11663 F DEBUG   :     x20  0000002f1c25f1e0  x21  0000000000000001  x22  0000002f27765e98  x23  0000002f0f0a3000
11-12 11:10:12.323 11663 11663 F DEBUG   :     x24  0000000000000008  x25  0000002f0edee588  x26  0000002f0fdad8a0  x27  0000000000000002
11-12 11:10:12.323 11663 11663 F DEBUG   :     x28  0000000000000001  x29  0000002f0edeca70  x30  0000002f27a2fc90
11-12 11:10:12.323 11663 11663 F DEBUG   :     sp   0000002f0edeca70  pc   0000002f27a33bdc  pstate 0000000060000000
11-12 11:10:12.323 11503 11664 W ResourceType: ResTable_typeSpec entry count inconsistent: given 3309, previously 3332
11-12 11:10:12.323 11503 11664 W ResourceType: ResTable_typeSpec entry count inconsistent: given 518, previously 4352
11-12 11:10:12.325 11663 11663 F DEBUG   :
11-12 11:10:12.325 11663 11663 F DEBUG   : backtrace:
11-12 11:10:12.325 11663 11663 F DEBUG   :     #00 pc 00000000000b2bdc  /data/app/host.exp.exponent-2wHZZj3JJyyGtWa01OPtsw==/split_config.arm64_v8a.apk (offset 0x3000)
11-12 11:10:12.325 11663 11663 F DEBUG   :     #01 pc 00000000000aec8c  /data/app/host.exp.exponent-2wHZZj3JJyyGtWa01OPtsw==/split_config.arm64_v8a.apk (offset 0x3000)
11-12 11:10:12.325 11663 11663 F DEBUG   :     #02 pc 00000000000224e8  /data/app/host.exp.exponent-2wHZZj3JJyyGtWa01OPtsw==/split_config.arm64_v8a.apk (offset 0x145d000)

What platform(s) does this occur on?

Android

Environment

$ npx expo-env-info

  expo-env-info 1.0.5 environment info:
    System:
      OS: Linux 6.0 Fedora Linux 35 (Xfce)
      Shell: 5.1.8 - /bin/bash
    Binaries:
      Node: 16.14.0 - /usr/bin/node
      Yarn: 1.22.18 - /usr/local/bin/yarn
      npm: 8.3.1 - /usr/bin/npm
      Watchman: 0.0.0 - /usr/bin/watchman
    npmPackages:
      @expo/webpack-config: ^0.17.2 => 0.17.3 
      expo: ~47.0.3 => 47.0.3 
      react: 18.1.0 => 18.1.0 
      react-dom: 18.1.0 => 18.1.0 
      react-native: 0.70.5 => 0.70.5 
      react-native-web: ~0.18.9 => 0.18.10 
    npmGlobalPackages:
      eas-cli: 2.7.0
      expo-cli: 6.0.8
    Expo Workflow: managed

Minimal reproducible example

  1. git clone https://github.com/findhumane/manifestcrash
  2. cd manifestcrash
  3. npm install
  4. eas update
  5. Open link, e.g., https://expo.dev/accounts/findhumane/projects/manifestcrash/updates/897bbf1e-3484-4c22-b418-e1386ae74e3a
  6. Click Preview under Android and scan the QR code with Expo Go

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

@findhumane Could you try Constants.expoConfig.version instead? The Constants.manifest API was designed for classic updates and is null with EAS Update.

We’ll update the docs to recommend using expoConfig instead of manifest or manifest2. Deprecating them might be a little too aggressive for now but all new code should use Constants.expoConfig instead.

Additionally, we are looking into making this error clearer. You did all the right things making a repro project and using adb logcat, and the error message should have indicated more clearly what to do.

@ide Confirmed that expoConfig fixes it. Much better than having to check for both manifest and manifest2. Updating the docs and making a clearer error would be great. Thanks!

@findhumane I think it would make sense to change the title of this issue to something like this: Expo Go Android SIGSEGV from eas update on uncaught exception

@baochungit

As far as I know you can’t fetch and install an eas update on Expo Go

You can. See steps 4-6 in the reproduction steps:

4. eas update 5. Open link [produced by eas update], e.g., https://expo.dev/accounts/findhumane/projects/manifestcrash/updates/897bbf1e-3484-4c22-b418-e1386ae74e3a 6. Click Preview under Android and scan the QR code with Expo Go

OK, so I think there are two separate issues here:

  • Referencing Constants.manifest.version when using EAS Update
  • Expo Go crashes with a segmentation fault

Fine, maybe Constants.manifest.version doesn’t work with EAS Update and the code should be changed to use one of the other version-like things mentioned in the Constants docs.

But regardless of that, Expo Go should not get a segfault!