Bug #4651
closedBus Error using continuation on x86_64-darwin11.0.0 (Lion)
Added by sferik (Erik Michaels-Ober) over 13 years ago. Updated over 12 years ago.
Description
=begin
The following code crashes with a Bus Error on Ruby 1.9.2-p136 and 1.9.2-p180 built for x86_64-darwin11.0.0 (Lion). The same code works on both of those versions of Ruby built for x86_64-darwin10.0.0 (Snow Leopard).
(({require 'continuation'}))
(({cc = callcc {|cc| cc }; cc.call if cc}))
This actual code appears in the yard gem on ((<line 38 of yard.rb|URL:https://github.com/lsegal/yard/blob/master/lib/yard.rb#L38>)).
I've attached the crash log. Please let me know if you need any other information from me to help debug this issue. Thank you very much. Ruby makes me happy.
=end
Files
ruby_2011-05-06-223300_leon.crash (9.71 KB) ruby_2011-05-06-223300_leon.crash | sferik (Erik Michaels-Ober), 05/07/2011 02:38 PM | ||
config.log (589 KB) config.log | levinalex (Levin Alexander), 06/12/2011 11:40 PM | ||
config.log.xcode4.0.2.txt (586 KB) config.log.xcode4.0.2.txt | compiled with XCode 4.0.2 on Snow Leopard | levinalex (Levin Alexander), 06/13/2011 01:25 AM | |
CrashReports_ruby_2011-06-13-173007_rhea.zip (15.1 KB) CrashReports_ruby_2011-06-13-173007_rhea.zip | crash reports generated by running make test | levinalex (Levin Alexander), 06/14/2011 12:37 AM | |
ruby_make_test_output.txt (20.1 KB) ruby_make_test_output.txt | test output from running `make test` after compiling with XCode 4.2 | levinalex (Levin Alexander), 06/14/2011 12:37 AM |
Updated by nobu (Nobuyoshi Nakada) over 13 years ago
- Status changed from Open to Feedback
=begin
Does it reproduce
- with just those 2 lines?
- with `configure optflags=-O0 debugflags=-ggdb3'?
- with trunk?
=end
Updated by sferik (Erik Michaels-Ober) over 13 years ago
=begin
- Yes,
- yes,
- and yes.
=end
Updated by nobu (Nobuyoshi Nakada) over 13 years ago
- Project changed from Backport192 to Ruby master
- Status changed from Feedback to Open
- Priority changed from 5 to Normal
Updated by nobu (Nobuyoshi Nakada) over 13 years ago
OK, then could you show the crash log from the short code on the trunk compiled with '-O0 -ggdb3'?
And,
- does a binary compiled on Snow Leopard crash on Lion?
- does a binary compiled on Lion crash on Snow Leopard?
Updated by nobu (Nobuyoshi Nakada) over 13 years ago
- Tracker changed from Backport to Bug
Updated by sferik (Erik Michaels-Ober) over 13 years ago
I just tried reproducing on trunk with '-O0 -ggdb3' but I could not reproduce the error.
I'm not sure if a binary compiled on Snow Leopard crashes on Lion or vice versa. I think the binary I had previously compiled for Snow Leopard was working until I recompiled it for Lion.
Updated by sferik (Erik Michaels-Ober) over 13 years ago
Just to be clear, this is still an issue on Ruby 1.9.2-head but it's fixed in trunk (1.9.3). Maybe I'm using the wrong terminology for branches? Sorry about that. Just wanted to clarify.
Updated by levinalex (Levin Alexander) over 13 years ago
- File config.log config.log added
I just ran into this on Snow Leopard after reinstalling rvm [1]. I am using Xcode 4.2 (4C104)
config.log is attached.
$ cat cc.rb
require 'continuation'
x = callcc { |b| b }
x.call
$ which ruby
/Users/levin/.rvm/rubies/ruby-1.9.2-head/bin/ruby
$ ruby cc.rb
cc.rb:2: [BUG] Bus Error
ruby 1.9.2p274 (2011-06-06 revision 31932) [x86_64-darwin10.7.0]
-- control frame ----------
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :callcc
c:0003 p:0021 s:0007 b:0007 l:0014e8 d:001720 EVAL cc.rb:2
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0014e8 d:0014e8 TOP
-- Ruby level backtrace information ----------------------------------------
cc.rb:2:in <main>' cc.rb:2:in
callcc'
-- C level backtrace information -------------------------------------------
0 libruby.1.9.1.dylib 0x00000001001404fe rb_vm_bugreport + 110
1 libruby.1.9.1.dylib 0x0000000100034513 report_bug + 259
2 libruby.1.9.1.dylib 0x0000000100034681 rb_bug + 161
3 libruby.1.9.1.dylib 0x00000001000d6f72 sigbus + 18
4 libSystem.B.dylib 0x00007fff80fa466a _sigtramp + 26
5 ??? 0x000000010027c000 0x0 + 4297572352
[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
Abort trap
[1] rvm 1.6.20, installed after deleting ~/.rvm directory
Updated by levinalex (Levin Alexander) over 13 years ago
I downgraded to XCode 4.0.2 (4A2002a) and recompiled ruby with rvm. This makes the problem go away. (both for 1.9.2p180 and p274)
$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
$ ruby cc.rb
cc.rb:3:in <main>': undefined method
call' for nil:NilClass (NoMethodError)
no crash :)¶
attached is the config.log from this compilation for comparison.
Updated by levinalex (Levin Alexander) over 13 years ago
diffing both config.log files:
the segfaulting ruby (XCode 4.2) is compiled with:
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
i686-apple-darwin10-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
the working ruby (XCode 4.0) is compiled with:
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Updated by sorah (Sorah Fukumori) over 13 years ago
- Status changed from Open to Feedback
- Priority changed from Normal to 3
- ruby -v set to -
Hi,
thank you for your testing.
Could you test without rvm (compile with your hands!)?
Also, if you can, could you test at the ruby svn trunk?
and Lion is not released, so we can't support well.
please understand that.
thanks.
Updated by sorah (Sorah Fukumori) over 13 years ago
oops sorry, i missed looking old replies...
Updated by levinalex (Levin Alexander) over 13 years ago
- File CrashReports_ruby_2011-06-13-173007_rhea.zip CrashReports_ruby_2011-06-13-173007_rhea.zip added
- File ruby_make_test_output.txt ruby_make_test_output.txt added
Can reproduce with ruby built from source without rvm.
(this does not seem to be caused by using continuations, this seems to be a more general problem when building with XCode 4.2.0)
Okay, I reinstalled XCode 4.2 and did the following:
$ git clone git://github.com/ruby/ruby.git
this is trunk, revision 57ed1e9d75360713c3d5d75c4cbb05ea48c8b025¶
$ cd ruby
$ autoconf && ./configure && make
$ ./ruby -v
ruby 1.9.3dev (2011-06-13 trunk 32068) [x86_64-darwin10.7.0]
$ make test
make test
has multiple failures. (output and crash reports are attached)
Is there anything I can do to help chase this?
Updated by levinalex (Levin Alexander) over 13 years ago
this seems to be fixed in trunk by https://github.com/ruby/ruby/commit/be953b4d1ce3f0dfc7f24c84ec7a51e027102557
(tested with the latest XCode Beta, Version 4.2 (4C114))
the commit applies cleanly on ruby_1_9_2 and also fixes make test
there. any chance that it will be backported before OS X Lion is released?
Updated by naruse (Yui NARUSE) over 13 years ago
- Status changed from Feedback to Closed
Updated by mbleigh (Michael Bleigh) over 13 years ago
I'm sorry, but I'm not sure what the resolution of this is for it to be closed. I've just run into the same error with 1.9.2-head (works in 1.9.3-head) on RVM. Is this a fix that is going to be applied to the 1.9.2 branch or is it going to remain unpatched until 1.9.3?
Updated by sikachu (Prem Sichanugrist) over 13 years ago
@Micheal Bleigh
There's a ticket #4945 which in the backport92 project. I think they'll backport that soon.
Updated by naruse (Yui NARUSE) over 12 years ago
mbleigh (Michael Bleigh) wrote:
I'm sorry, but I'm not sure what the resolution of this is for it to be closed. I've just run into the same error with 1.9.2-head (works in 1.9.3-head) on RVM. Is this a fix that is going to be applied to the 1.9.2 branch or is it going to remain unpatched until 1.9.3?
The main thread of this problem is #5082 and it is fixed in Ruby 1.9.3-p125.
Yugui, the maintainer of 1.9.2 release branch, may handle the backport, but I don't know the status.
I think you should update to 1.9.3.