From: "mame (Yusuke Endoh)" Date: 2012-04-17T21:00:36+09:00 Subject: [ruby-core:44411] [ruby-trunk - Bug #6246][Assigned] 1.9.3-p125 intermittent segfault Issue #6246 has been updated by mame (Yusuke Endoh). Status changed from Open to Assigned Assignee set to authorNari (Narihiro Nakamura) Hello, Perhaps I could reproduce this issue with small example: class Foo def Foo.shutdown(*args) p Bar.inspect.size end Bar = (0..300).map do |x| x = x.to_s ObjectSpace.define_finalizer(x, Foo.method(:shutdown)) x end end This code causes segfault in my system. The number (300) may vary depending on a system. This looks like a bug of GC finalizer. A finalizer invoked at process termination, seems to refer GC'ed object, which lead to segfault. I guess. In fact, the "logging" gem, which is included in OP's trace, seems to use define_finalizer as a substitute for at_exit. https://github.com/TwP/logging/blob/master/lib/logging.rb#L552 Nari, please check it. -- Yusuke Endoh ---------------------------------------- Bug #6246: 1.9.3-p125 intermittent segfault https://bugs.ruby-lang.org/issues/6246#change-25956 Author: jshow (Jodi Showers) Status: Assigned Priority: Normal Assignee: authorNari (Narihiro Nakamura) Category: Target version: ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] I've seen this behavior in 1.9.3p0 and 1.9.3p125 Intermittently, a rails 3.2 rake task will break while compiling assets - about 1 in 10 runs will segfault. Our code is 10K's of lines of proprietary code. I am working on a simplified version you can use. RAILS_ENV=new_staging bundle exec rake assets:precompile --trace command: https://gist.github.com/2254457 (stacktrace and gem list) backtrace : https://gist.github.com/2286260 Operating System : Debian Squeeze 6.0.4 Ruby installed through RVM 1.11.3 -- http://bugs.ruby-lang.org/