Forum: Ruby on Rails Ruby1.9.1 Bus Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rick (Guest)
on 2009-02-23 10:38
(Received via mailing list)
Here's my particulars:

Mac OS X 10.5.6
1.25 GHz PPC G4

/test 726 > script/about
/opt/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.0/lib/
action_controller/routing/segments.rb:6: warning: encoding option is
ignored - N
About your application's environment
Ruby version              1.9.1 (powerpc-darwin9.6.0)
RubyGems version          1.3.1
Rails version             2.3.0
Active Record version     2.3.0
Action Pack version       2.3.0
Active Resource version   2.3.0
Action Mailer version     2.3.0
Active Support version    2.3.0
Application root          /Users/rick/test
Environment               development
Database adapter          sqlite3
Database schema version   0

/test 727 > gem list thin

*** LOCAL GEMS ***

thin (1.0.0)

/test 728 > script/server thin
=> Booting Thin
=> Rails 2.3.0 application starting on http://0.0.0.0:3000
/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:31: [BUG] Bus Error
ruby 1.9.1 (2008-10-28 revision 19983) [powerpc-darwin9.6.0]

-- control frame ----------
c:0059 p:---- s:0221 b:0221 l:000220 d:000220 CFUNC  :initialize
c:0058 p:---- s:0219 b:0219 l:000218 d:000218 CFUNC  :new
c:0057 p:0063 s:0216 b:0216 l:000215 d:000215 CLASS  /opt/local/lib/
ruby/1.9.1/openssl/ssl.rb:31
c:0056 p:0011 s:0214 b:0214 l:000213 d:000213 CLASS  /opt/local/lib/
ruby/1.9.1/openssl/ssl.rb:23
c:0055 p:0011 s:0212 b:0212 l:000211 d:000211 CLASS  /opt/local/lib/
ruby/1.9.1/openssl/ssl.rb:22
c:0054 p:0045 s:0210 b:0210 l:000209 d:000209 TOP    /opt/local/lib/
ruby/1.9.1/openssl/ssl.rb:21
c:0053 p:---- s:0208 b:0208 l:000207 d:000207 FINISH :set_encoding
c:0052 p:---- s:0206 b:0206 l:000205 d:000205 CFUNC  :require
c:0051 p:0012 s:0202 b:0202 l:000191 d:000201 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0050 p:0055 s:0200 b:0200 l:000199 d:000199 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0049 p:0041 s:0192 b:0192 l:000191 d:000191 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0048 p:0059 s:0186 b:0186 l:000185 d:000185 TOP    /opt/local/lib/
ruby/1.9.1/openssl.rb:22
c:0047 p:---- s:0184 b:0184 l:000183 d:000183 FINISH :set_encoding
c:0046 p:---- s:0182 b:0182 l:000181 d:000181 CFUNC  :require
c:0045 p:0012 s:0178 b:0178 l:000167 d:000177 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0044 p:0055 s:0176 b:0176 l:000175 d:000175 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0043 p:0041 s:0168 b:0168 l:000167 d:000167 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0042 p:0023 s:0162 b:0162 l:000161 d:000161 TOP    /opt/local/lib/
ruby/1.9.1/net/https.rb:102
c:0041 p:---- s:0160 b:0160 l:000159 d:000159 FINISH :set_encoding
c:0040 p:---- s:0158 b:0158 l:000157 d:000157 CFUNC  :require
c:0039 p:0012 s:0154 b:0154 l:000143 d:000153 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0038 p:0055 s:0152 b:0152 l:000151 d:000151 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0037 p:0041 s:0144 b:0144 l:000143 d:000143 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0036 p:0011 s:0138 b:0138 l:000137 d:000137 TOP    /opt/local/lib/
ruby/gems/1.9.1/gems/activeresource-2.3.0/lib/active_resource/
connection.rb:1
c:0035 p:---- s:0136 b:0136 l:000135 d:000135 FINISH :set_encoding
c:0034 p:---- s:0134 b:0134 l:000133 d:000133 CFUNC  :require
c:0033 p:0012 s:0130 b:0130 l:000119 d:000129 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0032 p:0055 s:0128 b:0128 l:000127 d:000127 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0031 p:0041 s:0120 b:0120 l:000119 d:000119 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0030 p:0011 s:0114 b:0114 l:000113 d:000113 TOP    /opt/local/lib/
ruby/gems/1.9.1/gems/activeresource-2.3.0/lib/active_resource/base.rb:
1
c:0029 p:---- s:0112 b:0112 l:000111 d:000111 FINISH :set_encoding
c:0028 p:---- s:0110 b:0110 l:000109 d:000109 CFUNC  :require
c:0027 p:0012 s:0106 b:0106 l:000095 d:000105 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0026 p:0055 s:0104 b:0104 l:000103 d:000103 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0025 p:0041 s:0096 b:0096 l:000095 d:000095 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0024 p:0038 s:0090 b:0090 l:000089 d:000089 TOP    /opt/local/lib/
ruby/gems/1.9.1/gems/activeresource-2.3.0/lib/active_resource.rb:35
c:0023 p:---- s:0087 b:0087 l:000086 d:000086 FINISH :set_encoding
c:0022 p:---- s:0085 b:0085 l:000084 d:000084 CFUNC  :require
c:0021 p:0012 s:0081 b:0081 l:000070 d:000080 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0020 p:0055 s:0079 b:0079 l:000078 d:000078 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0019 p:0041 s:0071 b:0071 l:000070 d:000070 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0018 p:0018 s:0065 b:0065 l:000058 d:000064 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/rails-2.3.0/lib/initializer.rb:259
c:0017 p:---- s:0064 b:0064 l:000063 d:000063 FINISH :each
c:0016 p:---- s:0062 b:0062 l:000061 d:000061 CFUNC  :each
c:0015 p:0023 s:0059 b:0059 l:000058 d:000058 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/rails-2.3.0/lib/initializer.rb:259
c:0014 p:0074 s:0055 b:0055 l:000054 d:000054 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/rails-2.3.0/lib/initializer.rb:134
c:0013 p:0063 s:0052 b:0052 l:000051 d:000051 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/rails-2.3.0/lib/initializer.rb:113
c:0012 p:0072 s:0046 b:0046 l:000045 d:000045 TOP    /Users/rick/test/
config/environment.rb:9
c:0011 p:---- s:0044 b:0044 l:000043 d:000043 FINISH :set_encoding
c:0010 p:---- s:0042 b:0042 l:000041 d:000041 CFUNC  :require
c:0009 p:0012 s:0038 b:0038 l:000027 d:000037 BLOCK  /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0008 p:0055 s:0036 b:0036 l:000035 d:000035 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:521
c:0007 p:0041 s:0028 b:0028 l:000027 d:000027 METHOD /opt/local/lib/
ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/active_support/
dependencies.rb:156
c:0006 p:0615 s:0022 b:0022 l:000164 d:000164 TOP    /opt/local/lib/
ruby/gems/1.9.1/gems/rails-2.3.0/lib/commands/server.rb:82
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH :set_encoding
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require
c:0003 p:0039 s:0006 b:0006 l:000005 d:000005 TOP    script/server:3
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP    <dummy toplevel>:
30
---------------------------
DBG> : "/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:31:in `initialize'"
DBG> : "/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:31:in `new'"
DBG> : "/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:31:in
`<class:SSLContext>'"
DBG> : "/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:23:in `<module:SSL>'"
DBG> : "/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:22:in
`<module:OpenSSL>'"
DBG> : "/opt/local/lib/ruby/1.9.1/openssl/ssl.rb:21:in `<top (required)
>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/1.9.1/openssl.rb:22:in `<top (required)>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/1.9.1/net/https.rb:102:in `<top (required)
>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activeresource-2.3.0/lib/
active_resource/connection.rb:1:in `<top (required)>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activeresource-2.3.0/lib/
active_resource/base.rb:1:in `<top (required)>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activeresource-2.3.0/lib/
active_resource.rb:35:in `<top (required)>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.0/lib/
initializer.rb:259:in `block in require_frameworks'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.0/lib/
initializer.rb:259:in `each'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.0/lib/
initializer.rb:259:in `require_frameworks'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.0/lib/
initializer.rb:134:in `process'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.0/lib/
initializer.rb:113:in `run'"
DBG> : "/Users/rick/test/config/environment.rb:9:in `<top (required)
>'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `block in require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:521:in `new_constants_in'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.0/lib/
active_support/dependencies.rb:156:in `require'"
DBG> : "/opt/local/lib/ruby/gems/1.9.1/gems/rails-2.3.0/lib/commands/
server.rb:82:in `<top (required)>'"
DBG> : "script/server:3:in `require'"
DBG> : "script/server:3:in `<main>'"
-- backtrace of native function call (Use addr2line) --
0x103660
0x298b4
0x29944
0xb0040
0x949b999c
-------------------------------------------------------
Abort


any thoughts?
Rick (Guest)
on 2009-02-23 21:38
(Received via mailing list)
I have also posted this message to the Thin talk group as it's not
clear to me whether this is a ruby or a thin problem.

I have both installed thin via gem install and downloaded and built/
installed from source.  I have run thin via "script/server thin" as
indicated here and via "thin start".  In all cases I get the same
result.
Rick (Guest)
on 2009-02-23 22:51
(Received via mailing list)
More info:

In rails (2.3.0) generated test app

1) Ran script/server and default WEBrick started and functioned fine
at least through the rails provided index.html.
2) Halted script/server
3) Ran script/server thin and produced the reported bus error
4) Ran script/server and default WEBrick now produces the reported bus
error.

This is looking less like a Thin problem...
Sarah Mei (Guest)
on 2009-02-23 23:18
(Received via mailing list)
http://redmine.ruby-lang.org/issues/show/1080
http://redmine.ruby-lang.org/issues/show/1142

Ruby 1.8.7 is more stable.

On Mon, Feb 23, 2009 at 12:50 PM, Rick <removed_email_address@domain.invalid>
wrote:
> error.
>> result.
>> > action_controller/routing/segments.rb:6: warning: encoding option is
>> > Application root          /Users/rick/test
>> > /test 728 > script/server thin
>> > => Booting Thin
>> > => Rails 2.3.0 application starting onhttp://0.0.0.0:3000
>> > /opt/local/lib/ruby/1.9.1/openssl/ssl.rb:31: [BUG] Bus Error
>> > ruby 1.9.1 (2008-10-28 revision 19983) [powerpc-darwin9.6.0]
[...]
Rick (Guest)
on 2009-02-23 23:44
(Received via mailing list)
I know it's more stable, 1.8.6 is also more stable and faster than
1.8.7 to boot.  I'm interested in moving forward under the (usually
valid) assumption that 1.9 - when it gets there - will include system
improvements that make the possible pain worth bearing.  This isn't a
course I'ld follow if I was working on a fielded application.

So here's the latest, and probably the last for now, word on what I've
found.

I was able to clear the bus error problem for WEBrick by uninstalling
the thin (1.0.1), daemons (1.0.10), and eventmachine (0.12.4) gems
that came along with thin.

Pure speculation here...

My guess is that a new datapath between the (whichever) web server and
the RoR app was established by thin's use of daemons and
eventmachine.  This path (together with the bus error) was then reused
by WEBrick.  My guess is that rebooting my computer would enable
WEBrick to function once again - at least until the next instance of
Thin.

I would like to follow this thread further - identifying and
potentially assisting with the problem solution - but I'm unclear how
to proceed.
Conrad T. (Guest)
on 2009-02-24 04:18
(Received via mailing list)
On Mon, Feb 23, 2009 at 12:37 AM, Rick <removed_email_address@domain.invalid>
wrote:

> About your application's environment
> Database adapter          sqlite3
> => Rails 2.3.0 application starting on http://0.0.0.0:3000
> /opt/local/lib/ruby/1.9.1/openssl/ssl.rb:31: [BUG] Bus Error
> ruby 1.9.1 (2008-10-28 revision 19983) [powerpc-darwin9.6.0]


[snip]

Hi Rick, here's the steps that I took without modifying any gem:

http://www.ruby-forum.com/topic/178659

Please note that some steps maybe optional.

Good luck,

-Conrad
Rick (Guest)
on 2009-02-26 05:48
(Received via mailing list)
Hey Conrad, thanks for that...

I've found two separate bug reports against Ruby 1.9.[01] that have
the same bus error triggered by different actions.  So, I it's not a
thin (exclusive) problem.

There are 2 things I'm wondering now:

1) what causes the bus error once triggered by thin to propogate into
WEBrick and hang there until the thin, daemon, and eventmachine gems
are uninstalled?  Related to this is - does your system have daemons
and eventmachine gems installed?  If so, did they come along with the
thin install?

2) what are the steps that were used to build the thin that's
distributed via macports?

thanks again,
Rick
Conrad T. (Guest)
on 2009-02-26 09:54
(Received via mailing list)
On Wed, Feb 25, 2009 at 7:48 PM, Rick <removed_email_address@domain.invalid> 
wrote:

> WEBrick and hang there until the thin, daemon, and eventmachine gems
> are uninstalled?  Related to this is - does your system have daemons
> and eventmachine gems installed?  If so, did they come along with the
> thin install?
>

Hey Rick, they were installed automatically because they were thin
dependencies.
For example, the dependencies for 'thin' can be found by doing the
following:

gem dependency thin  # if it's installed locally.

or

gem dependency thin -r # if it's not installed locally.


> 2) what are the steps that were used to build the thin that's
> distributed via macports?
>

I installed thin by using the following:

sudo gem install thin

Good luck,

-Conrad
Rick (Guest)
on 2009-02-28 06:58
(Received via mailing list)
So, here's how this turned out.  It seems that I had two versions of
openssl installed on my system - one old one (from fink?
macports? ...) in /usr/[bin include lib] and the other newly built
from source in /opt/local/[bin include lib].

I was building all systems from source with config --prefix=/opt/local
but, when it came to gem install thin the older version of openssl was
linked in from /usr/lib.  This led to the conflict between thin and
ruby that generated the bus error.

I really wanted to figure this out because I'm guessing that ruby
1.9.1p1 might be fairly quickly supplanted by p[2-?] and I'ld rather
not wait on someone else tracking the changes and building a new
executible.

Besides, I'm enough of a motorhead that I like to look inside and see
all the whirry bits...

So, to all who fed me information, thanks again for your help,
Rick
This topic is locked and can not be replied to.