hijack
hijack copied to clipboard
cryptic error if gdb is not installed
$ 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.
Yeah i'll add that.
There's a --debug
flag to help you diagnose the process identification issue.
Same error message different reason:
The process had to be run as root:
sudo hijack
+1
@ileitch is this already added and just not released ?
@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.
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 Did you find any alternative ?
nope