Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

OpenSSL - Symbol not found _rb_cArray #406

Closed
johnnyt opened this issue Jul 10, 2015 · 9 comments
Closed

OpenSSL - Symbol not found _rb_cArray #406

johnnyt opened this issue Jul 10, 2015 · 9 comments

Comments

@johnnyt
Copy link
Member

johnnyt commented Jul 10, 2015

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
Copy link
Contributor

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

@johnnyt
Copy link
Member Author

johnnyt commented Jul 10, 2015

Awesome - I'll try those tips.

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

@AllenOtis
Copy link
Contributor

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

@johnnyt
Copy link
Member Author

johnnyt commented Jul 15, 2015

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
Copy link
Contributor

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

require 'openssl/ext/openssl'

  •  ^2
    

    ...

    method starts at line 1 of

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

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'

  •  ^4
    

    method starts at line 1 of

    /iceland1/users/otisa/Svn/maglev19c/git/src/test/ssl.rb
    topaz 1> fr 23
    23 Object # __compileFile (envId 1) @2 line 17
    receiver [151714561 singleton] anObject
    topaz 1> l
    =begin
    = $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions
    ...
    All rights reserved.

    = Licence
    This program is licenced under the same licence as Ruby.
    (See the file 'LICENCE'.)

    = Version
    $Id: openssl.rb 32665 2011-07-25 06:38:44Z nahi $
    =end

    require 'openssl/ext/openssl'

  •  ^2
    

    require 'openssl/bn'
    require 'openssl/cipher'
    require 'openssl/config'
    require 'openssl/digest'
    require 'openssl/ssl-internal'
    require 'openssl/x509-internal'

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
#406 (comment).

@zenspider
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Believed fixed by the merge to master of 407 today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants