Problem loading extensions in OSX 10.2.2 
Author Message
 Problem loading extensions in OSX 10.2.2

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



Mon, 30 May 2005 08:31:39 GMT  
 Problem loading extensions in OSX 10.2.2
Hi,

At Thu, 12 Dec 2002 09:31:39 +0900,

Quote:

> 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.

How did you configure ruby, and what CFLAGS?

--
Nobu Nakada



Mon, 30 May 2005 10:45:24 GMT  
 Problem loading extensions in OSX 10.2.2
At Thu, 12 Dec 2002 09:31:39 +0900,

Quote:

> 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.

Which version of Ruby have the problem? In Ruby 1.6.7 installed
with Mac OSX 10.2.2 at least, the problem couldn't be got.

     $ ruby -rsocket -e1
     $ ruby --version
     ruby 1.6.7 (2002-03-01) [powerpc-darwin6.0]
     $ ruby -r rbconfig -e 'p Config::CONFIG["configure_args"]'
     "--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info"

I have not tried other version which isn't installed on my mac yet.

regards,
--
FUJIMOTO Hisakuni



Mon, 30 May 2005 10:47:22 GMT  
 Problem loading extensions in OSX 10.2.2

Quote:

> 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.

> 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 :)

If your questions can be generalized, there are some smart folks at

--
Jim Freeze
----------
Never commit yourself!  Let someone else commit you.



Mon, 30 May 2005 11:01:44 GMT  
 Problem loading extensions in OSX 10.2.2

Quote:

> Hi,

> At Thu, 12 Dec 2002 09:31:39 +0900,

> > 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.

> How did you configure ruby, and what CFLAGS?

I just did

  autoconf
  ./configure
  make
  make install

with the 1.7.3 CVS source



Mon, 30 May 2005 12:36:48 GMT  
 Problem loading extensions in OSX 10.2.2

Quote:

> At Thu, 12 Dec 2002 09:31:39 +0900,

> > 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.

> Which version of Ruby have the problem? In Ruby 1.6.7 installed
> with Mac OSX 10.2.2 at least, the problem couldn't be got.

Agreed, my 1..7 worked too, but... there were problems with the
networking code. For example, by trivial HTTP timeserver application
worked fine if I telneted in to it, if I invoked it from another Ruby
script, but it locked up when invoked from Explorer. I suspected an IPV6
bug, which is why I embarked on the attempt to upgrade to 1.7.

Cheers

Dave



Mon, 30 May 2005 12:38:45 GMT  
 Problem loading extensions in OSX 10.2.2

Quote:
>If your questions can be generalized, there are some smart folks at

>--
>Jim Freeze
>----------
>Never commit yourself!  Let someone else commit you.

Oh man, I've been working there for a month - I forgot all about
them!  They are definitely some smart folks.  Hey, I should bring some of
my questions to them ...

Incidentally, I can try duplicating the problem myself.  All I know is that
Ruby 1.6.7 and CVS both made it through `./configure && make && make test`
with no complaints.  I found something about passing '--enable-shared' to
./configure, but didn't apply it myself.

Still can't get Ruby to notice the fact that I have Tcl/Tk on the machine,
but that's a different problem :-)

-Brian W

Brian Wisti

http://coolnamehere.com/



Mon, 30 May 2005 13:45:04 GMT  
 Problem loading extensions in OSX 10.2.2
Hi,

At Thu, 12 Dec 2002 13:36:48 +0900,

Quote:

> I just did

>   autoconf
>   ./configure
>   make
>   make install

> with the 1.7.3 CVS source

Without --enable-shared?  Do you have ruby shared library, and
what's defined as LIBS in ext/socket/Makefile?

If LIBS has $(LIBRUBYARG_STATIC), try this patch.  At first
remove makefiles and shared objects under ext/, and recompile
them.

Index: lib/mkmf.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/mkmf.rb,v
retrieving revision 1.118
diff -u -2 -p -r1.118 mkmf.rb
--- lib/mkmf.rb 28 Nov 2002 03:12:23 -0000      1.118

 def init_mkmf(config = CONFIG)
+  $enable_shared = config['ENABLE_SHARED'] == 'yes'
   $defs = []

   $OBJEXT = config["OBJEXT"].dup
   $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
-  $LIBRUBYARG = config['LIBRUBYARG']
+  $LIBRUBYARG = $enable_shared ? config['LIBRUBYARG'] : ""
   $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']

   $objs = nil
   $libs = ""
-  if config['ENABLE_SHARED'] == 'yes' or config["LIBRUBY"] != config["LIBRUBY_A"]
+  if $enable_shared or config["LIBRUBY"] != config["LIBRUBY_A"]
     $LIBPATH = ["$(topdir)"]
     $LIBPATH.unshift("$(libdir)") unless $extmk or defined? CROSS_COMPILING

--
Nobu Nakada



Mon, 30 May 2005 14:31:10 GMT  
 Problem loading extensions in OSX 10.2.2

Quote:


> Incidentally, I can try duplicating the problem myself.  All I know is that
> Ruby 1.6.7 and CVS both made it through `./configure && make && make test`
> with no complaints.  I found something about passing '--enable-shared' to
> ./configure, but didn't apply it myself.

Yes, that was what I was trying to remember. I needed --enable-shared.

Quote:

> Still can't get Ruby to notice the fact that I have Tcl/Tk on the machine,
> but that's a different problem :-)

Me too, but on Solaris.

--
Jim Freeze
----------
        "What do you give a man who has everything?" the pretty
{*filter*}ager asked her mother.
        "Encouragement, dear," she replied.



Mon, 30 May 2005 21:22:54 GMT  
 Problem loading extensions in OSX 10.2.2


Quote:

>> Still can't get Ruby to notice the fact that I have Tcl/Tk on the machine,
>> but that's a different problem :-)

J> Me too, but on Solaris.

 When you run extconf.rb you can give the options

   --with-tcl-dir, --with-tcl-include, --with-tcl-lib
   --with-tk-dir, --with-tk-include, --with-tk-lib
   --with-X11-dir, --with-X11-include, --with-X11-lib

 to specify specific directories

Guy Decoux



Mon, 30 May 2005 21:38:21 GMT  
 Problem loading extensions in OSX 10.2.2

t>  When you run extconf.rb you can give the options
                 ^^^^^^^^^^
                 configure

 sorry,

t>    --with-tcl-dir, --with-tcl-include, --with-tcl-lib
t>    --with-tk-dir, --with-tk-include, --with-tk-lib
t>    --with-X11-dir, --with-X11-include, --with-X11-lib

t>  to specify specific directories

Guy Decoux



Mon, 30 May 2005 21:41:22 GMT  
 Problem loading extensions in OSX 10.2.2

Quote:

> Without --enable-shared?  Do you have ruby shared library, and
> what's defined as LIBS in ext/socket/Makefile?

Yes - thank you! --enable-shared fixed it.

I wonder if this should be the default under Darwin (as it doesn't work
out of the box without it)?

Cheers

Dave



Mon, 30 May 2005 22:38:53 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Intel 10 for MAC OSX ?

2. RubyCocoa problem: No such file to load -- osx/objc/cocoa

3. scheme48 dynamic-load and Mac OS X 10.2.2 (Jaguar)

4. Dynamic loading on HP-UX 10 (yet again)

5. Notes from ANSI extensions meeting 10

6. Notes from ANSI extensions meeting 10

7. problems with Linking and loading extensions to Python

8. problem loading shared extension lib

9. Problems with static data in C++ and dynamic loading of Tcl extensions

10. problem loading NT extension

11. loading extension problem

12. load (dynamic extension) problem

 

 
Powered by phpBB® Forum Software