[Backgroundrb-devel] loading C extension in worker causes bus error on OS X only

Patrick Crosby patrick at xblabs.com
Mon Jan 29 17:14:14 EST 2007


I read the thread about specifying -r args on the irb command line
causing bus errors on os x (for reference, this is the main one:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/142806 ),
but why would that affect the backgroundrb server?  The server starts
up fine, but once it hits code that causes the require of the C
extension, it gets the bus error.

I get the same problem using rails' script/console when I call
something that requires this extension.

(but again, all works fine in a rails app, or on linux).

Thanks.

patrick

On 1/29/07, Mason Hale <masonhale at gmail.com> wrote:
> I ran into this issue before:
> http://rubyforge.org/pipermail/backgroundrb-devel/2006-December/000594.html
>
> This is apparently a bug in the way external libraries are loaded on Mac OS
> X, in Ruby and other scripting languages. It has to do with the contents of
> the argv array changing between the launch of the scripting environment and
> the loading of the external module. It does not appear to be specific to
> BackgroundRb or even Ruby. A search for "mac os x bus error" in google will
> find reports of similar issues cropping up in the Perl and Python
> communities too.
>
> I'm working around the issue by using the pure-ruby Postgres driver on Mac
> OS. If you find a better solution, I'd very much appreciate a follow-up
> message with a better workaround. It's useful to note that a similar issue
> was reported in Rails when using script/console, but a work around was found
> for that case.
>
> best regards,
> Mason
>
>
>
>
>
> On 1/29/07, Patrick Crosby <patrick at xblabs.com> wrote:
> >
> > In all likelihood, this doesn't have anything to do with backgroundrb,
> > but I'm stuck so I thought someone might be able to help.
> >
> > I have a pretty simple C extension that I built into a gem and have
> > installed on my system.  It works fine when required from rails
> > (1.2.1).
> >
> > But when I have a Backgroundrb worker class use the extension (under
> > os x), I get:
> >
> >
> /usr/local/lib/ruby/gems/1.8/gems/opalfx-0.1.1582/lib/ofx_helper.bundle:
> > [BUG] Bus Error
> > ruby 1.8.4 (2005-12-24) [ i686-darwin8.8.1]
> >
> > (That's the right version of ruby).
> >
> > I've tried all kinds of stuff.  I installed a trace function, but it's
> > crashing on the require statement.
> >
> > Trying to isolate the problem, even using irb, it gets a bus error (so
> > definitely not backgroundrb's fault).  I tried it on a linux server
> > (through irb) and it worked fine.
> >
> > Anyone have any ideas?
> >
> > Thanks.
> >
> > patrick
> > _______________________________________________
> > Backgroundrb-devel mailing list
> > Backgroundrb-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
> >
>
>


-- 
http://www.xblabs.com


More information about the Backgroundrb-devel mailing list