react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Frequent app crashes with message: 'SamplingProfiler should be destroyed on the same thread it is created'

Open Nantris opened this issue 2 years ago • 9 comments

Description

App crashes on restart almost without fail with the message 'SamplingProfiler should be destroyed on the same thread it is created'

Version

0.69.6

Output of npx react-native info

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) x64 AMD Ryzen 7 5800X 8-Core Processor
    Memory: 2.25 GB / 19.51 GB
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
    Watchman: 4.9.0 - /usr/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 31, 32, 33
      Build Tools: 30.0.3, 31.0.0, 33.0.0
      System Images: android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: ~18.0.0 => 18.0.0 
    react-native: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
info React Native v0.70.3 is now available (your project is running on v0.69.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.70.3.
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.69.6.

Steps to reproduce

May require being connected to Flipper's Hermes Debugger for the issue to occur.

Snack, code example, screenshot, or link to a repository

Unknown how to replicate this consistently.

Nantris avatar Oct 20 '22 00:10 Nantris

:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

github-actions[bot] avatar Oct 20 '22 00:10 github-actions[bot]

Bad bot. That section is filled in.

Nantris avatar Oct 20 '22 01:10 Nantris

Might be related to https://github.com/facebook/react-native/pull/34129, @jpporto do you know if there were fixes in hermes that mitigates this? This happens on RN 0.69 which probably uses hermes from a few months ago.

janicduplessis avatar Oct 22 '22 04:10 janicduplessis

Hi @janicduplessis,

This is unrelated to #34129, and has been mitigated here. The proper fix is part of RN (this and a few others). Backporting the Hermes fix might be more manageable.

John Paul

jpporto avatar Oct 22 '22 17:10 jpporto

@Slapbox would you be able to update to 0.70 to see if it still happens

janicduplessis avatar Oct 22 '22 19:10 janicduplessis

@janicduplessis I'd love to try, but unfortunately can't yet due to using Expo.

Nantris avatar Oct 23 '22 01:10 Nantris

I don't know whether the issue is really in React Native or Flipper or both, but it seemingly only occurs with particular versions of Flipper, namely 0.171.x.

See: https://github.com/facebook/flipper/issues/4242

Nantris avatar Oct 23 '22 22:10 Nantris

I think since the issue is not super critical it should be fine to wait for next expo release to see if it is fixed.

janicduplessis avatar Oct 26 '22 22:10 janicduplessis

@janicduplessis maybe not critical for the React Native team, but pretty critical for us... I waste 50% of my time per day because of this, unless the work I'm doing doesn't require the debugger. Note the times between crashes in this image:

image

Also note that I did indeed speak too soon; disabling StrictMode did not fix this. Although the delay til crash upon reload is longer, it still crashes.

Nantris avatar Oct 26 '22 22:10 Nantris

@Slapbox Expo sdk 47 should include a fix for this and was just released in beta https://twitter.com/expo/status/1587140697341456384?s=46&t=BsU-0_gGXN_LlsNVVvHw2g

janicduplessis avatar Oct 31 '22 18:10 janicduplessis

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 12 '23 00:05 github-actions[bot]

Not sure if it was the fix mentioned above or something else, but it seems resolved now.

Nantris avatar May 12 '23 00:05 Nantris