Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rugged uses wrong OpenSSL version #718

Open
milgner opened this issue Aug 31, 2017 · 0 comments
Open

Rugged uses wrong OpenSSL version #718

milgner opened this issue Aug 31, 2017 · 0 comments

Comments

@milgner
Copy link

milgner commented Aug 31, 2017

While upgrading to Ruby 2.3.4, I had to compile a custom OpenSSL version because it depends on v1.0.x whereas my Arch Linux was already on v1.1. So it was compiled with --with-openssl-dir=$HOME/.rvm/usr --with-gcc=clang.

But it seems rugged still loads libssl and libcrypto from /usr/lib instead, resulting in a null pointer access violation:

/home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/lib/rugged/rugged.so: [BUG] Segmentation fault at 0x00000000000000

-- Machine register context ------------------------------------------------
 RIP: 0x00007fe6e82a3afa RBP: 0x000056463ccb39b0 RSP: 0x00007ffebd4a81d8
 RAX: 0x0000000000000000 RBX: 0x0000564631f7fdc0 RCX: 0x0000000000000100
 RDX: 0x0000000000000000 RDI: 0x0000000000000000 RSI: 0x0000000000000000
  R8: 0x0000000000000000  R9: 0x0000000000000020 R10: 0x0000000000000013
 R11: 0x00007fe6e02ac910 R12: 0x0000000000000002 R13: 0x000056463157c138
 R14: 0x000056463ccb39d0 R15: 0x00007fe6e6b46bd0 EFL: 0x0000000000010283

-- C level backtrace information -------------------------------------------
/home/marcus/.rvm/rubies/ruby-2.3.4/lib/libruby.so.2.3(rb_vm_bugreport+0x1cd) [0x7fe6e9386a0d] vm_dump.c:692
/home/marcus/.rvm/rubies/ruby-2.3.4/lib/libruby.so.2.3(rb_bug_context+0x1dd) [0x7fe6e922e45d] error.c:435
/home/marcus/.rvm/rubies/ruby-2.3.4/lib/libruby.so.2.3(sigsegv+0x40) [0x7fe6e92fc650] signal.c:890
/usr/lib/libpthread.so.0 [0x7fe6e8faa7e0]
/usr/lib/libc.so.6(__strcmp_sse2_unaligned+0x1a) [0x7fe6e82a3afa]
/home/marcus/.rvm/usr/lib/libcrypto.so.1.0.0(lh_insert+0x9d) [0x7fe6e6bcdf4d]
/home/marcus/.rvm/usr/lib/libcrypto.so.1.0.0(OBJ_NAME_add+0x60) [0x7fe6e6b47010]
/usr/lib/libssl.so.1.1 [0x7fe6e02d7923]
/usr/lib/libpthread.so.0 [0x7fe6e8fa7bdf]
/usr/lib/libcrypto.so.1.1(CRYPTO_THREAD_run_once+0xa) [0x7fe6dffda64a]
/usr/lib/libssl.so.1.1(OPENSSL_init_ssl+0x8d) [0x7fe6e02d7b5d]
/home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/lib/rugged/rugged.so(git_openssl_stream_global_init+0x17) [0x7fe6ce8fac97] /home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/vendor/libgit2/src/openssl_stream.c:110
/home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/lib/rugged/rugged.so(init_once+0x68) [0x7fe6ce8de8e8] /home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/vendor/libgit2/src/global.c:64
/usr/lib/libpthread.so.0 [0x7fe6e8fa7bdf]
/home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/lib/rugged/rugged.so(git_libgit2_init+0x43) [0x7fe6ce8de983] /home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/vendor/libgit2/src/global.c:278
/home/marcus/.rvm/gems/ruby-2.3.4@evopark/gems/rugged-0.26.0/lib/rugged/rugged.so(Init_rugged+0x2aa) [0x7fe6ce8aab1a] rugged.c:608
/home/marcus/.rvm/rubies/ruby-2.3.4/lib/libruby.so.2.3(dln_load+0xeb) [0x7fe6e91e61cb] dln.c:1355
/home/marcus/.rvm/rubies/ruby-2.3.4/lib/libruby.so.2.3(rb_vm_call_cfunc+0x109) [0x7fe6e9378219] vm.c:1962
/home/marcus/.rvm/rubies/ruby-2.3.4/lib/libruby.so.2.3(rb_require_internal+0x681) [0x7fe6e923bee1] load.c:1002

(this is a shortened version with the parts I thought to be most relevant, if you need more information, don't hesitate to ask)

Since I didn't see any explicit references to loading OpenSSL in this gem, I guess that it's a problem with the Rubygems build system, which I'm unfortunately not familiar with. But maybe someone else has seen this problem and knows a workaround for it?

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

No branches or pull requests

1 participant