Code Monkey home page Code Monkey logo

rbtrace's Introduction

rbtrace: like strace, but for ruby code

rbtrace shows you method calls happening inside another ruby process in real time.

rbtrace works on ruby 1.8 through 2.2 (and beyond), running on linux or mac osx.

rbtrace is designed to have minimal overhead, and should be safe to run in production.

usage

% gem install rbtrace
% rbtrace --help

supported Rubies

rbtrace supports all stable versions of Ruby MRI, as of 23-01-2018 this is Ruby version 2.2 and later.

tracer types

rbtrace has several different tracing modes.

firehose: show everything

% rbtrace -p <PID> --firehose

slow: show any method calls that take longer than <N> milliseconds

% rbtrace -p <PID> --slow=<N>

methods: trace calls to specific methods

% rbtrace -p <PID> --methods "Kernel#sleep" "Proc#call"

gc: trace garbage collections

% rbtrace -p <PID> --gc

memory: produce a basic memory report regarding process (including GC.stat and ObjectSpace stats)

% rbtrace -p <PID> --memory

backtraces: return backtraces for all active threads in a process

% rbtrace -p <PID> --backtraces

notes

--firehose is not reliable on osx.

--slow, --gc and --methods can be combined.

predefined tracers

rbtrace also includes a set of predefined tracers for popular ruby libraries and functions.

trace calls to activerecord adapters and any i/o functions

% rbtrace -p <PID> -c activerecord io

detailed example

require rbtrace into a process

% cat server.rb
require 'rbtrace'

class String
  def multiply_vowels(num)
    @test = 123
    gsub(/[aeiou]/){ |m| m*num }
  end
end

while true
  proc {
    Dir.chdir("/tmp") do
      Dir.pwd
      Process.pid
      'hello'.multiply_vowels(3)
      sleep rand*0.5
    end
  }.call
end

run the process

% ruby server.rb &
[1] 87854

trace a function using the process's pid

% rbtrace -p 87854 -m sleep
*** attached to process 87854

Kernel#sleep <0.138615>
Kernel#sleep <0.147726>
Kernel#sleep <0.318728>
Kernel#sleep <0.338173>
Kernel#sleep <0.373004>
Kernel#sleep
*** detached from process 87854

trace everything

% rbtrace -p 87854 --firehose
*** attached to process 87938

Kernel#proc <0.000082>
Proc#call
   Dir.chdir
      Dir.pwd <0.000060>
      Process.pid <0.000021>
      String#multiply_vowels
         String#gsub
            String#* <0.000023>
            String#* <0.000022>
         String#gsub <0.000127>
      String#multiply_vowels <0.000175>
      Kernel#rand <0.000018>
      Float#* <0.000022>
      Kernel#sleep <0.344281>
   Dir.chdir <0.344858>
Proc#call <0.344908>
*** detached from process 87938

trace specific functions

% rbtrace -p 87854 -m sleep Dir.chdir Dir.pwd Process.pid "String#gsub" "String#*"
*** attached to process 87854

Dir.chdir
   Dir.pwd <0.000023>
   Process.pid <0.000008>
   String#gsub
      String#* <0.000008>
      String#* <0.000007>
   String#gsub <0.000050>
   Kernel#sleep <0.498809>
Dir.chdir <0.499025>

Dir.chdir
   Dir.pwd <0.000024>
   Process.pid <0.000008>
   String#gsub
      String#* <0.000008>
      String#* <0.000007>
   String#gsub <0.000050>
   Kernel#sleep
*** detached from process 87854

trace all functions in a class/module

% rbtrace -p 87854 -m "Kernel#"
*** attached to process 87854

Kernel#proc <0.000062>
Kernel#rand <0.000010>
Kernel#sleep <0.218677>
Kernel#proc <0.000016>
Kernel#rand <0.000010>
Kernel#sleep <0.195914>
Kernel#proc <0.000016>
Kernel#rand <0.000009>
Kernel#sleep
*** detached from process 87854

get values of variables and other expressions

% rbtrace -p 87854 -m "String#gsub(self, @test)" "String#*(self, __source__)" "String#multiply_vowels(self, self.length, num)"
*** attached to process 87854

String#multiply_vowels(self="hello", self.length=5, num=3)
   String#gsub(self="hello", @test=123)
      String#*(self="e", __source__="server.rb:6") <0.000020>
      String#*(self="o", __source__="server.rb:6") <0.000018>
   String#gsub <0.000085>
String#multiply_vowels <0.000198>

String#multiply_vowels(self="hello", self.length=5, num=3)
   String#gsub(self="hello", @test=123)
      String#*(self="e", __source__="server.rb:6") <0.000020>
      String#*(self="o", __source__="server.rb:6") <0.000020>
   String#gsub <0.000102>
String#multiply_vowels <0.000218>

*** detached from process 87854

watch for method calls slower than 250ms

% rbtrace -p 87854 --slow=250
*** attached to process 87854
      Kernel#sleep <0.459628>
   Dir.chdir <0.459828>
Proc#call <0.459849>

      Kernel#sleep <0.484666>
   Dir.chdir <0.484804>
Proc#call <0.484818>

*** detached from process 87854

todo

  • correct irb implementation so it establishes a dedicated channel
  • add triggers to start tracing slow methods only inside another method
  • add watch expressions to fire tracers only when an expression is true
  • add special expressions for method args (arg0, arguments)
  • optimize local variable lookup to avoid instance_eval
  • investigate mach_msg on osx since msgget(2) has hard kernel limits

rbtrace's People

Contributors

abicky avatar adam12 avatar aroben avatar bkeepers avatar byroot avatar danielwaterworth avatar dannyfallon avatar elberet avatar gabrielg avatar georgeclaghorn avatar godfat avatar guilherme avatar jcs avatar jonforums avatar k0i avatar kiwicustom avatar markoa avatar quirkey avatar rickhull avatar samsaffron avatar tmm1 avatar tnm avatar vivienbarousse avatar zimbix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbtrace's Issues

unexpected error message trying to use -c option

Hi,

First, thank you for this work! :) I was testing following the README.md and saw the option:

rbtrace -p <PID> -c activerecord io

but when i try to use it i get the message below:

$ rbtrace -p 4112 -c activerecord io
Error: argument --config (file does not exist).
Try --help for help.

what could be wrong?

$ rbtrace --version
rbtrace: like strace, but for ruby code
  version 0.4.7
  (c) 2013 Aman Gupta (tmm1)
  http://github.com/tmm1/rbtrace
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin14.0.0]

Timeout parameter has no effect on eval timeout

The timeout parameter appears to have no effect on eval timing out.

Attempting to run:

bundle exec rbtrace -p 2488 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}' --timeout=60

actually times out almost immediately:

 % time bundle exec rbtrace -p 2488 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}' --timeout=60
*** attached to process 2488
*** timed out waiting for eval response
*** detached from process 2488
bundle exec rbtrace -p 2488 -e  --timeout=60  2,54s user 0,14s system 33% cpu 7,993 total

Can't install on osx 10.8.5

gem_make.out

/Users/xguox/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
extconf.rb:23:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:23:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
  -- tar zxvf msgpack-0.5.7.tar.gz
  -- ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/Users/xguox/.rvm/gems/ruby-2.1.1@balzac/gems/rbtrace-0.4.3/ext/dst/
  -- make install
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/xguox/.rvm/rubies/ruby-2.1.1/bin/ruby
extconf.rb:6:in `sys': make install failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
    from extconf.rb:40:in `block (2 levels) in <main>'
    from extconf.rb:32:in `chdir'
    from extconf.rb:32:in `block in <main>'
    from extconf.rb:28:in `chdir'
    from extconf.rb:28:in `<main>'

extconf failed, exit code 1

mkmf.log

Building msgpack
"tar zxvf msgpack-0.5.7.tar.gz"
x msgpack-0.5.7/
x msgpack-0.5.7/ac/
x msgpack-0.5.7/aclocal.m4
x msgpack-0.5.7/AUTHORS
x msgpack-0.5.7/ChangeLog
x msgpack-0.5.7/config.h.in
x msgpack-0.5.7/configure
x msgpack-0.5.7/configure.in
x msgpack-0.5.7/COPYING
x msgpack-0.5.7/INSTALL
x msgpack-0.5.7/LICENSE
x msgpack-0.5.7/Makefile.am
x msgpack-0.5.7/Makefile.in
x msgpack-0.5.7/msgpack_vc.postbuild.bat
x msgpack-0.5.7/msgpack_vc2008.sln
x msgpack-0.5.7/msgpack_vc2008.vcproj
x msgpack-0.5.7/msgpack_vc8.sln
x msgpack-0.5.7/msgpack_vc8.vcproj
x msgpack-0.5.7/NEWS
x msgpack-0.5.7/NOTICE
x msgpack-0.5.7/README
x msgpack-0.5.7/README.md
x msgpack-0.5.7/src/
x msgpack-0.5.7/test/
x msgpack-0.5.7/test/buffer.cc
x msgpack-0.5.7/test/cases.cc
x msgpack-0.5.7/test/cases.mpac
x msgpack-0.5.7/test/cases_compact.mpac
x msgpack-0.5.7/test/convert.cc
x msgpack-0.5.7/test/fixint.cc
x msgpack-0.5.7/test/fixint_c.cc
x msgpack-0.5.7/test/Makefile.am
x msgpack-0.5.7/test/Makefile.in
x msgpack-0.5.7/test/msgpack_test.cpp
x msgpack-0.5.7/test/msgpackc_test.cpp
x msgpack-0.5.7/test/object.cc
x msgpack-0.5.7/test/pack_unpack.cc
x msgpack-0.5.7/test/pack_unpack_c.cc
x msgpack-0.5.7/test/streaming.cc
x msgpack-0.5.7/test/streaming_c.cc
x msgpack-0.5.7/test/version.cc
x msgpack-0.5.7/test/zone.cc
x msgpack-0.5.7/src/gcc_atomic.cpp
x msgpack-0.5.7/src/Makefile.am
x msgpack-0.5.7/src/Makefile.in
x msgpack-0.5.7/src/msgpack/
x msgpack-0.5.7/src/msgpack.h
x msgpack-0.5.7/src/msgpack.hpp
x msgpack-0.5.7/src/object.cpp
x msgpack-0.5.7/src/objectc.c
x msgpack-0.5.7/src/unpack.c
x msgpack-0.5.7/src/version.c
x msgpack-0.5.7/src/vrefbuffer.c
x msgpack-0.5.7/src/zone.c
x msgpack-0.5.7/src/msgpack/object.h
x msgpack-0.5.7/src/msgpack/object.hpp
x msgpack-0.5.7/src/msgpack/pack.h
x msgpack-0.5.7/src/msgpack/pack.hpp
x msgpack-0.5.7/src/msgpack/pack_define.h
x msgpack-0.5.7/src/msgpack/pack_template.h
x msgpack-0.5.7/src/msgpack/sbuffer.h
x msgpack-0.5.7/src/msgpack/sbuffer.hpp
x msgpack-0.5.7/src/msgpack/sysdep.h
x msgpack-0.5.7/src/msgpack/type/
x msgpack-0.5.7/src/msgpack/type.hpp
x msgpack-0.5.7/src/msgpack/unpack.h
x msgpack-0.5.7/src/msgpack/unpack.hpp
x msgpack-0.5.7/src/msgpack/unpack_define.h
x msgpack-0.5.7/src/msgpack/unpack_template.h
x msgpack-0.5.7/src/msgpack/version.h
x msgpack-0.5.7/src/msgpack/version.h.in
x msgpack-0.5.7/src/msgpack/vrefbuffer.h
x msgpack-0.5.7/src/msgpack/vrefbuffer.hpp
x msgpack-0.5.7/src/msgpack/zbuffer.h
x msgpack-0.5.7/src/msgpack/zbuffer.hpp
x msgpack-0.5.7/src/msgpack/zone.h
x msgpack-0.5.7/src/msgpack/zone.hpp
x msgpack-0.5.7/src/msgpack/zone.hpp.erb
x msgpack-0.5.7/src/msgpack/type/bool.hpp
x msgpack-0.5.7/src/msgpack/type/define.hpp
x msgpack-0.5.7/src/msgpack/type/define.hpp.erb
x msgpack-0.5.7/src/msgpack/type/deque.hpp
x msgpack-0.5.7/src/msgpack/type/fixint.hpp
x msgpack-0.5.7/src/msgpack/type/float.hpp
x msgpack-0.5.7/src/msgpack/type/int.hpp
x msgpack-0.5.7/src/msgpack/type/list.hpp
x msgpack-0.5.7/src/msgpack/type/map.hpp
x msgpack-0.5.7/src/msgpack/type/nil.hpp
x msgpack-0.5.7/src/msgpack/type/pair.hpp
x msgpack-0.5.7/src/msgpack/type/raw.hpp
x msgpack-0.5.7/src/msgpack/type/set.hpp
x msgpack-0.5.7/src/msgpack/type/string.hpp
x msgpack-0.5.7/src/msgpack/type/tr1/
x msgpack-0.5.7/src/msgpack/type/tuple.hpp
x msgpack-0.5.7/src/msgpack/type/tuple.hpp.erb
x msgpack-0.5.7/src/msgpack/type/vector.hpp
x msgpack-0.5.7/src/msgpack/type/tr1/unordered_map.hpp
x msgpack-0.5.7/src/msgpack/type/tr1/unordered_set.hpp
x msgpack-0.5.7/ac/compile
x msgpack-0.5.7/ac/config.guess
x msgpack-0.5.7/ac/config.sub
x msgpack-0.5.7/ac/depcomp
x msgpack-0.5.7/ac/install-sh
x msgpack-0.5.7/ac/ltmain.sh
x msgpack-0.5.7/ac/missing
"./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/Users/xguox/.rvm/gems/ruby-2.1.1@balzac/gems/rbtrace-0.4.3/ext/dst/"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ac/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking if C++ API is enabled... 
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking whether gcc and cc understand -c and -o together... yes
checking build system type... x86_64-apple-darwin12.5.0
checking host system type... x86_64-apple-darwin12.5.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin12.5.0 file names to x86_64-apple-darwin12.5.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin12.5.0 file names to toolchain format... func_convert_file_noop
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking whether the g++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin12.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking dependency style of gcc... none
checking if debug option is enabled... 
checking for __sync_* atomic operations... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/msgpack/version.h
config.status: creating test/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
"make install"
Making install in src
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -O3 -Wall  -g -c -o unpack.lo unpack.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O3 -Wall -g -c unpack.c  -fno-common -DPIC -o unpack.o
unpack.c:463: internal compiler error: Bus error: 10
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[1]: *** [unpack.lo] Error 1
make: *** [install-recursive] Error 1

Install fails on FreeBSD [x86_64-freebsd9.0]

[discourse@nginx ~/public_html/beta]$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-freebsd9.0]


same result for:

  1. gem install rbtrace -v '0.4.1'
  2. gem install rbtrace -v '0.n.n'
  3. gem install rbtrace

EXAMPLE

[discourse@nginx ~/public_html/beta]$ gem install rbtrace -v '0.4.1'
Building native extensions. This could take a while...
ERROR: Error installing rbtrace:
ERROR: Failed to build gem native extension.

/home/discourse/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb

-- tar zxvf msgpack-0.5.7.tar.gz
-- ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/
-- make install
checking for main() in -lmsgpackc_ext... yes
checking for msgpack.h... yes
checking for rb_during_gc() in ruby.h... yes
checking for rb_gc_add_event_hook() in ruby.h,node.h... no
creating Makefile

make "DESTDIR="
compiling rbtrace.c
In file included from /usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/object.h:21,
from /usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack.h:23,
from rbtrace.c:23:
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/zone.h: In function 'msgpack_zone_malloc_no_align':
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/zone.h:99: warning: ISO C90 forbids mixed declarations and code
In file included from /usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/pack.h:116,
from /usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack.h:25,
from rbtrace.c:23:
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/pack_template.h: In function 'msgpack_pack_float':
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/pack_template.h:639: warning: ISO C90 forbids mixed declarations and code
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/pack_template.h: In function 'msgpack_pack_double':
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/pack_template.h:648: warning: ISO C90 forbids mixed declarations and code
In file included from /usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack.h:27,
from rbtrace.c:23:
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/sbuffer.h: In function 'msgpack_sbuffer_write':
/usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/dst/include/msgpack/sbuffer.h:77: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function 'rbtrace__send_event':
rbtrace.c:167: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:170: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:240: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:251: warning: passing argument 5 of 'sendto' from incompatible pointer type
rbtrace.c: In function 'event_hook':
rbtrace.c:324: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:340: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:348: warning: comparison between signed and unsigned
rbtrace.c:297: warning: unused parameter 'data'
rbtrace.c: In function 'rbtracer_detach':
rbtrace.c:624: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function 'rbtracer_add':
rbtrace.c:663: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function 'ruby_teardown':
rbtrace.c:813: warning: unused parameter 'data'
rbtrace.c: In function 'rbtrace__process_event':
rbtrace.c:860: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:886: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:911: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:925: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:956: error: too few arguments to function 'setpgrp'
rbtrace.c:957: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function 'sigurg':
rbtrace.c:1023: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:1038: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:1011: warning: unused parameter 'signal'
rbtrace.c: In function 'signal_handler_wrapper':
rbtrace.c:1060: warning: unused parameter 'arg'
rbtrace.c:1060: warning: unused parameter 'ctx'
*** Error code 1

Stop in /usr/home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext.

Gem files will remain installed in /home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1 for inspection.
Results logged to /home/discourse/.rvm/gems/ruby-2.0.0-p247/gems/rbtrace-0.4.1/ext/gem_make.out


Any solution, or do you need more information?

Thank you. :-)

Gem dependency renamed to `Optimist`

I just got this warning while installing rbtrace:

Post-install message from trollop:
!    The 'trollop' gem has been deprecated and has been replaced by 'optimist'.
!    See: https://rubygems.org/gems/optimist
!    And: https://github.com/ManageIQ/optimist

Seems like this gem has been recently renamed here: ManageIQ/optimist@7a5e93f

I will try to rename all occurrences and send you a PR if it works.

backtrace option fails on macOS

I have not been able to figure out how to use rbtrace to generate backtraces. It's working for exec (-e) option though.

Process to be traced (last line appears after the rbtrace run):

$ rails s
=> Booting Puma
=> Rails 6.0.3.4 application starting in development 
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.1.1 (ruby 2.7.2-p137) ("At Your Service")
*  Min threads: 1
*  Max threads: 1
*  Environment: development
*          PID: 17779
* Listening on http://127.0.0.1:3000
* Listening on http://[::1]:3000
Use Ctrl-C to stop
sendto(18): No buffer space available

Tracing side:

$ rbtrace -p 17779 -b
*** attached to process 17779
*** timed out waiting for eval response
*** detached from process 17779

Cannot install on Windows 10

Hi,

Whilst trying to install rbrtace on windows 10 using gem install rbtrace I get the following error:

Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/RailsInstaller/Ruby2.1.0/bin/ruby
extconf.rb:6:in sys': ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=C:/RailsInstaller/ Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rbtrace-0.4.7/ext/dst/ --libdir=C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/ rbtrace-0.4.7/ext/dst/lib failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError) from extconf.rb:41:inblock (2 levels) in

'
from extconf.rb:34:in chdir' from extconf.rb:34:inblock in '
from extconf.rb:30:in chdir' from extconf.rb:30:in'

extconf failed, exit code 1

Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rbtrace-0.4.7 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/rbtrace-0.4.7/gem_make.out

Running on ruby 2.1.5, rubygems 2.2.2, Windows 10

--memory gives me a ArgumentError: command is too long

running a : bundle exec rbtrace -p 41495 --memory

Output is:

*** attached to process 41495
*** detached from process 41495
bundler: failed to load command: rbtrace (/Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/bin/rbtrace)
ArgumentError: command is too long
  /Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/gems/rbtrace-0.4.11/lib/rbtrace/rbtracer.rb:324:in `send_cmd'
  /Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/gems/rbtrace-0.4.11/lib/rbtrace/rbtracer.rb:146:in `eval'
  /Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/gems/rbtrace-0.4.11/lib/rbtrace/cli.rb:467:in `run'
  /Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/gems/rbtrace-0.4.11/bin/rbtrace:5:in `<top (required)>'
  /Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/bin/rbtrace:23:in `load'
  /Users/arthurnn/src/dependency-graph-api/vendor/gems/ruby/2.4.0/bin/rbtrace:23:in `<top (required)>'

I am assuming the memory dump is too big or something, so it would break the msgpack buffer size?

is there a work around of some sort?

Option to print method nesting depth as number rather than spaces?

I've been tracing a rather complicated process in our production environment to figure out where a segfault is coming from. The space prefixes get a little out of control when the method call nesting gets deep.

I tried setting my prefix to 1 space with -r 1 but it still gets quite hard to read. Presumably we could prefix the nesting depth as a number rather than spaces?

edit: I only find this to be a problem when using the --firehose, even --slowcpu 1 is quite readable by comparison

-m with namespace wildcard

It would be great to be able to use -m to include whole namespaces or subsets of them, i.e. -m "Foo::*" "Foo::*::Bar

Build error on Amazon Linux (i686)

Hi,
I tried to install the rbtrace gem on a Amazon Linux system. After installing gcc using "yum install gcc", I got the following error message:

[root@domU-xx-xx-xx-xx-xx-xx elasticbeanstalk]# gem install rbtrace
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
ERROR:  Error installing rbtrace:
    ERROR: Failed to build gem native extension.

/opt/elasticbeanstalk/bin/ruby extconf.rb
  -- tar zxvf msgpack-0.5.4.tar.gz
  -- ./configure --disable-dependency-tracking --disable-shared --disable-cxx --with-pic --prefix=/opt/elasticbeanstalk/lib/ruby/gems/1.9.1/gems/rbtrace-0.3.11/ext/dst/
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/opt/elasticbeanstalk/bin/ruby
extconf.rb:6:in `sys': ./configure --disable-dependency-tracking --disable-shared --disable-cxx --with-pic --prefix=/opt/elasticbeanstalk/lib/ruby/gems/1.9.1/gems/rbtrace-0.3.11/ext/dst/ failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
    from extconf.rb:32:in `block (2 levels) in '
    from extconf.rb:31:in `chdir'
    from extconf.rb:31:in `block in '
    from extconf.rb:27:in `chdir'
    from extconf.rb:27:in `'


Gem files will remain installed in /opt/elasticbeanstalk/lib/ruby/gems/1.9.1/gems/rbtrace-0.3.11 for inspection.
Results logged to /opt/elasticbeanstalk/lib/ruby/gems/1.9.1/gems/rbtrace-0.3.11/ext/gem_make.out

mkmf.log shows the following text (at the end):

[snip]
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking dependency style of gcc... none
checking if debug option is enabled...
checking for __sync_* atomic operations...
configure: error: __sync_* atomic operations are not supported.

Note that gcc < 4.1 is not supported.

If you are using gcc >= 4.1 and the default target CPU architecture is "i386", try to
add CFLAGS="--march=i686" and CXXFLAGS="-march=i686" options to ./configure as follows:

  $ ./configure CFLAGS="-march=i686" CXXFLAGS="-march=i686"

setting this options manually in the shell where I installed the gem resolved the problem:

export CFLAGS="-march=i686"
export CXXFLAGS="-march=i686"

Some system info:

[root@domU-xx-xx-xx-xx-xx-xx elasticbeanstalk]# uname -a

Linux domU-xx-xx-xx-xx-xx-xx 2.6.34.7-56.40.amzn1.i686 #1 SMP Fri Oct 22 18:48:33 UTC 2010 i686 i686 i386 GNU/Linux

[root@domU-xx-xx-xx-xx-xx-xx elasticbeanstalk]# cat /etc/system-release

Amazon Linux AMI release 2010.11.1 (beta)

Can't install on OS X 10.7.1

Configure of msgpack fails. Output:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.65.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = Myles-Byrnes-iMac.local
uname -m = x86_64
uname -r = 11.1.0
uname -s = Darwin
uname -v = Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
Kernel configured for up to 4 processors.
4 processors are physically available.
4 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3
Primary memory available: 8.00 gigabytes
Default processor set: 105 tasks, 450 threads, 4 processors
Load average: 0.45, Mach factor: 3.54
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Developer/usr/bin
PATH: /Users/myles/.rbenv/shims
PATH: /Users/myles/.rbenv/bin
PATH: /usr/local/Cellar/python/2.7/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2396: checking for a BSD-compatible install
configure:2464: result: /usr/bin/install -c
configure:2475: checking whether build environment is sane
configure:2525: result: yes
configure:2666: checking for a thread-safe mkdir -p
configure:2705: result: /usr/local/bin/gmkdir -p
configure:2718: checking for gawk
configure:2748: result: no
configure:2718: checking for mawk
configure:2748: result: no
configure:2718: checking for nawk
configure:2748: result: no
configure:2718: checking for awk
configure:2734: found /usr/bin/awk
configure:2745: result: awk
configure:2756: checking whether make sets $(MAKE)
configure:2778: result: yes
configure:2916: checking for gcc
configure:2932: found /Developer/usr/bin/gcc
configure:2943: result: gcc
configure:3172: checking for C compiler version
configure:3181: gcc --version >&5
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3192: $? = 0
configure:3181: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
configure:3192: $? = 0
configure:3181: gcc -V >&5
llvm-gcc-4.2: argument to `-V' is missing
configure:3192: $? = 1
configure:3181: gcc -qversion >&5
i686-apple-darwin11-llvm-gcc-4.2: no input files
configure:3192: $? = 1
configure:3212: checking whether the C compiler works
configure:3234: gcc -O4 -Wall    conftest.c  >&5
configure:3238: $? = 0
configure:3287: result: yes
configure:3290: checking for C compiler default output file name
configure:3292: result: a.out
configure:3298: checking for suffix of executables
configure:3305: gcc -o conftest -O4 -Wall    conftest.c  >&5
configure:3309: $? = 0
configure:3331: result: 
configure:3353: checking whether we are cross compiling
configure:3361: gcc -o conftest -O4 -Wall    conftest.c  >&5
ld: lto: could not merge in /var/folders/20/zff27jkn3j1db0dbkhkrz74w0000gn/T//ccYIOnl3.o because Unknown instruction for architecture x86_64
collect2: ld returned 1 exit status
configure:3365: $? = 1
configure:3372: ./conftest
./configure: line 3374: ./conftest: No such file or directory
configure:3376: $? = 127
configure:3383: error: in `/Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4':
configure:3387: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCASFLAGS_set=
ac_cv_env_CCASFLAGS_value=
ac_cv_env_CCAS_set=
ac_cv_env_CCAS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/usr/local/bin/gmkdir
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/missing --run aclocal-1.11'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/missing --run tar'
AR=''
AUTOCONF='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/missing --run autoconf'
AUTOHEADER='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/missing --run autoheader'
AUTOMAKE='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/missing --run automake-1.11'
AWK='awk'
CC='gcc'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
CFLAGS='-O4 -Wall '
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-O4 -Wall '
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENABLE_CXX_FALSE=''
ENABLE_CXX_TRUE=''
EXEEXT=''
FGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/missing --run makeinfo'
MKDIR_P='/usr/local/bin/gmkdir -p'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='msgpack'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.5.4'
VERSION_MAJOR=''
VERSION_MINOR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCCAS_FALSE=''
am__fastdepCCAS_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/myles/.rbenv/versions/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/rbtrace-0.3.13/ext/src/msgpack-0.5.4/ac/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
lt_ECHO='/bin/echo'
mandir='${datarootdir}/man'
mkdir_p='/usr/local/bin/gmkdir -p'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "msgpack"
#define VERSION "0.5.4"

configure: exit 1

Seems the linker is failing:

configure:3361: gcc -o conftest -O4 -Wall    conftest.c  >&5
ld: lto: could not merge in /var/folders/20/zff27jkn3j1db0dbkhkrz74w0000gn/T//ccYIOnl3.o because Unknown instruction for architecture x86_64
collect2: ld returned 1 exit status

30 character limit on -e

For some reason, if I rbtrace my Ruby server, I can't rbtrace more than 30 characters without it hanging on me. It doesn't matter what the 30 characters are; but the eval always times out if my -e expression is longer than 30 characters.

Cannot connect to process running in Phusion Passenger

I am trying to perform an rbtrace on a Rails app running in Phusion Passenger. If I execute a long running rake task it can connect just fine. If I connect it to the corresponding Passenger Process it tells me (pid is not listening for messages, did you require "rbtrace").

I have required rbtrace in the environment.rb. Passenger runs in production mode, and I am using REE 1.8.7. Is there any reason rbtrace would not work for a Passenger process?

0.4.11 build fails on Mac OS 10.15.6

I have a project that includes this version. Any way to get beyond the build error without upgrading the gem?

I ran CC=gcc-4.2 CFLAGS="" gem install rbtrace -v '0.4.11' and got this output:

Building native extensions. This could take a while...
ERROR:  Error installing rbtrace:
        ERROR: Failed to build gem native extension.

    current directory: /Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext
/Users/nathan/.asdf/installs/ruby/2.6.5/bin/ruby -I /Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/2.6.0 -r ./siteconf20200820-66048-7hlfh.rb extconf.rb
  -- tar zxvfo msgpack-1.1.0.tar.gz
  -- env CFLAGS="" LDFLAGS="-L/usr/local/opt/openssl/lib" CC="gcc-4.2"
  -- ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/dst/ --libdir=/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/dst/lib
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/nathan/.asdf/installs/ruby/2.6.5/bin/$(RUBY_BASE_NAME)
extconf.rb:6:in `sys': ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/dst/ --libdir=/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/dst/lib failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
        from extconf.rb:42:in `block (2 levels) in <main>'
        from extconf.rb:34:in `chdir'
        from extconf.rb:34:in `block in <main>'
        from extconf.rb:30:in `chdir'
        from extconf.rb:30:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-19/2.6.0/rbtrace-0.4.11/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11 for inspection.
Results logged to /Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-19/2.6.0/rbtrace-0.4.11/gem_make.out

The mkmf.log shows this:

Building msgpack
"tar zxvfo msgpack-1.1.0.tar.gz"
msgpack-1.1.0/
msgpack-1.1.0/test/
msgpack-1.1.0/test/pack_unpack.cpp
msgpack-1.1.0/test/cases.cpp
msgpack-1.1.0/test/buffer.cpp
msgpack-1.1.0/test/CMakeLists.txt
msgpack-1.1.0/test/streaming.cpp
msgpack-1.1.0/test/msgpack_vref.cpp
msgpack-1.1.0/test/object.cpp
msgpack-1.1.0/test/fixint_c.cpp
msgpack-1.1.0/test/msgpack_stream.cpp
msgpack-1.1.0/test/msgpack_container.cpp
msgpack-1.1.0/test/fixint.cpp
msgpack-1.1.0/test/reference.cpp
msgpack-1.1.0/test/msgpack_basic.cpp
msgpack-1.1.0/test/Makefile.in
msgpack-1.1.0/test/cases.mpac
msgpack-1.1.0/test/pack_unpack_c.cpp
msgpack-1.1.0/test/zone.cpp
msgpack-1.1.0/test/msgpack_cpp11.cpp
msgpack-1.1.0/test/msgpack_tuple.cpp
msgpack-1.1.0/test/object_with_zone.cpp
msgpack-1.1.0/test/convert.cpp
msgpack-1.1.0/test/cases_compact.mpac
msgpack-1.1.0/test/reference_cpp11.cpp
msgpack-1.1.0/test/Makefile.am
msgpack-1.1.0/test/iterator_cpp11.cpp
msgpack-1.1.0/test/msgpack_c.cpp
msgpack-1.1.0/test/streaming_c.cpp
msgpack-1.1.0/test/version.cpp
msgpack-1.1.0/test/limit.cpp
msgpack-1.1.0/include/
msgpack-1.1.0/include/msgpack/
msgpack-1.1.0/include/msgpack/vrefbuffer.hpp
msgpack-1.1.0/include/msgpack/fbuffer.h
msgpack-1.1.0/include/msgpack/object_fwd.hpp
msgpack-1.1.0/include/msgpack/unpack_define.h
msgpack-1.1.0/include/msgpack/detail/
msgpack-1.1.0/include/msgpack/detail/cpp03_zone.hpp
msgpack-1.1.0/include/msgpack/detail/cpp11_zone.hpp
msgpack-1.1.0/include/msgpack/version_master.h
msgpack-1.1.0/include/msgpack/zone.h
msgpack-1.1.0/include/msgpack/unpack_template.h
msgpack-1.1.0/include/msgpack/iterator.hpp
msgpack-1.1.0/include/msgpack/fbuffer.hpp
msgpack-1.1.0/include/msgpack/unpack.hpp
msgpack-1.1.0/include/msgpack/zbuffer.h
msgpack-1.1.0/include/msgpack/object.h
msgpack-1.1.0/include/msgpack/gcc_atomic.h
msgpack-1.1.0/include/msgpack/unpack.h
msgpack-1.1.0/include/msgpack/pack_define.h
msgpack-1.1.0/include/msgpack/pack.hpp
msgpack-1.1.0/include/msgpack/adaptor/
msgpack-1.1.0/include/msgpack/adaptor/set.hpp
msgpack-1.1.0/include/msgpack/adaptor/raw.hpp
msgpack-1.1.0/include/msgpack/adaptor/detail/
msgpack-1.1.0/include/msgpack/adaptor/detail/cpp11_msgpack_tuple.hpp
msgpack-1.1.0/include/msgpack/adaptor/detail/cpp11_define.hpp
msgpack-1.1.0/include/msgpack/adaptor/detail/cpp03_define.hpp
msgpack-1.1.0/include/msgpack/adaptor/detail/cpp03_msgpack_tuple.hpp
msgpack-1.1.0/include/msgpack/adaptor/fixint.hpp
msgpack-1.1.0/include/msgpack/adaptor/string.hpp
msgpack-1.1.0/include/msgpack/adaptor/vector_bool.hpp
msgpack-1.1.0/include/msgpack/adaptor/define.hpp
msgpack-1.1.0/include/msgpack/adaptor/vector.hpp
msgpack-1.1.0/include/msgpack/adaptor/cpp11/
msgpack-1.1.0/include/msgpack/adaptor/cpp11/tuple.hpp
msgpack-1.1.0/include/msgpack/adaptor/cpp11/array_char.hpp
msgpack-1.1.0/include/msgpack/adaptor/cpp11/unordered_map.hpp
msgpack-1.1.0/include/msgpack/adaptor/cpp11/forward_list.hpp
msgpack-1.1.0/include/msgpack/adaptor/cpp11/array.hpp
msgpack-1.1.0/include/msgpack/adaptor/cpp11/unordered_set.hpp
msgpack-1.1.0/include/msgpack/adaptor/vector_char.hpp
msgpack-1.1.0/include/msgpack/adaptor/list.hpp
msgpack-1.1.0/include/msgpack/adaptor/float.hpp
msgpack-1.1.0/include/msgpack/adaptor/adaptor_base.hpp
msgpack-1.1.0/include/msgpack/adaptor/int.hpp
msgpack-1.1.0/include/msgpack/adaptor/deque.hpp
msgpack-1.1.0/include/msgpack/adaptor/map.hpp
msgpack-1.1.0/include/msgpack/adaptor/check_container_size.hpp
msgpack-1.1.0/include/msgpack/adaptor/pair.hpp
msgpack-1.1.0/include/msgpack/adaptor/msgpack_tuple.hpp
msgpack-1.1.0/include/msgpack/adaptor/bool.hpp
msgpack-1.1.0/include/msgpack/adaptor/nil.hpp
msgpack-1.1.0/include/msgpack/adaptor/char_ptr.hpp
msgpack-1.1.0/include/msgpack/adaptor/tr1/
msgpack-1.1.0/include/msgpack/adaptor/tr1/unordered_map.hpp
msgpack-1.1.0/include/msgpack/adaptor/tr1/unordered_set.hpp
msgpack-1.1.0/include/msgpack/pack_template.h
msgpack-1.1.0/include/msgpack/sbuffer.h
msgpack-1.1.0/include/msgpack/sbuffer.hpp
msgpack-1.1.0/include/msgpack/type.hpp
msgpack-1.1.0/include/msgpack/zone.hpp
msgpack-1.1.0/include/msgpack/versioning.hpp
msgpack-1.1.0/include/msgpack/pack.h
msgpack-1.1.0/include/msgpack/vrefbuffer.h
msgpack-1.1.0/include/msgpack/zbuffer.hpp
msgpack-1.1.0/include/msgpack/cpp_config.hpp
msgpack-1.1.0/include/msgpack/sysdep.h
msgpack-1.1.0/include/msgpack/version.h
msgpack-1.1.0/include/msgpack/util.h
msgpack-1.1.0/include/msgpack/object.hpp
msgpack-1.1.0/include/msgpack/version.hpp
msgpack-1.1.0/include/msgpack.h
msgpack-1.1.0/include/msgpack.hpp
msgpack-1.1.0/CMakeLists.txt
msgpack-1.1.0/erb/
msgpack-1.1.0/erb/cpp03_define.hpp.erb
msgpack-1.1.0/erb/cpp03_msgpack_tuple.hpp.erb
msgpack-1.1.0/erb/cpp03_zone.hpp.erb
msgpack-1.1.0/NOTICE
msgpack-1.1.0/msgpack.pc.in
msgpack-1.1.0/AUTHORS
msgpack-1.1.0/LICENSE
msgpack-1.1.0/configure.in
msgpack-1.1.0/msgpack_vc8.sln
msgpack-1.1.0/config.h.in
msgpack-1.1.0/Makefile.in
msgpack-1.1.0/configure
msgpack-1.1.0/msgpack_vc8.vcproj
msgpack-1.1.0/README.md
msgpack-1.1.0/ac/
msgpack-1.1.0/ac/compile
msgpack-1.1.0/ac/config.sub
msgpack-1.1.0/ac/config.guess
msgpack-1.1.0/ac/missing
msgpack-1.1.0/ac/test-driver
msgpack-1.1.0/ac/ltmain.sh
msgpack-1.1.0/ac/install-sh
msgpack-1.1.0/ac/depcomp
msgpack-1.1.0/INSTALL
msgpack-1.1.0/Makefile.am
msgpack-1.1.0/aclocal.m4
msgpack-1.1.0/ChangeLog
msgpack-1.1.0/NEWS
msgpack-1.1.0/src/
msgpack-1.1.0/src/zone.c
msgpack-1.1.0/src/objectc.c
msgpack-1.1.0/src/unpack.c
msgpack-1.1.0/src/Makefile.in
msgpack-1.1.0/src/vrefbuffer.c
msgpack-1.1.0/src/version.c
msgpack-1.1.0/src/Makefile.am
msgpack-1.1.0/COPYING
msgpack-1.1.0/README
msgpack-1.1.0/msgpack_vc.postbuild.bat
"./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/dst/ --libdir=/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/dst/lib"
checking for a BSD-compatible install... /usr/local/opt/coreutils/libexec/gnubin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/opt/coreutils/libexec/gnubin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/nathan/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rbtrace-0.4.11/ext/src/msgpack-1.1.0':
configure: error: C compiler cannot create executables
See `config.log' for more details

Thanks

Fiddle

The gem requires fiddle if version > 1.9, and I have tried ruby 1.9.2p136 and 1.9.2p180. Is there a fiddle gem hiding out there somewhere?

rbtrace
internal:lib/rubygems/custom_require:29:in require': no such file to load -- fiddle (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire'
from /usr/local/lib/ruby/gems/1.9.1/gems/rbtrace-0.3.7/bin/rbtrace:65:in <module:MsgQ>' from /usr/local/lib/ruby/gems/1.9.1/gems/rbtrace-0.3.7/bin/rbtrace:25:in<top (required)>'
from /usr/local/bin/rbtrace:19:in load' from /usr/local/bin/rbtrace:19:in

'

0.3.11: <RangeError: 0x5baee830 is not id value>

Been trying to check parameters on Merb and get this error. Made this simple script to test and same error occurs:

require 'rubygems'
require 'rbtrace'

class MyClass
  def self.movie
    "Space 1999"
  end
  def self.get_year(phrase)
    phrase.scan(/[0-9].*/)
  end
end
while true do
  puts MyClass.get_year(MyClass.movie)
  sleep 3
end

•  pedro $ ruby -v

ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]

•  pedro $ uname -a

Linux zorglub 2.6.35-27-generic #48-Ubuntu SMP Tue Feb 22 20:25:29 UTC 2011 i686 GNU/Linux

•  pedro $ rbtrace -p 5863 -m "MyClass.get_year(self, self.length, phrase)"

*** run sudo sysctl kernel.msgmnb=1048576 to prevent losing events (currently: 16384 bytes)
*** attached to process 5863
MyClass.get_year(self=MyClass, self.length=#<RangeError: 0x5baee830 is not id value>, phrase=#<RangeError: 0x5baee830 is not id value>) <0.000327>
MyClass.get_year(self=MyClass, self.length=#<RangeError: 0x5baee830 is not id value>, phrase=#<RangeError: 0x5baee830 is not id value>) <0.000346>
MyClass.get_year(self=MyClass, self.length=#<RangeError: 0x5baee830 is not id value>, phrase=#<RangeError: 0x5baee830 is not id value>) <0.000348>

GC tracing not working

With this script:

a = []
loop do
  a << Array.new(10000) { "foobar" * rand(1000) }

  if a.count % 1000
    print '.'
    a.clear
  end
end

No GC visible:

$ rbtrace --gc --exec ruby gc_test.rb
*** spawned child 1533499: "ruby", "gc_test.rb"
...................*** attached to process 1533499
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................^C..*** detached from process 1533499
*** waiting on spawned child 1533499

Using Ruby 3.3.0 and rbtrace 0.5.1

Installation fails on Gentoo/amd64

I believe 2e10567 is causing the build to fail on my system:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby21 extconf.rb
  -- tar zxvf msgpack-0.5.7.tar.gz
  -- ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/home/rpgforum/.gem/ruby/2.1.0/gems/rbtrace-0.4.4/ext/dst/
  -- make install
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby21
/usr/lib64/ruby/2.1.0/fileutils.rb:1573:in `stat': No such file or directory @ rb_file_s_stat - /home/user/.gem/ruby/2.1.0/gems/rbtrace-0.4.4/ext/dst/lib64/libmsgpackc.a (Errno::ENOENT)
        from /usr/lib64/ruby/2.1.0/fileutils.rb:1573:in `block in fu_each_src_dest'
        from /usr/lib64/ruby/2.1.0/fileutils.rb:1589:in `fu_each_src_dest0'
        from /usr/lib64/ruby/2.1.0/fileutils.rb:1571:in `fu_each_src_dest'
        from /usr/lib64/ruby/2.1.0/fileutils.rb:399:in `cp'
        from extconf.rb:54:in `<main>'

From mkmf.log:

Libraries have been installed in:
/home/user/.gem/ruby/2.1.0/gems/rbtrace-0.4.4/ext/dst/lib

--pid (pid is not listening for messages ...

I'm running a rbtrace on a plain ruby project with celluloid (Ruby version 2.2.2).

Trying to run a rbtrace from Terminal.

rbtrace -p 9831 -e 'Thread.new{GC.start;require "objspace";io=File.open("9831/FIRST.json", "w"); ObjectSpace.dump_all(output: io); io.close}'

Yield the following result
Error: argument --pid (pid is not listening for messages, did you require "rbtrace").

rbtrace is required successfully on the project.

No idea what is wrong over here.

OS : Ubuntu 16.04 LTS
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

sudo lsof -p 9831 | grep rbtrace
ruby    9831 joshianiket22  mem       REG                8,1   829136  525167 /home/joshianiket22/.rvm/gems/ruby-2.2.2@the_scp/gems/rbtrace-0.4.8/lib/rbtrace.so

Can't install gem on OSX 10.5.8

Can't install the gem on my OSX laptop. Details below. Let me know if you need more info.

OSX 10.5.8
$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]

$ sudo gem install rbtrace
Building native extensions. This could take a while...
ERROR: Error installing rbtrace:
ERROR: Failed to build gem native extension.

/opt/local/bin/ruby extconf.rb
-- tar zxvf msgpack-0.5.4.tar.gz
-- ./configure --disable-dependency-tracking --disable-shared --disable-cxx --with-pic --prefix=/opt/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.12/ext/dst/
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/local/bin/ruby
extconf.rb:6:in sys': ./configure --disable-dependency-tracking --disable-shared --disable-cxx --with-pic --prefix=/opt/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.12/ext/dst/ failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError) from extconf.rb:35 from extconf.rb:31:inchdir'
from extconf.rb:31
from extconf.rb:27:in `chdir'
from extconf.rb:27

ThreadError: can't be called from trap context

I'm trying to follow this guide with ruby 2.4.6 & rails 4.2.11.1.

On my locally running sidekiq instance it does not seem to work:

bundle exec rbtrace -p <pid> -e "load 'command.rb'"

I've put the following line in command.rb to work around the Mac OS line-too-long issue:

Thread.new{GC.start; require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}

In my application.rb I have:

require 'rbtrace'
require 'objspace'
ObjectSpace.trace_object_allocations_start

Yet, the result I get is:

*** attached to process 24295
>> load 'yolo.rb'
=> #<ThreadError: can't be called from trap context>
*** detached from process 24295

Please advise how I can get around this, thanks in advance.

segmentation fault (code_generation.rb)

attaching rbtrace (0.3.6) with --slow 250 to a Rails v3.0.4 development server (using Thin) triggers the following:

/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:82: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

-- control frame ----------
c:0067 p:0528 s:0318 b:0318 l:000317 d:000317 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:82
c:0066 p:0198 s:0308 b:0308 l:000307 d:000307 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:92
c:0065 p:0092 s:0302 b:0302 l:000301 d:000301 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/route_set.rb:139
c:0064 p:0025 s:0296 b:0296 l:000295 d:000295 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/routing/route_set.rb:492
c:0063 p:0100 s:0292 b:0292 l:000291 d:000291 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/strategy.rb:50
c:0062 p:0168 s:0289 b:0289 l:000288 d:000288 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/strategy.rb:32
c:0061 p:0019 s:0285 b:0285 l:000284 d:000284 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/strategy.rb:19
c:0060 p:0044 s:0281 b:0281 l:000280 d:000280 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/builder.rb:30
c:0059 p:0044 s:0277 b:0277 l:000276 d:000276 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/newrelic_rpm-2.13.4/lib/new_relic/rack/developer_mode.rb:20
c:0058 p:0017 s:0273 b:0273 l:000272 d:000272 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/hoptoad_notifier-2.4.6/lib/hoptoad_notifier/rack.rb:27
c:0057 p:0106 s:0266 b:0266 l:000265 d:000265 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.0.alpha.221/lib/sass/plugin/rack.rb:54
c:0056 p:0015 s:0262 b:0262 l:000261 d:000261 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/best_standards_support.rb:17
c:0055 p:0093 s:0255 b:0255 l:000254 d:000254 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/head.rb:14
c:0054 p:0155 s:0248 b:0248 l:000247 d:000247 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/methodoverride.rb:24
c:0053 p:0046 s:0242 b:0242 l:000241 d:000241 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/params_parser.rb:21
c:0052 p:0054 s:0237 b:0237 l:000236 d:000236 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/flash.rb:182
c:0051 p:0027 s:0230 b:0230 l:000229 d:000229 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/session/abstract_store.rb:149
c:0050 p:0169 s:0219 b:0219 l:000218 d:000218 METHOD /srv/betribes/app/middleware/flash_session_cookie_middleware.rb:15
c:0049 p:0015 s:0214 b:0214 l:000213 d:000213 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/cookies.rb:302
c:0048 p:0014 s:0206 b:0206 l:002240 d:000205 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:32
c:0047 p:0019 s:0204 b:0204 l:000203 d:000203 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/query_cache.rb
c:0046 p:0051 s:0200 b:0200 l:000199 d:000199 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:12
c:0045 p:0019 s:0196 b:0196 l:002240 d:002240 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:31
c:0044 p:0015 s:0192 b:0192 l:000191 d:000191 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/connection_poo
c:0043 p:0029 s:0188 b:0188 l:000fb0 d:000187 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:46
c:0042 p:0155 s:0186 b:0186 l:000185 d:000185 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:415
c:0041 p:0011 s:0176 b:0176 l:000fb0 d:000fb0 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:44
c:0040 p:0015 s:0172 b:0172 l:000171 d:000171 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/sendfile.rb:107
c:0039 p:0049 s:0162 b:0162 l:000161 d:000161 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/remote_ip.rb:48
c:0038 p:0017 s:0158 b:0158 l:000157 d:000157 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:47
c:0037 p:0027 s:0150 b:0150 l:000149 d:000149 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/logger.rb:13
c:0036 p:0032 s:0146 b:0146 l:000145 d:000145 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/runtime.rb:17
c:0035 p:0052 s:0137 b:0137 l:000136 d:000136 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/cache/strategy/local_cache.rb:72
c:0034 p:0014 s:0133 b:0133 l:000127 d:000132 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11
c:0033 p:0019 s:0131 b:0131 l:000130 d:000130 METHOD :10
c:0032 p:0054 s:0128 b:0128 l:000127 d:000127 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11
c:0031 p:0193 s:0123 b:0123 l:000122 d:000122 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/static.rb:30
c:0030 p:0015 s:0116 b:0116 l:000115 d:000115 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/hoptoad_notifier-2.4.6/lib/hoptoad_notifier/user_informer.rb:12
c:0029 p:0032 s:0109 b:0109 l:000108 d:000108 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:168
c:0028 p:0021 s:0105 b:0105 l:000104 d:000104 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:77
c:0027 p:---- s:0100 b:0100 l:000099 d:000099 FINISH
c:0026 p:0015 s:0098 b:0098 l:000097 d:000097 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/log_tailer.rb:14
c:0025 p:0015 s:0093 b:0093 l:000092 d:000092 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/content_length.rb:13
c:0024 p:0015 s:0085 b:0085 l:000084 d:000084 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/chunked.rb:15
c:0023 p:0020 s:0078 b:0078 l:000069 d:000077 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:76
c:0022 p:---- s:0076 b:0076 l:000075 d:000075 FINISH
c:0021 p:---- s:0074 b:0074 l:000073 d:000073 CFUNC  :catch
c:0020 p:0064 s:0070 b:0070 l:000069 d:000069 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:74
c:0019 p:0088 s:0066 b:0065 l:000064 d:000064 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:57
c:0018 p:0036 s:0062 b:0062 l:000061 d:000061 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:42
c:0017 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0016 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC  :run_machine
c:0015 p:0248 s:0052 b:0052 l:000051 d:000051 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:256
c:0014 p:0066 s:0045 b:0045 l:001500 d:001500 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/backends/base.rb:57
c:0013 p:0143 s:0041 b:0041 l:000040 d:000040 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/server.rb:156
c:0012 p:0117 s:0038 b:0038 l:000037 d:000037 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/handler/thin.rb:14
c:0011 p:0259 s:0032 b:0032 l:000168 d:000168 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:213
c:0010 p:0200 s:0027 b:0027 l:001c08 d:001c08 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands/server.rb:65
c:0009 p:0063 s:0024 b:0024 l:000015 d:000023 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:30
c:0008 p:---- s:0021 b:0021 l:000020 d:000020 FINISH
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC  :tap
c:0006 p:0468 s:0016 b:0016 l:000015 d:000015 TOP    /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:27
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require
c:0003 p:0061 s:0006 b:0006 l:0011d8 d:000ad8 EVAL   script/rails:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0011d8 d:0011d8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `'
script/rails:6:in `require'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:27:in `'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:27:in `tap'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:30:in `block in '
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands/server.rb:65:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/handler/thin.rb:14:in `run'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/server.rb:156:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:42:in `receive_data'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:57:in `process'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_process'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:74:in `catch'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/chunked.rb:15:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/content_length.rb:13:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/log_tailer.rb:14:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:77:in `method_missing'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:168:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/hoptoad_notifier-2.4.6/lib/hoptoad_notifier/user_informer.rb:12:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call'
:10:in `synchronize'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11:in `block in call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/runtime.rb:17:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/logger.rb:13:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/sendfile.rb:107:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:31:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:12:in `cache'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.4/lib/active_record/query_cache.rb:32:in `block in call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/srv/betribes/app/middleware/flash_session_cookie_middleware.rb:15:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/flash.rb:182:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/methodoverride.rb:24:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/head.rb:14:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/sass-3.1.0.alpha.221/lib/sass/plugin/rack.rb:54:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/hoptoad_notifier-2.4.6/lib/hoptoad_notifier/rack.rb:27:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/newrelic_rpm-2.13.4/lib/new_relic/rack/developer_mode.rb:20:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/builder.rb:30:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/strategy.rb:19:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/strategy.rb:32:in `call!'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/oa-core-0.1.6/lib/omniauth/strategy.rb:50:in `call_app!'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/routing/route_set.rb:492:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/route_set.rb:139:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:92:in `recognize'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-mount-0.6.13/lib/rack/mount/code_generation.rb:82:in `optimized_each'

-- C level backtrace information -------------------------------------------
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_vm_bugreport+0x5f) [0x7f6746cb135f]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x62b04) [0x7f6746b90b04]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_bug+0xb3) [0x7f6746b91a33]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x116715) [0x7f6746c44715]
/lib/libpthread.so.0(+0xf150) [0x7f6746920150]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(st_lookup+0x88) [0x7f6746c4c288]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x155b5a) [0x7f6746c83b5a]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_class_path+0x16) [0x7f6746c85016]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_class2name+0x9) [0x7f6746c85189]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rbtrace-0.3.6/lib/rbtrace.so(+0x2e4d) [0x7f6743d72e4d]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_threadptr_exec_event_hooks+0xdf) [0x7f6746cb4eaf]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x178dce) [0x7f6746ca6dce]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17a488) [0x7f6746ca8488]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17ac46) [0x7f6746ca8c46]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d37d) [0x7f6746cab37d]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7f6746ca0d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7f6746ca71ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17df51) [0x7f6746cabf51]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_catch_obj+0xc6) [0x7f6746c9f126]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1711de) [0x7f6746c9f1de]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7f6746cab206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7f6746ca0d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7f6746ca71ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17a488) [0x7f6746ca8488]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_funcall+0xba) [0x7f6746ca90ea]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(+0x1b048) [0x7f67434b0048]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN20ConnectionDescriptor20_DispatchInboundDataEPKci+0xa8) [0x7f67434b6d08]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN20ConnectionDescriptor4ReadEv+0x7e) [0x7f67434b6d9e]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN14EventMachine_t14_RunSelectOnceEv+0x2e2) [0x7f67434a8592]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN14EventMachine_t3RunEv+0x44) [0x7f67434ab564]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(+0x1aa39) [0x7f67434afa39]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7f6746cab206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7f6746ca0d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7f6746ca71ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_yield+0x47) [0x7f6746cac0b7]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_obj_tap+0x9) [0x7f6746be09e9]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7f6746cab206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7f6746ca0d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7f6746ca71ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_iseq_eval+0x1f0) [0x7f6746cac5a0]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x6c660) [0x7f6746b9a660]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_require_safe+0x6cf) [0x7f6746b9bbef]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7f6746cab206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7f6746ca0d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7f6746ca71ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_iseq_eval_main+0xb1) [0x7f6746cac6a1]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x68eba) [0x7f6746b96eba]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(ruby_exec_node+0x1d) [0x7f6746b97e1d]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(ruby_run_node+0x1e) [0x7f6746b9a08e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/bin/ruby(main+0x4b) [0x4009ab]
/lib/libc.so.6(__libc_start_main+0xfd) [0x7f6745d08dcd]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/bin/ruby() [0x400899]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted

this does not happen with rbTrace attached to it.

system info:

[sardaukar@arch-calypso betribes (omniauth *)]$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
[sardaukar@arch-calypso betribes (omniauth *)]$ uname -a
Linux arch-calypso 2.6.37-ARCH #1 SMP PREEMPT Fri Feb 18 18:32:16 CET 2011 x86_64 Intel(R) Core(TM)2 Duo CPU P7350 @ 2.00GHz GenuineIntel GNU/Linux
[sardaukar@arch-calypso betribes (omniauth *)]$ rbtrace -v
*** removing stale message queue pair: 0x0000212d/0xffffded3
rbtrace: like strace, but for ruby code
  version 0.3.6
  (c) 2011 Aman Gupta (tmm1)
  http://github.com/tmm1/rbtrace

Also, if I attach it (with --f) to a recently booted up server (with no requests satisfied yet), I get this:

/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:135: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

-- control frame ----------
c:0060 p:---- s:0251 b:0251 l:000250 d:000250 CFUNC  :load
c:0059 p:0019 s:0247 b:0247 l:000246 d:000246 METHOD /home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:135
c:0058 p:0012 s:0242 b:0242 l:000232 d:000241 BLOCK  /home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:146
c:0057 p:---- s:0239 b:0239 l:000238 d:000238 FINISH
c:0056 p:---- s:0237 b:0237 l:000236 d:000236 CFUNC  :open
c:0055 p:0019 s:0233 b:0233 l:000232 d:000232 METHOD /home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:145
c:0054 p:0019 s:0229 b:0229 l:000228 d:000228 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:170
c:0053 p:0112 s:0225 b:0225 l:000224 d:000224 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:156
c:0052 p:0012 s:0219 b:0219 l:000210 d:000218 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:15
c:0051 p:---- s:0216 b:0216 l:000215 d:000215 FINISH
c:0050 p:---- s:0214 b:0214 l:000213 d:000213 CFUNC  :each
c:0049 p:0045 s:0211 b:0211 l:000210 d:000210 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:15
c:0048 p:0011 s:0207 b:0207 l:000206 d:000206 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/simple.rb:55
c:0047 p:0020 s:0204 b:0204 l:000203 d:000203 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/simple.rb:38
c:0046 p:0043 s:0201 b:0201 l:001ee8 d:000200 LAMBDA /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/bundler/gems/thinking-sphinx-849d0fe4ad49/lib/thinking_sphinx/railtie.rb:26
c:0045 p:---- s:0199 b:0199 l:000198 d:000198 FINISH
c:0044 p:0168 s:0197 b:0197 l:000196 d:000196 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:419
c:0043 p:0014 s:0188 b:0188 l:001c40 d:000187 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:45
c:0042 p:0155 s:0186 b:0186 l:000185 d:000185 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:415
c:0041 p:0011 s:0176 b:0176 l:001c40 d:001c40 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:44
c:0040 p:0015 s:0172 b:0172 l:000171 d:000171 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/sendfile.rb:107
c:0039 p:0049 s:0162 b:0162 l:000161 d:000161 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/remote_ip.rb:48
c:0038 p:0017 s:0158 b:0158 l:000157 d:000157 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:47
c:0037 p:0027 s:0150 b:0150 l:000149 d:000149 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/logger.rb:13
c:0036 p:0032 s:0146 b:0146 l:000145 d:000145 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/runtime.rb:17
c:0035 p:0052 s:0137 b:0137 l:000136 d:000136 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/cache/strategy/local_cache.rb:72
c:0034 p:0014 s:0133 b:0133 l:000127 d:000132 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11
c:0033 p:0019 s:0131 b:0131 l:000130 d:000130 METHOD :10
c:0032 p:0054 s:0128 b:0128 l:000127 d:000127 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11
c:0031 p:0193 s:0123 b:0123 l:000122 d:000122 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/static.rb:30
c:0030 p:0015 s:0116 b:0116 l:000115 d:000115 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/hoptoad_notifier-2.4.6/lib/hoptoad_notifier/user_informer.rb:12
c:0029 p:0032 s:0109 b:0109 l:000108 d:000108 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:168
c:0028 p:0021 s:0105 b:0105 l:000104 d:000104 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:77
c:0027 p:---- s:0100 b:0100 l:000099 d:000099 FINISH
c:0026 p:0015 s:0098 b:0098 l:000097 d:000097 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/log_tailer.rb:14
c:0025 p:0015 s:0093 b:0093 l:000092 d:000092 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/content_length.rb:13
c:0024 p:0015 s:0085 b:0085 l:000084 d:000084 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/chunked.rb:15
c:0023 p:0020 s:0078 b:0078 l:000069 d:000077 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:76
c:0022 p:---- s:0076 b:0076 l:000075 d:000075 FINISH
c:0021 p:---- s:0074 b:0074 l:000073 d:000073 CFUNC  :catch
c:0020 p:0064 s:0070 b:0070 l:000069 d:000069 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:74
c:0019 p:0088 s:0066 b:0065 l:000064 d:000064 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:57
c:0018 p:0036 s:0062 b:0062 l:000061 d:000061 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:42
c:0017 p:---- s:0057 b:0057 l:000056 d:000056 FINISH
c:0016 p:---- s:0055 b:0055 l:000054 d:000054 CFUNC  :run_machine
c:0015 p:0248 s:0052 b:0052 l:000051 d:000051 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:256
c:0014 p:0066 s:0045 b:0045 l:001240 d:001240 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/backends/base.rb:57
c:0013 p:0143 s:0041 b:0041 l:000040 d:000040 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/server.rb:156
c:0012 p:0117 s:0038 b:0038 l:000037 d:000037 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/handler/thin.rb:14
c:0011 p:0259 s:0032 b:0032 l:000e08 d:000e08 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:213
c:0010 p:0200 s:0027 b:0027 l:001108 d:001108 METHOD /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands/server.rb:65
c:0009 p:0063 s:0024 b:0024 l:000015 d:000023 BLOCK  /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:30
c:0008 p:---- s:0021 b:0021 l:000020 d:000020 FINISH
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC  :tap
c:0006 p:0468 s:0016 b:0016 l:000015 d:000015 TOP    /home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:27
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require
c:0003 p:0061 s:0006 b:0006 l:0020d8 d:0019d8 EVAL   script/rails:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0020d8 d:0020d8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `'
script/rails:6:in `require'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:27:in `'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:27:in `tap'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands.rb:30:in `block in '
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/commands/server.rb:65:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/handler/thin.rb:14:in `run'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/server.rb:156:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in `start'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:42:in `receive_data'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:57:in `process'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_process'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:74:in `catch'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/chunked.rb:15:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/content_length.rb:13:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/log_tailer.rb:14:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:77:in `method_missing'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/application.rb:168:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/hoptoad_notifier-2.4.6/lib/hoptoad_notifier/user_informer.rb:12:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/static.rb:30:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call'
:10:in `synchronize'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/lock.rb:11:in `block in call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/runtime.rb:17:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.4/lib/rails/rack/logger.rb:13:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.2.1/lib/rack/sendfile.rb:107:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/actionpack-3.0.4/lib/action_dispatch/middleware/callbacks.rb:45:in `block in call'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.4/lib/active_support/callbacks.rb:419:in `_run_prepare_callbacks'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/bundler/gems/thinking-sphinx-849d0fe4ad49/lib/thinking_sphinx/railtie.rb:26:in `block in '
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/simple.rb:38:in `available_locales'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/simple.rb:55:in `init_translations'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:15:in `load_translations'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:15:in `each'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:15:in `block in load_translations'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:156:in `load_file'
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/i18n-0.5.0/lib/i18n/backend/base.rb:170:in `load_yml'
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:145:in `load_file'
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:145:in `open'
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:146:in `block in load_file'
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:135:in `load'
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:135:in `load'

-- C level backtrace information -------------------------------------------
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_vm_bugreport+0x5f) [0x7fe5f546535f]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x62b04) [0x7fe5f5344b04]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_bug+0xb3) [0x7fe5f5345a33]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x116715) [0x7fe5f53f8715]
/lib/libpthread.so.0(+0xf150) [0x7fe5f50d4150]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(st_lookup+0x88) [0x7fe5f5400288]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x155b5a) [0x7fe5f5437b5a]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_class_path+0x16) [0x7fe5f5439016]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_class2name+0x9) [0x7fe5f5439189]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/rbtrace-0.3.6/lib/rbtrace.so(+0x31ed) [0x7fe5f25271ed]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_threadptr_exec_event_hooks+0xdf) [0x7fe5f5468eaf]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17a6d1) [0x7fe5f545c6d1]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_funcall+0xba) [0x7fe5f545d0ea]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-linux/syck.so(rb_syck_load_handler+0x47) [0x7fe5f397b767]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-linux/syck.so(syck_hdlr_add_node+0x23) [0x7fe5f3973063]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-linux/syck.so(syckparse+0x1063) [0x7fe5f3974583]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-linux/syck.so(syck_parse+0x19) [0x7fe5f3979409]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/x86_64-linux/syck.so(syck_parser_load+0xe5) [0x7fe5f397ded5]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_yield+0x47) [0x7fe5f54600b7]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_ensure+0xb3) [0x7fe5f534c643]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_yield+0x47) [0x7fe5f54600b7]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_ary_each+0x46) [0x7fe5f5313e66]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_vm_invoke_proc+0xa1) [0x7fe5f545c021]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d4a4) [0x7fe5f545f4a4]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17a488) [0x7fe5f545c488]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17ac46) [0x7fe5f545cc46]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d37d) [0x7fe5f545f37d]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17df51) [0x7fe5f545ff51]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_catch_obj+0xc6) [0x7fe5f5453126]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1711de) [0x7fe5f54531de]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17a488) [0x7fe5f545c488]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_funcall+0xba) [0x7fe5f545d0ea]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(+0x1b048) [0x7fe5f1c64048]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN20ConnectionDescriptor20_DispatchInboundDataEPKci+0xa8) [0x7fe5f1c6ad08]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN20ConnectionDescriptor4ReadEv+0x7e) [0x7fe5f1c6ad9e]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN14EventMachine_t14_RunSelectOnceEv+0x2e2) [0x7fe5f1c5c592]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(_ZN14EventMachine_t3RunEv+0x44) [0x7fe5f1c5f564]
/home/sardaukar/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-0.12.10/lib/rubyeventmachine.so(+0x1aa39) [0x7fe5f1c63a39]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_yield+0x47) [0x7fe5f54600b7]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_obj_tap+0x9) [0x7fe5f53949e9]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_iseq_eval+0x1f0) [0x7fe5f54605a0]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x6c660) [0x7fe5f534e660]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_require_safe+0x6cf) [0x7fe5f534fbef]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x17d206) [0x7fe5f545f206]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x172d8e) [0x7fe5f5454d8e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x1791ab) [0x7fe5f545b1ab]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_iseq_eval_main+0xb1) [0x7fe5f54606a1]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(+0x68eba) [0x7fe5f534aeba]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(ruby_exec_node+0x1d) [0x7fe5f534be1d]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(ruby_run_node+0x1e) [0x7fe5f534e08e]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/bin/ruby(main+0x4b) [0x4009ab]
/lib/libc.so.6(__libc_start_main+0xfd) [0x7fe5f44bcdcd]
/home/sardaukar/.rvm/rubies/ruby-1.9.2-p180/bin/ruby() [0x400899]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted

None of these occur without the trace.

Unable to reattach to puma worker

Maybe this is something unique to puma workers but we can't attach to them more than once:

a@b:/u/apps/c/current$ bundle exec rbtrace -p 7879 -e "1+1"
*** attached to process 7879
>> 1+1
=> 2
*** detached from process 7879
a@b:/u/apps/c/current$ ipcs

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
0xffffe139 1769473    app        666        0            0

If attach gdb here I can see it running the rbtracer_detach() cleanup just fine in the extension.

Now the subsequent call fails:

a@b:/u/apps/c/current$ bundle exec rbtrace -p 7879 -e "1+1"
Error: argument --pid (process already being traced?).
Try --help for help.
a@b:/u/apps/c/current$ ipcs

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages
0xffffe139 1769473    app        666        256          1

from some light gdb and stracing it appears that attempt #2 is sending SIGURG and writing to the message queue, but the rbtracer.so extension is no longer firing the signal handler. I can't figure out why.

gem install rbtrace no go with ruby 2.0.0 rc2

ERROR: Error installing rbtrace: [4/533]
ERROR: Failed to build gem native extension.

    /home/convo/.rvm/rubies/ruby-2.0.0-rc2/bin/ruby extconf.rb

-- tar zxvf msgpack-0.5.7.tar.gz
-- ./configure --disable-dependency-tracking --disable-shared --with-pic --prefix=/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/
-- make install
checking for main() in -lmsgpackc_ext... yes
checking for msgpack.h... yes
checking for rb_during_gc() in ruby.h... yes
creating Makefile

make
compiling rbtrace.c
In file included from /home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/object.h:21,
from /home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack.h:23,
from rbtrace.c:21:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/zone.h: In function ‘msgpack_zone_malloc_no_align’:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/zone.h:99: warning: ISO C90 forbids mixed declarations and code
In file included from /home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/pack.h:116,
from /home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack.h:25,
from rbtrace.c:21:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/pack_template.h: In function ‘msgpack_pack_float’:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/pack_template.h:639: warning: ISO C90 forbids mixed declarations and code
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/pack_template.h: In function ‘msgpack_pack_double’:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/pack_template.h:648: warning: ISO C90 forbids mixed declarations and code
In file included from /home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack.h:27,
from rbtrace.c:21:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/sbuffer.h: In function ‘msgpack_sbuffer_write’:
/home/convo/.rvm/gems/ruby-2.0.0-rc2@acd/gems/rbtrace-0.3.18/ext/dst/include/msgpack/sbuffer.h:77: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function ‘rbtrace__send_event’:
rbtrace.c:162: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:165: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:235: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:245: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:257: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function ‘event_hook’:
rbtrace.c:308: error: ‘ID_ALLOCATOR’ undeclared (first use in this function)
rbtrace.c:308: error: (Each undeclared identifier is reported only once
rbtrace.c:308: error: for each function it appears in.)
rbtrace.c:322: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:338: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:346: warning: comparison between signed and unsigned integer expressions
rbtrace.c: In function ‘rbtracer_detach’:
rbtrace.c:598: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function ‘rbtracer_add’:
rbtrace.c:632: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function ‘rbtrace__process_event’:
rbtrace.c:819: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:845: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:870: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:884: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:913: warning: ISO C90 forbids mixed declarations and code
rbtrace.c: In function ‘sigurg’:
rbtrace.c:979: warning: ISO C90 forbids mixed declarations and code
rbtrace.c:994: warning: ISO C90 forbids mixed declarations and code
make: *** [rbtrace.o] Error 1

Installation fails on systems that put libraries in 'lib64', not lib

A common pattern in Linux distros that emerged years ago is to separate the 32 bit libraries and 64 bit libraries. That includes OpenSUSE, which puts 64 binaries in a directory called lib64, i.e. ruby is installed into /usr/lib64/ruby/.

RbConfig::CONFIG['libdir'] #=> "/usr/lib64"

Which I think extconf.rb needs to be updated to account for that possibility.

Workarounds for jRuby support?

It seems all extension code is in C, for MRI/Rubinius. Are there any known ways to work around this, short of implementing Java bindings by some means?

Support for ruby2.7?

Hi,

Ruby 2.7 was out last year in December. Can you please update the gem to work with 2.7? :)

Source and self for all slow methods?

I can see all slow (p.e 10ms) methods with:

rbtrace -p PID -s 10

I can see source and self for a specific method with:

rbtrace -p PID -m "String#gsub(self, __source__)"

But, there is any way of seeing self and source with 'all' slow methods?
I've tried theese without luck (nothing shows):

rbtrace -p PID -s 10 -m "*(self, __source__)"
rbtrace -p PID -s 10 -m "*#*(self, __source__)"
rbtrace -p PID -s 10 -m "(self, __source__)"

Event this shows nothing (seen something similar in the documentation):

rbtrace -p PID -s 10 -m "String#*(self, __source__)"

Test computer is a RHEL7:

# ruby -v
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
# gem list

*** LOCAL GEMS ***

ast (2.1.0)
astrolabe (1.3.1)
bigdecimal (1.2.0)
coderay (1.1.0)
commander (4.3.5)
daemons (1.2.3)
eventmachine (1.0.8)
ffi (1.9.10)
highline (1.7.3)
io-console (0.4.2)
json (1.7.7)
method_source (0.8.2)
mini_portile (0.6.2)
msgpack (0.7.1)
net-ldap (0.11)
parser (2.2.2.6)
powerpack (0.1.1)
pry (0.10.1)
psych (2.0.0)
rack (1.6.4)
rack-protection (1.5.3)
rainbow (2.0.0)
rbtrace (0.4.7)
rdoc (4.0.0)
rubocop (0.34.1)
ruby-progressbar (1.7.5)
sinatra (1.4.6)
slop (3.6.0)
thin (1.6.3)
tilt (2.0.1)
tiny_tds (0.7.0)
trollop (2.1.2)

Anything I could try?

How come SIGURG is used?

Hey,

How come this tool uses SIGURG? This is a very strange signal to use.

As I understood it, the kernel can use this signal for other things, if you use fcntl in a specific way. Woulnd't this create a problem? Eg: make rbtrace read from a queue when there's nothing in it.

MessagePack::UnpackError

16:53:20.830672 times <0.447728>
error on : nil
*** detached from process 1917
/usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:448:in each': parse error. (MessagePack::UnpackError) from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:448:inparse_cmd'
from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:453:in process_line' from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:360:inrecv_lines'
from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:358:in times' from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:358:inrecv_lines'
from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:346:in recv_loop' from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:911:inrun'
from /usr/local/lib/ruby/gems/1.8/gems/rbtrace-0.3.11/bin/rbtrace:923
from /usr/local/bin/rbtrace:19:in `load'
from /usr/local/bin/rbtrace:19

Provide a method call to re-initialize rbtrace

It would be helpful if there were a simple way to reinitialize signal handlers (and anything else that is needed after forking) to work easier with things like passenger.

Passenger provides a callback that can be used after the signal handlers have been reset.

ruby 2.5.0dev (2017-11-10 trunk 60739) [x86_64-linux-gnu] breaks rbtrace

compiling rbtrace.c
rbtrace.c: In function ‘event_hook’:
rbtrace.c:329:5: warning: ‘rb_frame_method_id_and_class’ is deprecated [-Wdeprecated-declarations]
     rb_frame_method_id_and_class(&_mid, &_klass);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.5.0/ruby/ruby.h:24:0,
                 from /usr/include/ruby-2.5.0/ruby.h:33,
                 from rbtrace.c:24:
/usr/include/ruby-2.5.0/ruby/backward.h:53:37: note: declared here
 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_frame_method_id_and_class);
                                     ^
/usr/include/ruby-2.5.0/x86_64-linux-gnu/ruby/config.h:130:52: note: in definition of macro ‘NORETURN’
 #define NORETURN(x) __attribute__ ((__noreturn__)) x
                                                    ^
/usr/include/ruby-2.5.0/ruby/backward.h:39:14: note: in expansion of macro ‘ERRORFUNC’
     NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
              ^~~~~~~~~
/usr/include/ruby-2.5.0/ruby/backward.h:39:58: note: in expansion of macro ‘DEPRECATED’
     NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
                                                          ^~~~~~~~~~
/usr/include/ruby-2.5.0/ruby/backward.h:53:1: note: in expansion of macro ‘DECLARE_DEPRECATED_INTERNAL_FEATURE’
 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_frame_method_id_and_class);
 ^
rbtrace.c:329:5: error: too many arguments to function ‘rb_frame_method_id_and_class’
     rb_frame_method_id_and_class(&_mid, &_klass);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.5.0/ruby/ruby.h:24:0,
                 from /usr/include/ruby-2.5.0/ruby.h:33,
                 from rbtrace.c:24:
/usr/include/ruby-2.5.0/ruby/backward.h:53:37: note: declared here
 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_frame_method_id_and_class);
                                     ^
/usr/include/ruby-2.5.0/x86_64-linux-gnu/ruby/config.h:130:52: note: in definition of macro ‘NORETURN’
 #define NORETURN(x) __attribute__ ((__noreturn__)) x
                                                    ^
/usr/include/ruby-2.5.0/ruby/backward.h:39:14: note: in expansion of macro ‘ERRORFUNC’
     NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
              ^~~~~~~~~
/usr/include/ruby-2.5.0/ruby/backward.h:39:58: note: in expansion of macro ‘DEPRECATED’
     NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
                                                          ^~~~~~~~~~
/usr/include/ruby-2.5.0/ruby/backward.h:53:1: note: in expansion of macro ‘DECLARE_DEPRECATED_INTERNAL_FEATURE’
 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_frame_method_id_and_class);
 ^
rbtrace.c: In function ‘sigurg’:
rbtrace.c:1084:3: warning: implicit declaration of function ‘rb_postponed_job_register_one’ [-Wimplicit-function-declaration]
   rb_postponed_job_register_one(0, rbtrace__receive, 0);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:242: rbtrace.o] Error 1
ERROR:  Error installing /home/abuild/rpmbuild/SOURCES/rbtrace-0.4.8.gem:
        ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.
make failed, exit code 2

Native extension won’t compile on macOS 10.16/11.0 Big Sur beta

$ gem install rbtrace
...
rbtrace.c:1097:3: error: implicit declaration of function 'rb_postponed_job_register_one' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  rb_postponed_job_register_one(0, rbtrace__receive, 0);
  ^
2 warnings and 1 error generated.
make: *** [rbtrace.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/george/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rbtrace-0.4.13 for inspection.
Results logged to /Users/george/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/rbtrace-0.4.13/gem_make.out

The proximate cause of this appears to be that clang from the Xcode 12 Beta Command Line Tools now sets -Werror=implicit-function-declaration by default:

Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)

Passing -Wno-implicit-function-declaration fixes:

$ gem install rbtrace -- --with-cflags=-Wno-implicit-function-declaration
Building native extensions with: '--with-cflags=-Wno-implicit-function-declaration'
This could take a while...
Successfully installed rbtrace-0.4.13
1 gem installed

…though it might be unintentional that we’re relying on the implicit declaration of rb_postponed_job_register_one.

NameError: undefined local variable or method `irb' for module RBTrace

I'm getting this after attaching to a process interactively:

$ rbtrace -i -p 1506101
*** attached to process 1506101
irb(main):001> self
=> #<NameError: undefined local variable or method `irb' for module RBTrace>
irb(main):002> help
=> #<NameError: undefined local variable or method `irb' for module RBTrace>

Using Ruby 3.3.0 and rbtrace 0.5.1

rbtrace ignores the value for --slow, always uses 250ms

No matter what value you give to --slow, it always traces calls slower than 250ms.

How to reproduce:

  • Run rbtrace --slow 1 --exec some_script.rb
  • The output contains no methods that took less than 250ms
  • Run rbtrace --slow 1000 --exec some_script.rb
  • The output contains methods that took between 1s and 250ms

undefined symbol: RBASIC_CLASS

I get an error in my unicorn log (presumably) when rbtrace hits a certain type of method call in the process it's tracing. The error is:
<snip>/vendor/bundle/ruby/2.0.0/gems/rbtrace-0.4.6/lib/rbtrace.so: undefined symbol: RBASIC_CLASS

The version of ruby I'm running:

$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]

Any suggestions on if this is something I can fix myself?

pid is not listening attempting to connect to irb/pry

Hi!

I am trying to produce a heap dump from a Rails console but there seems to be a problem with the message queue. I put rbtrace in my Gemfile with require:false, then I started the Rails console (bundle exec rails c), then I ran "require 'rbtrace'" in the console and got "true" as a response.

In another window I looked up the PID of the ruby process and ran:
rbtrace --pid 6591 --gc

Which gave me:
Error: argument --pid (pid is not listening for messages, did you require "rbtrace").

I looked in /tmp and there were indeed no rbtrace socket files that I could see.
I am running Ubuntu 14.04, Rails 3.2.21, Ruby 2.1.4p265 - if any of that matters.

Any ideas?

PID not listening?

Hello! I have the following setup, using rails 4.0.6

def create
  require "rbtrace"
  pid    = Process.pid
  result = system("bundle exec rbtrace -u 5000 -p #{pid} -e 'load #{Rails.root}/script/heap_dump.rb'")
  render json: { status: result }
end
  • require "rbtrace" returns true
  • my Gemfile does not require the gem, i.e: gem "rbtrace", require: false

And I still get the following error:

Error: argument --pid (pid is not listening for messages, did you `require "rbtrace"`).

PID is defined and I'm running in a separate thread which I later then join to the main one, i.e:

# heap_dump.rb

Thread.new do
  require "objspace"
  # should rbtrace be required here?
  ObjectSpace.trace_object_allocations_start
  GC.start
  filename = "#{DateTime.now.strftime("%d-%^B-%Y")}-#{ENV["USER"]}-#{Rails.env.upcase}.json"
  ObjectSpace.dump_all(output: File.open(filename, "w"))

  s3 = Aws::S3::Resource.new(credentials: Aws::Credentials.new(ENV["AWS_ACCESS_KEY_ID"], ENV["AWS_SECRET_ACCESS_KEY"]),
                             region: "us-east-1")

  object = s3.bucket("memory-benchmarks").object(filename)
  object.upload_file(filename, acl: "authenticated-read")
end.join

Maybe I need to require rbtrace on the block passed to the new thread :) but if there's any known issues around requiring the library it would be good to know :)

I'm also using puma as my web server

timeout parameter ignored

using timeout 3000 it fails after maybe 5-10 seconds.

rbtrace -p 12304 --timeout 3000 -e 'Thread.new{require "objspace"; ObjectSpace::trace_object_allocations_start; GC.start(); ObjectSpace.dump_all(output: File.open("heap1.json", "w"))}.join'
*** run sudo sysctl kernel.msgmnb=1048576 to prevent losing events (currently: 16384 bytes)
*** attached to process 12304
*** timed out waiting for eval response

allow command to be passed to rbtrace

I would love to be able to run something like rbtrace ruby config/environment.rb much like I'd be able to run strace ruby config/environment.rb.

I can't imagine this is too hard, even if it needs to be in a more explicit format like rbtrace --run 'ruby config/environment.rb'

What do you think? Up until now i've been doing the rather inefficient dance of:

  1. Run ruby command
  2. Stop ruby process with Ctrl-Z
  3. get pid with ps | grep ruby
  4. run rbtrace on pid with options

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.