ileitch / hijack

Provides an irb session to a running ruby process.
Other
750 stars 22 forks source link

cryptic error if gdb is not installed #13

Open jfirebaugh opened 12 years ago

jfirebaugh commented 12 years ago
$ hijack 20554
=> Hijacking.../var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:8: Use RbConfig instead of obsolete and deprecated Config.
/var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:113:in `write': Broken pipe (Errno::EPIPE)
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:113:in `puts'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:113:in `exec'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:100:in `backtrace'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:92:in `ensure_attached_to_ruby_process'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:34:in `attach_outside_gc'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:9:in `initialize'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/payload.rb:9:in `new'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/payload.rb:9:in `inject'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/console.rb:10:in `initialize'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack.rb:18:in `new'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/lib/hijack.rb:18:in `start'
    from /var/lib/gems/1.9.1/gems/hijack-0.2.1/bin/hijack:27:in `<top (required)>'
    from /usr/local/bin/hijack:19:in `load'
    from /usr/local/bin/hijack:19:in `<main>'

The issue was that gdb is not installed. After installing it, hijacking appears to be working as intended (I get a "20554 doesn't appear to be a Ruby process!" error, but that's obviously a different issue).

I suggest to preflight a check for gdb and if not found, print "GDB could not be found. Please ensure it is installed." or similar message.

ileitch commented 12 years ago

Yeah i'll add that.

There's a --debug flag to help you diagnose the process identification issue.

pannous commented 10 years ago

Same error message different reason:

The process had to be run as root:

sudo hijack

MikeSilvis commented 10 years ago

+1

grosser commented 9 years ago

@ileitch is this already added and just not released ?

ileitch commented 9 years ago

@grosser still needs implementing. Though I've no idea if hijack works at all with recent versions of Ruby. I assume no one really uses hijack anymore.

grosser commented 9 years ago

Yeah, it does not work anymore :) Is there any alternative ? I gave up looking around for a while ... Any chance we can get it back working or is it just fundamentally impossible now ?

On Wed, Feb 25, 2015 at 1:39 PM, Ian Leitch notifications@github.com wrote:

@grosser https://github.com/grosser still needs implementing. Though I've no idea if hijack works at all with recent versions of Ruby. I assume no one really uses hijack anymore.

— Reply to this email directly or view it on GitHub https://github.com/ileitch/hijack/issues/13#issuecomment-76066114.

jonathanfishner commented 8 years ago

@grosser Did you find any alternative ?

grosser commented 8 years ago

nope