ileitch / hijack

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

hangs in OSX Leopard, ruby 1.9.2 at start #10

Open rkumar opened 13 years ago

rkumar commented 13 years ago

I tried hijacking irb and get the "hijacking ..." status.

As mentioned elsewhere, i did connect to the irb process using gdb and then run bt.

Here is part of the output:

35 0x00000001001610d5 in rb_catch_obj (tag=4050190, func=0x10017d7a0 , data=0) at vm_eval.c:1523

36 0x0000000100161b00 in rb_f_catch (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>) at vm_eval.c:1499

37 0x0000000100165487 in vm_call_cfunc [inlined]() at /Users/rahul/.rvm/src/ruby-1.9.2-head/vm_insnhelper.c:401

38 0x0000000100165487 in vm_call_method (th=0x1003016a0, cfp=0x1004ffce8, num=1, blockptr=0x1004ffd11, flag=8, id=<value temporarily unavailable, due to optimizations>, me=0x10031d590, recv=4321140880) at vm_insnhelper.c:523

39 0x0000000100168215 in vm_exec_core (th=0x1003016a0, initial=<value temporarily unavailable, due to optimizations>) at insns.def:1006

40 0x000000010016fe53 in vm_exec (th=0x1003016a0) at vm.c:1145

41 0x000000010017d9e1 in catch_i (tag=3214606, data=<value temporarily unavailable, due to optimizations>) at vm.c:557

42 0x00000001001610d5 in rb_catch_obj (tag=3214606, func=0x10017d7a0 , data=0) at vm_eval.c:1523

43 0x0000000100161b00 in rb_f_catch (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>) at vm_eval.c:1499

44 0x0000000100165487 in vm_call_cfunc [inlined]() at /Users/rahul/.rvm/src/ruby-1.9.2-head/vm_insnhelper.c:401

45 0x0000000100165487 in vm_call_method (th=0x1003016a0, cfp=0x1004ffea0, num=1, blockptr=0x1004ffec9, flag=8, id=<value temporarily unavailable, due to optimizations>, me=0x10031d590, recv=4303825320) at vm_insnhelper.c:523

46 0x0000000100168215 in vm_exec_core (th=0x1003016a0, initial=<value temporarily unavailable, due to optimizations>) at insns.def:1006

47 0x000000010016fe53 in vm_exec (th=0x1003016a0) at vm.c:1145

48 0x0000000100170158 in rb_iseq_eval_main (iseqval=4303807640) at vm.c:1386

49 0x000000010003f0d2 in ruby_exec_internal (n=0x10086e498) at eval.c:214

50 0x0000000100041a5c in ruby_exec_node [inlined]() at /Users/rahul/.rvm/src/ruby-1.9.2-head/eval.c:261

51 0x0000000100041a5c in ruby_run_node (n=<value temporarily unavailable, due to optimizations>) at eval.c:254

52 0x0000000100000ecf in main (argc=7, argv=0x7fff5fbfcfe0) at main.c:35

twei55 commented 12 years ago

I am facing a similar issue: http://stackoverflow.com/questions/7865320/hijack-hangs-on-macosx-snow-leopard

I just discovered [hijack][1] for ruby debugging. I installed the gem and gave it a try with thin. I grabbed the id of the thin process and passed it to hijack.

$ bundle exec thin start -d -p 3001

$ ps -axf | grep thin
501 52622 34344   0   0:01.90 ttys002    0:07.07 ruby /Users/myself/.rvm/gems/ruby-1.8.7-p352/bin/thin start -p 3001

$ hijack 52622
=> Hijacking...

Instead of giving me an IRB, it stucks after "Hijacking..."

Any ideas?

(OSX 10.6.7, Rails 2.3.8, Ruby 1.8.7)

ileitch commented 12 years ago

Please try 0.2.1.

grosser commented 11 years ago

same issue here...

gem i hijack
Fetching: hijack-0.2.1.gem (100%)
Successfully installed hijack-0.2.1
1 gem installed
[~/code/zendesk/mail_fetcher (master)] ➔ hijack 35120
=> Hijacking.../Users/mgrosser/.rvm/gems/ruby-1.9.3-p429/gems/hijack-0.2.1/lib/hijack/gdb.rb:8: Use RbConfig instead of obsolete and deprecated Config.
^C
[~/code/zendesk/mail_fetcher (master)] ➔ sudo hijack 35120
Password:
=> Hijacking.../Users/mgrosser/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/gems/1.9.1/gems/hijack-0.2.1/lib/hijack/gdb.rb:8: Use RbConfig instead of obsolete and deprecated Config.
grosser commented 11 years ago

Ubuntu + 1.9.3 just gives errors

=> Hijacking.../usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:8: Use RbConfig instead of obsolete and deprecated Config.
sh: line 1: 15333 Aborted                 (core dumped) gdb -q /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby 14239 2>&1
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:113:in `write': Broken pipe (Errno::EPIPE)
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:113:in `puts'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:113:in `exec'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:68:in `block in break_on_safe_stack_unwind'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:61:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:61:in `break_on_safe_stack_unwind'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:56:in `attach_outside_gc'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/gdb.rb:9:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/hijack-0.2.1/lib/hijack/payload.rb:9:in `new'