I'm a Mac newbie, so I'm struggling a bit here, but there's a definite
problem loading shared extensions under Mac OSX 10.2.2.

If I run the following

  ruby -rsocket -e1

it blows up doing the rb_define_class in Init_socket(). The problem is
that sym_tbl (in parse.y) is apparently 0x0000000. However, tracing
the value in sym_tbl just before the call to Init_socket shows it to
be perfectly valid.

It seems that code in the dynamically loaded object (socket.bundle in
this case) is picking up a different set up global statics, so that
calls from within the shared object are failing.

I know next to nothing about Darwin, but I read that the handling of
shared objects changed between 10.0 and 10.2, with 10.2 supporting two
levels of namespace. I'm wondering if this has anything to do with the
change.

As corroboration, if I link socket.c in to the interpreter statically,
the problem goes away (although I do get warnings about duplicate
symbols when it runs).

I'm happy to do experiments for folks, and I'm continuing some
background research, but if anyone actually knows the Mac it would
probably go a lot quicker if they could have a look at this :)


Cheers


Dave