tmm1 / rbtrace

like strace, but for ruby code
MIT License
1.71k stars 64 forks source link

pid is not listening attempting to connect to irb/pry #37

Open lesliev-figured opened 9 years ago

lesliev-figured commented 9 years ago

Hi!

I am trying to produce a heap dump from a Rails console but there seems to be a problem with the message queue. I put rbtrace in my Gemfile with require:false, then I started the Rails console (bundle exec rails c), then I ran "require 'rbtrace'" in the console and got "true" as a response.

In another window I looked up the PID of the ruby process and ran: rbtrace --pid 6591 --gc

Which gave me: Error: argument --pid (pid is not listening for messages, did you require "rbtrace").

I looked in /tmp and there were indeed no rbtrace socket files that I could see. I am running Ubuntu 14.04, Rails 3.2.21, Ruby 2.1.4p265 - if any of that matters.

Any ideas?

tmm1 commented 9 years ago

Attaching to an irb console won't work because the console is generally "stuck" waiting for input on the prompt, so it is unable to respond to the requests coming from the rbtrace process.