MagLev / maglev

GemStone Maglev Ruby Repository
http://maglev.github.io
518 stars 41 forks source link

OpenSSL - Symbol not found _rb_cArray #406

Closed johnnyt closed 9 years ago

johnnyt commented 9 years ago

Hey @AllenOtis or @timfel - I'm getting this error now when trying to load openssl:

-- RubyFile>>load  : loading $MAGLEV_HOME/lib/ruby/1.9/openssl.rb
ERROR 2702 , a RubyLoadError occurred (error 2702),
dlopen(...maglev/ruby/1.9/openssl/ext/openssl.bundle, 265): Symbol not found: _rb_cArray
  Referenced from: ...maglev/lib/ruby/1.9/openssl/ext/openssl.bundle
  Expected in: flat namespace
 in ...maglev/lib/ruby/1.9/openssl/ext/openssl.bundle (LoadError)
topaz 1> exit

any thoughts?

AllenOtis commented 9 years ago

Is this Darwin or Linux ? Does it work on Linux ? Did work using the 3.1.0.2.1 server ?

The basic tool for diagnosing symbol referencing errors like this is to use nm on both libraries involved, such as

nm -A .so .bundle | grep rb_cArray

rb_cArray should be exported by the libgcilnk . In the C sources it is

ruby.h:RUBY_DLLSPEC extern VALUE rb_cArray; rubycext.c:VALUE rb_cArray;

On Linux it is exported as a type "B" symbol .

libgcilnk-3.1.0.2.2-64.so:00000000006c4278 B rb_cArray

nm should show it in the ruby ssl library as an unresolved data reference. all of this rb_ stuff could be moved to libmagparse eventually .

On Thu, Jul 9, 2015 at 7:39 PM, JohnnyT notifications@github.com wrote:

Hey @AllenOtis https://github.com/AllenOtis or @timfel https://github.com/timfel - I'm getting this error now when trying to load openssl:

-- RubyFile>>load : loading $MAGLEV_HOME/lib/ruby/1.9/openssl.rb ERROR 2702 , a RubyLoadError occurred (error 2702), dlopen(...maglev/ruby/1.9/openssl/ext/openssl.bundle, 265): Symbol not found: _rb_cArray Referenced from: ...maglev/lib/ruby/1.9/openssl/ext/openssl.bundle Expected in: flat namespace in ...maglev/lib/ruby/1.9/openssl/ext/openssl.bundle (LoadError) topaz 1> exit

any thoughts?

— Reply to this email directly or view it on GitHub https://github.com/MagLev/maglev/issues/406.

johnnyt commented 9 years ago

Awesome - I'll try those tips.

The error is on Darwin - I'll try it out tomorrow at work on Linux.

AllenOtis commented 9 years ago

I see .c files in lib/ruby/1.9/openssl/ext in the maglev checkout, What do I need to do to get the .o and shared libraries produced ? i.e. ruby command line(s) to get to the point of the error you see ?

On Thu, Jul 9, 2015 at 7:39 PM, JohnnyT notifications@github.com wrote:

Hey @AllenOtis https://github.com/AllenOtis or @timfel https://github.com/timfel - I'm getting this error now when trying to load openssl:

-- RubyFile>>load : loading $MAGLEV_HOME/lib/ruby/1.9/openssl.rb ERROR 2702 , a RubyLoadError occurred (error 2702), dlopen(...maglev/ruby/1.9/openssl/ext/openssl.bundle, 265): Symbol not found: _rb_cArray Referenced from: ...maglev/lib/ruby/1.9/openssl/ext/openssl.bundle Expected in: flat namespace in ...maglev/lib/ruby/1.9/openssl/ext/openssl.bundle (LoadError) topaz 1> exit

any thoughts?

— Reply to this email directly or view it on GitHub https://github.com/MagLev/maglev/issues/406.

johnnyt commented 9 years ago

With the current MagLev build on darwin - after building/starting the stone just running this will get you the error:

maglev-ruby -e 'require "openssl"'
AllenOtis commented 9 years ago

I am getting to line 17 of lib/ruby/1.9/openssl.rb where the following require fails

require 'openssl/ext/openssl'

Stack is topaz 1> whr ==> 22 Kernel # require#1 (envId 1) @7 line 2 23 Object # compileFile (envId 1) @2 line 17 40 Kernel # require#1 (envId 1) @7 line 2 41 Object # compileFile (envId 1) @4 line 1 [GsProcess 151975937] topaz 1> fr 41 41 Object # __compileFile (envId 1) @4 line 1 receiver [151714561 singleton] anObject self [151714561 singleton] anObject topaz 1> l require 'openssl'

method starts at line 1 of

/iceland1/users/otisa/Svn/maglev19c/git/lib/ruby/1.9/openssl.rb

On Wed, Jul 15, 2015 at 9:42 AM, Allen Otis allen.otis@gemtalksystems.com wrote:

On Linux I don't get that far ; I get % maglev-ruby -e 'require "openssl"' ERROR 2702 , a RubyLoadError occurred (error 2702), no such file to load -- openssl/ext/openssl (LoadError) topaz 1> exit

For server development, after doing a git checkout and bulding the server, and in the git/src/kernel/parser do make clean ; make build ; make install to build the libmagparse,

I then load these 3 files into a virgin stone with topaz input $MAGLEV_HOME/src/smalltalk/baseruby.gs input $MAGLEV_HOME/src/smalltalk/loadfiletree.gs input $MAGLEV_HOME/src/smalltalk/ruby/allprims.gs

Then I am able to run vmunit tests, etc. Not sure what I am missing to get further on the require openssl .

But I do think the server file rubycext.c should be moved from libgcilnk to libmagparse , since that is where the rb_cArray symbol export problem would have to be fixed, so I will work on that this week.

Allen

On Tue, Jul 14, 2015 at 7:20 PM, JohnnyT notifications@github.com wrote:

With the current MagLev build on darwin - after building/starting the stone just running this will get you the error:

maglev-ruby -e 'require "openssl"'

— Reply to this email directly or view it on GitHub https://github.com/MagLev/maglev/issues/406#issuecomment-121460462.

zenspider commented 9 years ago

@AllenOtis:

To manually poke at this:

cd ext/openssl
ruby extconf.rb
make

There will be a file in there mkmf.log that will show the tests that it ran to determine eligibility. ext/extmk.rb is responsible for getting all ext's built from the top level. A plain make from the top should build all eligible extensions and their mkmf'log files should explain why they aren't.

AllenOtis commented 9 years ago

I think you mean cd lib/ruby/1.9/openssl/ext ruby extconf.rb

which yields % ruby extconf.rb extconf.rb:17:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:17

There is no extmk.rb anywhere in the maglev checkout . And the only Makefile is src/kernel/parser/Makefile

On Wed, Jul 15, 2015 at 3:25 PM, Ryan Davis notifications@github.com wrote:

@AllenOtis:

To manually poke at this:

cd ext/openssl ruby extconf.rb make

There will be a file in there mkmf.log that will show the tests that it ran to determine eligibility. ext/extmk.rb is responsible for getting all ext's built from the top level. A plain make from the top should build all eligible extensions and their mkmf'log files should explain why they aren't.

— Reply to this email directly or view it on GitHub.

AllenOtis commented 9 years ago

I am working on a 3.1.0.2.3 server that will move most of the ruby C extension support into libmagparse, so we can fix whatever symbol exporting problems exist on Mac . Should have this server build ready by July 21. Allen

On Wed, Jul 15, 2015 at 3:34 PM, Allen Otis allen.otis@gemtalksystems.com wrote:

I think you mean cd lib/ruby/1.9/openssl/ext ruby extconf.rb

which yields % ruby extconf.rb extconf.rb:17:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:17

There is no extmk.rb anywhere in the maglev checkout . And the only Makefile is src/kernel/parser/Makefile

On Wed, Jul 15, 2015 at 3:25 PM, Ryan Davis notifications@github.com wrote:

@AllenOtis:

To manually poke at this:

cd ext/openssl ruby extconf.rb make

There will be a file in there mkmf.log that will show the tests that it ran to determine eligibility. ext/extmk.rb is responsible for getting all ext's built from the top level. A plain make from the top should build all eligible extensions and their mkmf'log files should explain why they aren't.

— Reply to this email directly or view it on GitHub.

AllenOtis commented 9 years ago

Believed fixed by the merge to master of 407 today.