Fix for Ruby 2.0.0 #56

Merged
merged 2 commits into from Apr 9, 2013

2 participants

@chneukirchen

First try on fixing #55; this has not been tested yet very much, but the arithmetic example works.

Needs review from someone more versed in Ruby internals.

@tmm1
Owner

Thanks.

@tmm1 tmm1 merged commit 73e7b26 into tmm1:master Apr 9, 2013
@chneukirchen

I noticed a lockup related to a memory-heavy Ruby program, but I don't know how to debug it yet.

@tmm1
Owner

Unfortunately perftools.rb's design makes it pretty unstable. The profiling signals sometimes come when the VM is inconsistent.

Ruby 2.0 actually makes call stack profiling a lot easier. You can even do it all in ruby with caller_locations. See http://samsaffron.com/archive/2013/03/19/flame-graphs-in-ruby-miniprofiler

You might also be interested in https://github.com/tmm1/rblineprof which is much better tested and more stable on 1.9 and 2.0.

@chneukirchen

Concretely, the program hangs with:

rt_sigreturn()                          = 56
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f34ffa599d0) = ? ERESTARTNOINTR (To be restarted)
--- SIGPROF {si_signo=SIGPROF, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 56
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f34ffa599d0) = ? ERESTARTNOINTR (To be restarted)
--- SIGPROF {si_signo=SIGPROF, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 56
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f34ffa599d0) = ? ERESTARTNOINTR (To be restarted)
--- SIGPROF {si_signo=SIGPROF, si_code=SI_KERNEL} ---
rt_sigreturn()                          = 56
#0  0x00007f34ff125c85 in fork () from /usr/lib/libc.so.6
#1  0x00007f34ff4ebe5c in ?? () from /usr/lib/libruby.so.2.0
#2  0x00007f34ff4f080e in ?? () from /usr/lib/libruby.so.2.0
#3  0x00007f34ff4f0f88 in rb_fork_async_signal_safe ()
   from /usr/lib/libruby.so.2.0
#4  0x00007f34ff4a99f8 in ?? () from /usr/lib/libruby.so.2.0

I am mainly interested in the pprof call graphs however...

@chneukirchen chneukirchen deleted the unknown repository branch Apr 9, 2013
@tmm1
Owner

Ah, yes. You're hitting #20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment