hijack icon indicating copy to clipboard operation
hijack copied to clipboard

cryptic error if gdb is not installed

Open jfirebaugh opened this issue 11 years ago • 8 comments

$ 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.

jfirebaugh avatar Aug 15 '12 17:08 jfirebaugh

Yeah i'll add that.

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

ileitch avatar Aug 15 '12 17:08 ileitch

Same error message different reason:

The process had to be run as root:

sudo hijack

pannous avatar Jan 28 '14 13:01 pannous

+1

MikeSilvis avatar Mar 26 '14 18:03 MikeSilvis

@ileitch is this already added and just not released ?

grosser avatar Feb 25 '15 18:02 grosser

@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.

ileitch avatar Feb 25 '15 21:02 ileitch

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 [email protected] 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.

grosser avatar Feb 25 '15 22:02 grosser

@grosser Did you find any alternative ?

jonathanfishner avatar Oct 27 '15 08:10 jonathanfishner

nope

grosser avatar Oct 27 '15 14:10 grosser