Deadlock when ctrl+c on syntax invalid code in multi-irb
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 478
- Forks
- 158
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 12
Description
$ irb
irb(main):001> irb
Multi-irb commands are deprecated and will be removed in IRB 2.0.0. Please use workspace commands instead.
If you have any use case for multi-irb, please leave a comment at https://github.com/ruby/irb/issues/653
irb#1(main):001* do#0->irb on main (#<Thread:0x00007037632b7f68 run>: running)
#1->irb#1 on main (#<Thread:0x0000703744b6f300 /home/user/.rbenv/versions/4.0.0/lib/ruby/gems/4.0.0/gems/irb-1.16.0/lib/irb/ext/multi-irb.rb:186 sleep>: stop)
^C
/home/user/.rbenv/versions/4.0.0/lib/ruby/gems/4.0.0/gems/reline-0.6.3/lib/reline.rb:251:in 'Thread::Mutex#synchronize': No live threads left. Deadlock? (fatal)
I understand multi-irb is deprecated. 100% of the time, I enter multi-irb by accident because I didn't realize I had irb already open. So perhaps you think that fixing this is not worth the effort. I just thought I'd report it anyways.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report by starting irb, entering multi-irb, and pressing Ctrl-C on syntax-invalid input. Read lib/irb/ext/multi-irb.rb around line 186 and reline.rb around line 251 to trace the stopped thread and mutex wait. Done means Ctrl-C no longer ends with a fatal deadlock.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100