Skip to content

reline/line_editor.rb:367:in `==': stack level too deep (SystemStackError) #667

Closed

Description

@freesteph

Description

We have a Rails app and some specs that we run via Guard. Sometimes when we cancel the tests while it's running, an infinite number of prompts appear and end with:

/usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:367:in `==': stack level too deep (SystemStackError)
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:367:in `block in render_line_differential'
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:367:in `each'
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:367:in `each'
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:367:in `each'
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:367:in `render_line_differential'
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:499:in `block in render_differential'
	from <internal:numeric>:237:in `times'
	from /usr/local/bundle/gems/reline-0.5.0/lib/reline/line_editor.rb:488:in `render_differential'
	 ... 11892 levels...
	from /usr/local/bundle/gems/thor-1.3.1/lib/thor/base.rb:584:in `start'
	from /usr/local/bundle/gems/guard-2.18.1/lib/guard/aruba_adapter.rb:32:in `execute'
	from /usr/local/bundle/gems/guard-2.18.1/lib/guard/aruba_adapter.rb:19:in `execute!'
	from /usr/local/bundle/gems/guard-2.18.1/bin/_guard-core:11:in `<main>'
make: *** [guard] Error 1

This is all ran via Docker containers.

Terminal Emulator

I personally use Emacs with TERM=dumb but I can reproduce in the standard mac OS Terminal app.

Activity

  1. added
    bug
    on Mar 26, 2024
  2. tompng commented on Mar 26, 2024

    @tompng
    Member

    Looks like a bug with multithread and Signal.trap that exist from at least v0.1.0
    Short reproducing code

    Thread.new{Reline.readline('>')}; sleep 0.1; Reline.readline('>')
  3. freesteph commented on Mar 27, 2024

    @freesteph
    Author

    Using gem "reline", github: "tompng/reline", branch: "threadsafe" effectively solves the problem for me 🎉

  4. freesteph commented on Mar 28, 2024

    @freesteph
    Author

    Actually, scratch that I still get some infinite guard > prompt sometimes and have to kill the process.

  5. tompng commented on Mar 28, 2024

    @tompng
    Member

    I think this is bug is a combination of multithread(#669) and cleanup(#668). This problem won't be fixed until both is merged.

  6. ima1zumi commented on Apr 4, 2024

    @ima1zumi
    Member

    Closed by #668

    Sorry, #669 was still there.

  7. tompng commented on Apr 5, 2024

    @tompng
    Member

    #668 and #669 are both merged. #646 which fixes another related problem is also merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions