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

Mason Hale masonhale at gmail.com
Mon Jan 29 17:03:01 EST 2007


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070129/faa76476/attachment.html 


More information about the Backgroundrb-devel mailing list