react-native-datetimepicker / datetimepicker

React Native date & time picker component for iOS, Android and Windows
MIT License
2.41k stars 394 forks source link

Crash when trying to use with Hermes engine enabled #276

Closed norbertschuler closed 3 years ago

norbertschuler commented 3 years ago

Bug report

Summary

I tried to run my react-native Android project with the Hermes engine enabled (enableHermes: true), but when I open a date picker (using react-native-modal-datetime-picker latest version 8.9.3 with @react-native-community/datetimepicker latest version 3.0.2), the app crashes while working well without using the Hermes engine:

Environment info

react-native info output:

System:
    OS: macOS 10.15.6
    CPU: (4) x64 Intel(R) Core(TM) i5-6287U CPU @ 3.10GHz
    Memory: 33.59 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.13.1 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.8 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /Users/norbertschuler/.gem/ruby/2.3.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.7, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 25, 27, 28, 29
      Build Tools: 27.0.3, 28.0.3, 29.0.2
      System Images: android-25 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom
      Android NDK: 21.3.6528147
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.7/11E801a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_131 - /usr/bin/javac
    Python: 2.7.17 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 3.0.2

Steps to reproduce

  1. Build this pull request of our project https://github.com/Plant-for-the-Planet-org/treecounter-app/pull/2694 and set enableHermes: true at https://github.com/Plant-for-the-Planet-org/treecounter-app/pull/2694/files#r486988512

  2. Try to register a new tree and click on the date field to choose the date from a picker: Screenshot_20200911-134250

  3. The app crashes as following:

    --------- beginning of crash
    09-11 13:14:25.781 16999 17110 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 17110 (mqt_js)
    09-11 13:14:25.782  2990  2990 W         : debuggerd: handling request: pid=16999 uid=10233 gid=10233 tid=17110
    09-11 13:14:25.805  2997  2997 E audit   : type=1400 audit(1599822865.791:1532): avc:  denied  { search } for  pid=17309 comm="debuggerd64" name="com.google.android.gms" dev="sda18" ino=721086 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0 SEPF_SECMOBILE_7.0_0010
    09-11 13:14:25.813  2997  2997 E audit   : type=1400 audit(1599822865.801:1533): avc:  denied  { search } for  pid=17309 comm="debuggerd64" name="com.google.android.gms" dev="sda18" ino=721086 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0 SEPF_SECMOBILE_7.0_0010
    09-11 13:14:25.817  2997  2997 E audit   : type=1400 audit(1599822865.801:1534): avc:  denied  { search } for  pid=17309 comm="debuggerd64" name="com.google.android.gms" dev="sda18" ino=721086 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0 SEPF_SECMOBILE_7.0_0010
    09-11 13:14:25.916 17309 17309 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    09-11 13:14:25.916 17309 17309 F DEBUG   : Build fingerprint: 'samsung/zeroltexx/zerolte:7.0/NRD90M/G925FXXU6ERF5:user/release-keys'
    09-11 13:14:25.916 17309 17309 F DEBUG   : Revision: '10'
    09-11 13:14:25.916 17309 17309 F DEBUG   : ABI: 'arm64'
    09-11 13:14:25.916 17309 17309 F DEBUG   : pid: 16999, tid: 17110, name: mqt_js  >>> org.pftp <<<
    09-11 13:14:25.916 17309 17309 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    09-11 13:14:25.916 17309 17309 F DEBUG   :     x0   0000000000000000  x1   00000000000042d6  x2   0000000000000006  x3   0000000000000008
    09-11 13:14:25.916 17309 17309 F DEBUG   :     x4   0000000000000000  x5   4000000000000000  x6   0000000000808000  x7   fefefefefefefefe
    09-11 13:14:25.917 17309 17309 F DEBUG   :     x8   0000000000000083  x9   ffffffffffffffdf  x10  0000000000000000  x11  0000000000000001
    09-11 13:14:25.917 17309 17309 F DEBUG   :     x12  ffffffffffffffff  x13  0000000000000000  x14  ffffffffffffffff  x15  0000000000000271
    09-11 13:14:25.917 17309 17309 F DEBUG   :     x16  00000079de65aee0  x17  00000079de6045ac  x18  00000079bd06bca0  x19  00000079aefcc4f8
    09-11 13:14:25.917 17309 17309 F DEBUG   :     x20  0000000000000006  x21  00000079aefcc450  x22  000000000000000b  x23  00000079aefcc4e8
    09-11 13:14:25.917 17309 17309 F DEBUG   :     x24  0000000000000000  x25  0000000000000001  x26  000000799cdc5800  x27  00000079b17fc7a8
    09-11 13:14:25.917 17309 17309 F DEBUG   :     x28  000000799ca9f9fc  x29  00000079aefc8650  x30  00000079de601a54
    09-11 13:14:25.917 17309 17309 F DEBUG   :     sp   00000079aefc8630  pc   00000079de6045b4  pstate 0000000060000000
    09-11 13:14:25.939 17309 17309 F DEBUG   :
    09-11 13:14:25.939 17309 17309 F DEBUG   : backtrace:
    09-11 13:14:25.939 17309 17309 F DEBUG   :     #00 pc 000000000006b5b4  /system/lib64/libc.so (tgkill+8)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #01 pc 0000000000068a50  /system/lib64/libc.so (pthread_kill+64)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #02 pc 0000000000023f68  /system/lib64/libc.so (raise+24)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #03 pc 000000000001c9ec  /system/lib64/libc.so (abort+52)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #04 pc 00000000000b8124  /data/app/org.pftp-2/lib/arm64/libc++_shared.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #05 pc 00000000000b43d4  /data/app/org.pftp-2/lib/arm64/libc++_shared.so (__gxx_personality_v0+364)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #06 pc 000000000003de2c  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #07 pc 000000000003e334  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so (_Unwind_Resume+116)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #08 pc 0000000000028008  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so (_ZN8facebook5react11JSIExecutor17callNativeModulesERKNS_3jsi5ValueEb+224)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #09 pc 000000000002a6ec  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #10 pc 0000000000021b54  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so (_ZNSt6__ndk110__function6__funcIN8facebook3jsi21DecoratedHostFunctionENS_9allocatorIS4_EEFNS3_5ValueERNS3_7RuntimeERKS7_PSA_mEEclES9_SB_OSC_Om+68)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #11 pc 0000000000034b70  /data/app/org.pftp-2/lib/arm64/libhermes.so (_ZN8facebook6hermes17HermesRuntimeImpl9HFContext4funcEPvPN6hermes2vm7RuntimeENS5_10NativeArgsE+324)
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #12 pc 00000000000540e8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #13 pc 0000000000057bb8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #14 pc 000000000005539c  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #15 pc 00000000000e6af4  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #16 pc 00000000000540e8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #17 pc 0000000000057bb8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #18 pc 000000000005539c  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #19 pc 00000000000e6af4  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #20 pc 00000000000540e8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #21 pc 0000000000057bb8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #22 pc 000000000005539c  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #23 pc 0000000000042420  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #24 pc 0000000000054138  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.940 17309 17309 F DEBUG   :     #25 pc 0000000000057bb8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #26 pc 000000000005539c  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #27 pc 0000000000041440  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #28 pc 00000000000e67a0  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #29 pc 00000000000540e8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #30 pc 0000000000057bb8  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #31 pc 000000000005539c  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #32 pc 0000000000042420  /data/app/org.pftp-2/lib/arm64/libhermes.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #33 pc 000000000002dd18  /data/app/org.pftp-2/lib/arm64/libhermes.so (_ZN8facebook6hermes17HermesRuntimeImpl4callERKNS_3jsi8FunctionERKNS2_5ValueEPS7_m+564)
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #34 pc 000000000002adac  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so (_ZNK8facebook3jsi8Function4callIJRKNSt6__ndk112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_NS0_5ValueEEEESC_RNS0_7RuntimeEDpOT_+240)
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #35 pc 000000000002ac08  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #36 pc 000000000002505c  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so (_ZNSt6__ndk128__invoke_void_return_wrapperIvE6__callIJRPFvRKNS_8functionIFvvEEENS3_IFNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEvEEEES7_SF_EEEvDpOT_+116)
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #37 pc 0000000000027aac  /data/app/org.pftp-2/lib/arm64/libhermes-executor-debug.so (_ZN8facebook5react11JSIExecutor12callFunctionERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_RKN5folly7dynamicE+1156)
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #38 pc 00000000000a0d58  /data/app/org.pftp-2/lib/arm64/libreactnativejni.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #39 pc 00000000000a2350  /data/app/org.pftp-2/lib/arm64/libreactnativejni.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #40 pc 0000000000068d48  /data/app/org.pftp-2/lib/arm64/libreactnativejni.so
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #41 pc 0000000000059a70  /data/app/org.pftp-2/lib/arm64/libreactnativejni.so (_ZN8facebook3jni6detail13MethodWrapperIMNS_5react15JNativeRunnableEFvvEXadL_ZNS4_3runEvEES4_vJEE8dispatchENS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassIS4_NS3_8RunnableEE8JavaPartESB_vE11_javaobjectEEE+32)
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #42 pc 00000000000599ec  /data/app/org.pftp-2/lib/arm64/libreactnativejni.so (_ZN8facebook3jni6detail15FunctionWrapperIPFvNS0_9alias_refIPNS1_8JTypeForINS0_11HybridClassINS_5react15JNativeRunnableENS6_8RunnableEE8JavaPartES8_vE11_javaobjectEEEEXadL_ZNS1_13MethodWrapperIMS7_FvvEXadL_ZNS7_3runEvEES7_vJEE8dispatchESE_EESD_vJEE4callEP7_JNIEnvP8_jobject+52)
    09-11 13:14:25.941 17309 17309 F DEBUG   :     #43 pc 0000000000ccf240  /data/app/org.pftp-2/oat/arm64/base.odex (offset 0xc86000)

Describe what you expected to happen:

  1. The date picker should open as it does not using the Hermes engine: Screenshot_20200911-135447

Reproducible sample code

Sorry, but I had not yet time to test this with a simple react-native app just using the date picker and nothing else.

norbertschuler commented 3 years ago

I just found out the crash results from giving the component DateTimePicker (from react-native-modal-datetime-picker) a invalid date value as property minimumDate. So this can be avoided by passing only valid date values. I am closing this issue again.