Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

REE compatibility #7

Closed
ryanking opened this Issue Jan 15, 2010 · 7 comments

Comments

Projects
None yet
2 participants

Seems to be broken with REE. I get:

src/tcmalloc.cc:353] Attempt to free invalid pointer: 0x209a90
Abort trap

I can send reproduction code privately.

Note that this is on mac os x:

$ uname -a

Darwin rk.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

$ ruby -v

ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI 0x8770, Ruby Enterprise Edition 2009.10

Owner

tmm1 commented Jan 15, 2010

Interesting. Please send me steps to reproduce. Generally, these errors occur when you pull in tcmalloc into ruby, but REE uses tcmalloc_minimal which should not throw exceptions on malloc/free.

I was able to reproduce this simply:

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI 0x8770, Ruby Enterprise Edition 2009.10
$ ruby -rrubygems pt_bug.rb 
src/tcmalloc.cc:353] Attempt to free invalid pointer: 0x200e50
Abort trap
$ cat pt_bug.rb 
require 'perftools'
PerfTools::CpuProfiler.start("cpu_performance") do
  1000.times {|i|
  }
end
$ gem list perftools

\*\*\* LOCAL GEMS \*\*\*

perftools.rb (0.4.0)
Owner

tmm1 commented Jan 20, 2010

Hmm. How about otool -L which ruby? How did you install ruby.. usually REE installs with 0x6770.

$ which ruby
/usr/local/bin/ruby

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0], MBARI 0x6770, Ruby Enterprise Edition 2009.10

$ otool -L `which ruby`
/usr/local/bin/ruby:
@rpath/libsystem_allocator.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)

$ ruby -rubygems /tmp/pt_bug.rb 
PROFILE: interrupts/evictions/bytes = 0/0/64

$ cat /tmp/pt_bug.rb 
require 'perftools'
PerfTools::CpuProfiler.start("cpu_performance") do
1000.times {|i|
}
end

$ gem which perftools
(checking gem perftools.rb-0.4.0 for perftools)
/usr/local/Cellar/ruby-enterprise-edition/2009.10/lib/ruby/gems/1.8/gems/perftools.rb-0.4.0/lib/perftools.bundle

$ gem list perftools
*** LOCAL GEMS ***
perftools.rb (0.4.0)
Owner

tmm1 commented Jan 20, 2010

Interesting. If you install REE with ./installer --no-tcmalloc it will fix the issue. Looks like homebrew does this as well. I know on linux, even with tcmalloc, perftools is fine. Must be some sort of OSX issue.

Ok, thanks. I wish we could get it to work on os x with tcmalloc, but this will be fine for now.

Owner

tmm1 commented Jan 24, 2011

rvm no longer builds REE on OSX with tcmalloc due to known issues, so if you just use rvm this should be fine.

tmm1 added a commit that referenced this issue Aug 21, 2012

prevent explosions when stopping while paused
Breakpoint 1, CpuProfiler::DisableHandler (this=0x7fa1ce890ce0) at src/profiler.cc:271
271   RAW_CHECK(prof_handler_token_ != NULL, "SIGPROF handler is not registered");
Current language:  auto; currently c++

Program received signal SIGABRT, Aborted.
0x00007fa1d7df9ed5 in raise () from /lib/libc.so.6
(gdb) where
 #0  0x00007fa1d7df9ed5 in raise () from /lib/libc.so.6
 #1  0x00007fa1d7dfb3f3 in abort () from /lib/libc.so.6
 #2  0x00007fa1ce685634 in CpuProfiler::DisableHandler (this=0x7fa1ce890ce0) at src/profiler.cc:271
 #3  0x00007fa1ce6859b0 in CpuProfiler::Stop (this=0x7fa1ce890ce0) at src/profiler.cc:209
 #4  0x00007fa1ce685a2a in ~CpuProfiler (this=0x7fa1ce890ce0) at src/profiler.cc:196
 #5  0x00007fa1d7dfc9cd in exit () from /lib/libc.so.6
 #6  0x0000000000425310 in ruby_stop (ex=<value optimized out>) at eval.c:1689
 #7  0x000000000042dcd1 in ruby_run () at eval.c:1710
 #8  0x0000000000412063 in main (argc=9, argv=0x7fff08f9b6e8, envp=<value optimized out>) at main.c:48

This issue was closed.

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