expo-cli
expo-cli copied to clipboard
Endless spawn of pgreps on launch
Description
yarn start launched a zillion pgrep processes when logged out.
Expected Behavior
Normal startup
Observed Behavior
node was repeatedly spawning dozens of pgrep processes, making it difficult to kill
Error text goes here!
Environment
Expo CLI 3.20.1 environment info: System: OS: macOS 10.15.4 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.16.3 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild npmPackages: expo: ^37.0.7 => 37.0.7 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4 react-native-web: ^0.11.7 => 0.11.7 npmGlobalPackages: expo-cli: 3.20.1
Reproducible Demo
Not sure how to reproduce, but here's what's happening:
- Brand new macbook pro running Catalina
- copied over my repos, removed all the node_modules directories
- brew installed node (which put in node@14)
- npm install -g expo-cli yarn
- when I yarn start, it spawns a death loop of pgrep processes before it gets to metro bundler
- brew installed node@12, unlinking node@14 first.
- removed the node_modulles and repeated setup
- Still broken
- Realized I wasn't logged in, logged in to expo
- things started working somewhat: it now got to metro and it ran in the simulator.
- However, when I quit the process it flood me with pgreps again
- And continues to flood on launch
@byCedric - can you investigate this one?
@byCedric - I tried to reproduce this but was unable to. Not sure where the pgreps would be coming from, checking that would be a good place to start.
@byCedric @brentvatne Problem is with homebrew proctools and tree-kill.
The bottled homebrew pgrep from proctools apparently does not respect the -P parameter: see Homebrew/homebrew-core#14020. It instead lists every pid, and that causes tree-kill to recursively call pgrep on every PID, ...
$ /usr/local/bin/pgrep -P 67199
0
1
97
101
...
$ /usr/local/bin/pgrep -P 67199 | wc -l
841
I reinstalled proctools from source and it worked! Filing a bug over at homebrew, thanks so much for your help and work.
ah thanks so much for looking into that @mrflip!
Thanks for sorting this out! Let's wait for a response on that issue to see if we need to do something 😄
Probably won't be fixed soon, as it looks like it's an OS interaction; program hasn't changed since 2013 (!). The fix is to not link it, or to knock it out of your path altogether, or when running expo. I think you can close this issue.
maybe we can detect this somehow and warn people about it and tell them how to fix it?
The result should never include 0 or the parent pid itself; the rogue pgrep emits all the pids.
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This appears to be resolved in the latest, versioned Expo CLI. If you encounter this issue in the future, please open an issue on expo/expo.