zeus: Pager hangs in debugger console when displaying output via the pager (less)

Zeus v0.15.13

Repeat by:

  • configure with pry or byebug
  • insert a binding.pry or byebug into the code
  • start a server with zeus rails s
  • invoke the code with the debugger call
  • at the resulting console prompt issue a User.all or some other command that invokes the pager

At the first pager prompt, :, nothing will advance to the next page, Ctrl-C does not abort. I have to use ^Z to suspend the process, then kill -9 %1 to REALLY kill the process.

Here is pstree output, that shows the relationships at the time of the hang:

|-+= 84190 tarsa /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_30776664
 | |-+= 84196 root login -pfl tarsa /bin/bash -c exec -la bash /bin/bash
 | | \-+= 84203 tarsa -bash
 | |   \--= 78756 tarsa /Users/tarsa/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/zeus-0.15.13/build/zeus-darwin-amd64 s
 | |-+= 84303 root login -pfl tarsa /bin/bash -c exec -la bash /bin/bash
 | | \-+= 84317 tarsa -bash
 | |   \-+= 35104 tarsa /Users/tarsa/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/zeus-0.15.13/build/zeus-darwin-amd64 start
 | |     \-+- 35118 tarsa zeus slave: boot   
 | |       \-+- 35120 tarsa zeus slave: default_bundle   
 | |         |-+- 80577 tarsa zeus slave: development_environment   
 | |         | |-+= 78770 tarsa zeus runner: server   
 | |         | | \-+- 78771 tarsa zeus command: server   
 | |         | |   \--- 79556 tarsa less -R -F -X .      # <---------- pager here
 | |         | \-+- 80597 tarsa zeus slave: prerake   
 | |         |   \--= 72432 tarsa (ruby)
 | |         \-+- 80578 tarsa zeus slave: test_environment   
 | |           \-+- 80598 tarsa zeus slave: test_helper   
 | |             \-+= 79389 tarsa zeus runner: test   
 | |               \-+- 79390 tarsa zeus command: test   
 | |                 \--= 79395 tarsa /usr/local/bin/phantomjs --proxy-type=none --load-images=no --ignore-ssl-errors=yes --ssl-protocol=any /User

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 19

Most upvoted comments

same for me

One way to work around this is to disable the pager in pry Pry.config.pager = false this is obviously not ideal but at least means not needing to kill zeus everytime pry decides to page.

Ok so I got a little further with that the issue seems to be related to how the terminal state is restored, it is stored in a defer of a go func, where it should be restored at the end of the main func.

This is happening to me as well. Downgrading to 0.15.12 solved it.

rails (4.2.5.1) pry (0.10.4) pry-rails (0.3.6)

This is hitting us as well, but in the rails console using pry-rails: no binding.pry required. Anything that triggers the pager causes it.

Process looks like this when it needs to be kill -9’d:

mp              43629   0.0  0.0 556624768   3996 s005  U+    1:44pm   0:00.08 /Users/mp/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/zeus-0.15.13/build/zeus-darwin-amd64 c```

(note the very very high mem allocation)

There is a delay between the kill -9 and the process actually exiting.

This issue does not appear in the versions of zeus 0.15.4 to 0.15.12 - only in .13.

With the help of git bisect and manually testing the commit i could determine that the culprit is https://github.com/burke/zeus/commit/0916d0f4746995913a91c50979ab0bace8e8137f . cc: @sideshowcoder

I’m also experiencing this. Sometimes, I can ^C out of the pager and drop back into pry. However, I then cannot quit the main process. I too have had quite a few ^Z then kill %1 iterations in the last few weeks, though. This also usually corrupts the tty and I have to run stty sane to get a functioning shell again.

2017-04-07 at 2 10 pm

so something in here broke it https://github.com/burke/zeus/compare/v0.15.12...v0.15.13 @Crunch09 as you wanted to take a look FYI, I assume it has something todo with how terminal is handled, or the input is directed … The odd thing is it works in emacs using inf-ruby and inf-ruby-switch-from-compilation

Perfect thanks, lets see what is going on here 😢