Bug #4651

Bus Error using continuation on x86_64-darwin11.0.0 (Lion)

Added by Erik Michaels-Ober almost 3 years ago. Updated about 2 years ago.

[ruby-core:36034]
Status:Closed
Priority:Low
Assignee:-
Category:-
Target version:-
ruby -v:- Backport:

Description

=begin
The following code crashes with a Bus Error on Ruby 1.9.2-p136 and 1.9.2-p180 built for x8664-darwin11.0.0 (Lion). The same code works on both of those versions of Ruby built for x8664-darwin10.0.0 (Snow Leopard).

(({require 'continuation'}))

(({cc = callcc {|cc| cc }; cc.call if cc}))

This actual code appears in the yard gem on (()).

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

ruby_2011-05-06-223300_leon.crash (9.71 KB) Erik Michaels-Ober, 05/07/2011 02:38 PM

config.log (589 KB) Levin Alexander, 06/12/2011 11:40 PM

config.log.xcode4.0.2.txt Magnifier - compiled with XCode 4.0.2 on Snow Leopard (586 KB) Levin Alexander, 06/13/2011 01:25 AM

CrashReports_ruby_2011-06-13-173007_rhea.zip - crash reports generated by running make test (15.1 KB) Levin Alexander, 06/14/2011 12:37 AM

ruby_make_test_output.txt Magnifier - test output from running `make test` after compiling with XCode 4.2 (20.1 KB) Levin Alexander, 06/14/2011 12:37 AM


Related issues

Related to ruby-trunk - Bug #5082: test_context_switch(TestMarshal) was failed on OS X 10.7 ... Closed 07/23/2011
Related to ruby-trunk - Bug #5181: yard causes Ruby 1.9.2 crash on Mac OS X Lion (64-bit) Closed 08/10/2011
Related to ruby-trunk - Bug #5224: Yard seems to be crashing ruby. Closed 08/25/2011
Related to ruby-trunk - Bug #5263: Ruby crash when installing yard-0.7.2 installation Closed 09/02/2011
Related to ruby-trunk - Bug #5931: Random SEGV during execution on YARD specs Assigned 01/26/2012
Related to ruby-trunk - Bug #5973: Bus Error in simple project requiring YARD Closed 02/06/2012
Related to ruby-trunk - Bug #6387: 1.9.3p194 crashed on require in ubuntu Closed 05/02/2012

History

#1 Updated by Nobuyoshi Nakada almost 3 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

#2 Updated by Erik Michaels-Ober almost 3 years ago

=begin
* Yes,
* yes,
* and yes.
=end

#3 Updated by Nobuyoshi Nakada almost 3 years ago

  • Project changed from Backport92 to ruby-trunk
  • Status changed from Feedback to Open
  • Priority changed from High to Normal

#4 Updated by Nobuyoshi Nakada almost 3 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?

#5 Updated by Nobuyoshi Nakada almost 3 years ago

  • Tracker changed from Backport to Bug

#6 Updated by Erik Michaels-Ober almost 3 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.

#7 Updated by Erik Michaels-Ober almost 3 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.

#8 Updated by Levin Alexander almost 3 years ago

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 rbvmbugreport + 110
1 libruby.1.9.1.dylib 0x0000000100034513 reportbug + 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

#9 Updated by Levin Alexander almost 3 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 methodcall' for nil:NilClass (NoMethodError)

no crash :)

attached is the config.log from this compilation for comparison.

#10 Updated by Levin Alexander almost 3 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)

#11 Updated by Shota Fukumori almost 3 years ago

  • Status changed from Open to Feedback
  • Priority changed from Normal to Low
  • 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.

#12 Updated by Shota Fukumori almost 3 years ago

oops sorry, i missed looking old replies...

#13 Updated by Levin Alexander almost 3 years ago

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?

#14 Updated by Levin Alexander almost 3 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 ruby19_2 and also fixes make test there. any chance that it will be backported before OS X Lion is released?

#15 Updated by Yui NARUSE almost 3 years ago

  • Status changed from Feedback to Closed

#16 Updated by Michael Bleigh over 2 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?

#17 Updated by Prem Sichanugrist over 2 years ago

@Micheal Bleigh

There's a ticket #4945 which in the backport92 project. I think they'll backport that soon.

#18 Updated by Yui NARUSE about 2 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.

Also available in: Atom PDF