nushell: Nushell hangs CPU in debug mode
Describe the bug
I’m seeing Nushell hang occasionally in macOS as I’m developing. I managed to catch it and attach a debugger to see where it was:
* frame #0: 0x0000000190a4cacc libsystem_kernel.dylib`read + 8
frame #1: 0x0000000102423170 nu`crossterm::event::sys::unix::file_descriptor::FileDesc::read::hfbd23575769f9401 + 28
frame #2: 0x00000001024216b4 nu`_$LT$crossterm..event..source..unix..mio..UnixInternalEventSource$u20$as$u20$crossterm..event..source..EventSource$GT$::try_read::hbbc0fab5c8f663e4 + 320
frame #3: 0x00000001024226f8 nu`crossterm::event::read::InternalEventReader::poll::h36c3e8abbd07d8a9 + 360
frame #4: 0x000000010241ea0c nu`crossterm::event::poll_internal::h0048b8dda3aba103 + 172
frame #5: 0x000000010242307c nu`crossterm::cursor::sys::unix::read_position_raw::hd8205425dcf4d786 + 140
frame #6: 0x0000000102d99548 nu`reedline::painting::painter::Painter::initialize_prompt_position::h536603ca530d65c6 + 84
frame #7: 0x0000000102d8a024 nu`reedline::engine::Reedline::read_line::hf3ee01bf075925f5 + 80
frame #8: 0x00000001024f09f8 nu`nu_cli::repl::evaluate_repl::h0038740f8bd590bd + 9328
frame #9: 0x00000001024ad2d0 nu`nu::run::run_repl::h9453fd09d0b40fa3 + 384
How to reproduce
- Start in zsh as root shell
- Run a release version of nushell
- From inside nushell, run
cargo runin the nushell repo - Immediately,
exit
Expected behavior
There shouldn’t be any hang on exit.
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.83.1 |
| branch | main |
| commit_hash | 8403fff34500d30439545519c88c7d942c717e3e |
| build_os | macos-aarch64 |
| build_target | aarch64-apple-darwin |
| rust_version | rustc 1.69.0 (84c898d65 2023-04-16) |
| rust_channel | 1.69.0-aarch64-apple-darwin |
| cargo_version | cargo 1.69.0 (6e9a83356 2023-04-12) |
| build_time | 2023-07-29 05:50:17 +12:00 |
| build_rust_channel | debug |
| allocator | standard |
| features | default, sqlite, trash, which, zip |
| installed_plugins |
Additional context
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (7 by maintainers)
Commits related to this issue
- Revert 9693 to prevent CPU hangs (#9893) # Description This reverts #9693 as it lead to CPU hangs. (btw, did the revert by hand as it couldn't be done automatically. Hopefully I didn't miss anyth... — committed to nushell/nushell by sophiajt a year ago
- Revert 9693 to prevent CPU hangs (#9893) # Description This reverts #9693 as it lead to CPU hangs. (btw, did the revert by hand as it couldn't be done automatically. Hopefully I didn't miss anyth... — committed to IanManske/nushell by sophiajt a year ago
- Enable macOS foreground process handling (#9909) # Description Currently, foreground process management is disabled for macOS, since the original code had issues (see #7068). This PR re-enables pr... — committed to nushell/nushell by IanManske a year ago
ok, sounds good. thanks for your help! we appreciate it.
I’ll try to repro in WSL.