Skip to content

latest perftools (0.4.7) crashed ruby when running "complex" scripts (Snow Leopard x86_64) #11

Closed

Description

@thieso2

Running simple ruby scripts with perftools works fine! but i'd like to find the hotspots in my more complex apps but running them with perftools crashes ruby. to reproduce simply try to run rake with perftools:

CPUPROFILE=/tmp/my_app_profile RUBYOPT="-rgem which perftools | tail -1" ruby -S rake

> CPUPROFILE=/tmp/my_app_profile RUBYOPT="-rgem which perftools | tail -1" ruby -S rake

/Users/thieso/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rubygems.rb:10: [BUG] Segmentation fault
ruby 1.9.2dev (2010-07-11 revision 28618) [x86_64-darwin10.4.0]

-- control frame ----------
c:0010 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC :require
c:0009 p:0025 s:0028 b:0028 l:000027 d:000027 TOP /Users/thieso/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rubygems.rb:10
c:0008 p:---- s:0025 b:0025 l:000024 d:000024 FINISH
c:0007 p:---- s:0023 b:0023 l:000022 d:000022 CFUNC :require
c:0006 p:0123 s:0019 b:0019 l:000018 d:000018 METHOD internal:gem_prelude:158
c:0005 p:0017 s:0016 b:0016 l:000015 d:000015 METHOD internal:gem_prelude:280
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 FINISH
c:0003 p:0121 s:0008 b:0007 l:001588 d:001f90 EVAL /Users/thieso/.rvm/gems/ruby-1.9.2-rc2/bin/rake:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH

c:0001 p:0000 s:0002 b:0002 l:001588 d:001588 TOP

-- Ruby level backtrace information ----------------------------------------
/Users/thieso/.rvm/gems/ruby-1.9.2-rc2/bin/rake:19:in <main>' <internal:gem_prelude>:280:inmethod_missing'
internal:gem_prelude:158:in load_full_rubygems_library' <internal:gem_prelude>:158:inrequire'
/Users/thieso/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rubygems.rb:10:in <top (required)>' /Users/thieso/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rubygems.rb:10:inrequire'

-- C level backtrace information -------------------------------------------

[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

[1] 656 abort CPUPROFILE=/tmp/my_app_profile RUBYOPT="-rgem which perftools | tail -1" -

Activity

  1. tmm1 commented on Aug 18, 2010

    @tmm1
    Owner

    Does this happen if you use the PerfTools::CpuProfiler.start api from within ruby?

    Can you catch the segfault inside gdb and post the backtrace?

  2. thieso2 commented on Aug 19, 2010

    @thieso2
    Author

    found a fix - after a shour gdb session i found that ->me is sometimes nil, why I can't tell.

    shipping this "undefined" frame fixes it for me:

    patch:

    http://gist.github.com/537216

  3. tmm1 commented on Aug 19, 2010

    @tmm1
    Owner

    awesome, thanks for the patch. i just pushed a 0.4.8 gem

  4. thieso2 commented on Aug 19, 2010

    @thieso2
    Author

    any idea why some frame dont have an ->me ?

  5. tmm1 commented on Aug 19, 2010

    @tmm1
    Owner

    I looked briefly and could not see why. The vm_backtrace_each method in vm.c might provide more details.

    It's possible ->me is only set for CFUNC, and not METHOD? What is the value of VM_FRAME_TYPE(cfp) when cfp->me==0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions