Ruby-build: Unable to install Ruby on Fedora 26

Created on 15 Jul 2017  路  16Comments  路  Source: rbenv/ruby-build

I did just upgrade to Fedora 26. Trying to install ruby using the official Fedora docs Here

WhenI did
$ rbenv install 2.3.1

Installing ruby-2.3.1... *** Error in./miniruby': malloc(): memory corruption: 0x00007fff195b1458 *
======= Backtrace: =========
/lib64/libc.so.6(+0x7c8ac)[0x7fbe53eb08ac]
/lib64/libc.so.6(+0x8952b)[0x7fbe53ebd52b]
/lib64/libc.so.6(__libc_calloc+0xc8)[0x7fbe53ec26d8]
./miniruby(+0xa9176)[0x55d34909b176]
./miniruby(st_init_numtable_with_size+0x54)[0x55d349163c94]
./miniruby(+0xf9d05)[0x55d3490ebd05]
./miniruby(+0x106dec)[0x55d3490f8dec]
./miniruby(+0x10fed1)[0x55d349101ed1]
./miniruby(+0x208be9)[0x55d3491fabe9]
./miniruby(rb_iseq_compile_with_option+0x38d)[0x55d3491d352d]
./miniruby(+0x1f7907)[0x55d3491e9907]
./miniruby(rb_mod_module_eval+0x165)[0x55d3491f0285]
./miniruby(+0x1ede64)[0x55d3491dfe64]
./miniruby(+0x1ef63d)[0x55d3491e163d]
./miniruby(+0x1f577c)[0x55d3491e777c]
./miniruby(+0x1f6537)[0x55d3491e8537]
./miniruby(rb_yield+0x5f)[0x55d3491ef72f]
./miniruby(rb_ary_each+0x3c)[0x55d34901abec]
./miniruby(+0x1ede64)[0x55d3491dfe64]
./miniruby(+0x1f6c59)[0x55d3491e8c59]
./miniruby(+0x1f7203)[0x55d3491e9203]
./miniruby(+0x1ef720)[0x55d3491e1720]
./miniruby(+0x1f577c)[0x55d3491e777c]
./miniruby(+0x84fc9)[0x55d349076fc9]
./miniruby(+0x87f51)[0x55d349079f51]
./miniruby(rb_f_require+0x13)[0x55d34907a073]
./miniruby(+0x1ede64)[0x55d3491dfe64]
./miniruby(+0x1f6c59)[0x55d3491e8c59]
./miniruby(+0x1f7203)[0x55d3491e9203]
./miniruby(+0x1ef63d)[0x55d3491e163d]
./miniruby(+0x1f577c)[0x55d3491e777c]
./miniruby(+0x84fc9)[0x55d349076fc9]
./miniruby(+0x8564f)[0x55d34907764f]
./miniruby(+0x1ede64)[0x55d3491dfe64]
./miniruby(+0x1f6c59)[0x55d3491e8c59]
./miniruby(+0x1f7203)[0x55d3491e9203]
./miniruby(+0x1ef63d)[0x55d3491e163d]
./miniruby(+0x1f577c)[0x55d3491e777c]
./miniruby(+0x7f507)[0x55d349071507]
./miniruby(ruby_run_node+0x2f)[0x55d349074f7f]
./miniruby(+0x241eb)[0x55d3490161eb]
/lib64/libc.so.6(__libc_start_main+0xea)[0x7fbe53e544da]
./miniruby(_start+0x2a)[0x55d34901621a]
======= Memory map: ========
55d348ff2000-55d3492df000 r-xp 00000000 00:2a 575529 /tmp/ruby-build.20170715203336.30405/ruby-2.3.1/miniruby
55d3494de000-55d3494e3000 r--p 002ec000 00:2a 575529 /tmp/ruby-build.20170715203336.30405/ruby-2.3.1/miniruby
55d3494e3000-55d3494e4000 rw-p 002f1000 00:2a 575529 /tmp/ruby-build.20170715203336.30405/ruby-2.3.1/miniruby
55d3494e4000-55d3494f5000 rw-p 00000000 00:00 0
55d34b4c8000-55d34b868000 rw-p 00000000 00:00 0 [heap]
7fbe48000000-7fbe48021000 rw-p 00000000 00:00 0
7fbe48021000-7fbe4c000000 ---p 00000000 00:00 0
7fbe4ce7b000-7fbe4ce91000 r-xp 00000000 fd:00 1451146 /usr/lib64/libgcc_s-7-20170622.so.1
7fbe4ce91000-7fbe4d090000 ---p 00016000 fd:00 1451146 /usr/lib64/libgcc_s-7-20170622.so.1
7fbe4d090000-7fbe4d091000 r--p 00015000 fd:00 1451146 /usr/lib64/libgcc_s-7-20170622.so.1
7fbe4d091000-7fbe4d092000 rw-p 00016000 fd:00 1451146 /usr/lib64/libgcc_s-7-20170622.so.1
7fbe4d092000-7fbe53c31000 r--p 00000000 fd:00 1445272 /usr/lib/locale/locale-archive
7fbe53c31000-7fbe53c33000 r-xp 00000000 fd:00 1442197 /usr/lib64/libfreebl3.so
7fbe53c33000-7fbe53e32000 ---p 00002000 fd:00 1442197 /usr/lib64/libfreebl3.so
7fbe53e32000-7fbe53e33000 r--p 00001000 fd:00 1442197 /usr/lib64/libfreebl3.so
7fbe53e33000-7fbe53e34000 rw-p 00002000 fd:00 1442197 /usr/lib64/libfreebl3.so
7fbe53e34000-7fbe53ffb000 r-xp 00000000 fd:00 1447045 /usr/lib64/libc-2.25.so
7fbe53ffb000-7fbe541fb000 ---p 001c7000 fd:00 1447045 /usr/lib64/libc-2.25.so
7fbe541fb000-7fbe541ff000 r--p 001c7000 fd:00 1447045 /usr/lib64/libc-2.25.so
7fbe541ff000-7fbe54201000 rw-p 001cb000 fd:00 1447045 /usr/lib64/libc-2.25.so
7fbe54201000-7fbe54205000 rw-p 00000000 00:00 0
7fbe54205000-7fbe5431a000 r-xp 00000000 fd:00 1447086 /usr/lib64/libm-2.25.so
7fbe5431a000-7fbe54519000 ---p 00115000 fd:00 1447086 /usr/lib64/libm-2.25.so
7fbe54519000-7fbe5451a000 r--p 00114000 fd:00 1447086 /usr/lib64/libm-2.25.so
7fbe5451a000-7fbe5451b000 rw-p 00115000 fd:00 1447086 /usr/lib64/libm-2.25.so
7fbe5451b000-7fbe54522000 r-xp 00000000 fd:00 1447258 /usr/lib64/libcrypt-nss-2.25.so
7fbe54522000-7fbe54721000 ---p 00007000 fd:00 1447258 /usr/lib64/libcrypt-nss-2.25.so
7fbe54721000-7fbe54722000 r--p 00006000 fd:00 1447258 /usr/lib64/libcrypt-nss-2.25.so
7fbe54722000-7fbe54723000 rw-p 00007000 fd:00 1447258 /usr/lib64/libcrypt-nss-2.25.so
7fbe54723000-7fbe54751000 rw-p 00000000 00:00 0
7fbe54751000-7fbe54754000 r-xp 00000000 fd:00 1447084 /usr/lib64/libdl-2.25.so
7fbe54754000-7fbe54953000 ---p 00003000 fd:00 1447084 /usr/lib64/libdl-2.25.so
7fbe54953000-7fbe54954000 r--p 00002000 fd:00 1447084 /usr/lib64/libdl-2.25.so
7fbe54954000-7fbe54955000 rw-p 00003000 fd:00 1447084 /usr/lib64/libdl-2.25.so
7fbe54955000-7fbe5496e000 r-xp 00000000 fd:00 1447098 /usr/lib64/libpthread-2.25.so
7fbe5496e000-7fbe54b6e000 ---p 00019000 fd:00 1447098 /usr/lib64/libpthread-2.25.so
7fbe54b6e000-7fbe54b6f000 r--p 00019000 fd:00 1447098 /usr/lib64/libpthread-2.25.so
7fbe54b6f000-7fbe54b70000 rw-p 0001a000 fd:00 1447098 /usr/lib64/libpthread-2.25.so
7fbe54b70000-7fbe54b74000 rw-p 00000000 00:00 0
7fbe54b74000-7fbe54b9b000 r-xp 00000000 fd:00 1446088 /usr/lib64/ld-2.25.so
7fbe54c74000-7fbe54d7a000 rw-p 00000000 00:00 0
7fbe54d8c000-7fbe54d8d000 rw-p 00000000 00:00 0
7fbe54d8d000-7fbe54d94000 r--s 00000000 fd:00 1702544 /usr/lib64/gconv/gconv-modules.cache
7fbe54d94000-7fbe54d95000 ---p 00000000 00:00 0
7fbe54d95000-7fbe54d9a000 rw-p 00000000 00:00 0
7fbe54d9a000-7fbe54d9b000 r--p 00026000 fd:00 1446088 /usr/lib64/ld-2.25.so
7fbe54d9b000-7fbe54d9d000 rw-p 00027000 fd:00 1446088 /usr/lib64/ld-2.25.so
7fff18db8000-7fff195b7000 rw-p 00000000 00:00 0 [stack]
7fff195f7000-7fff195f9000 r--p 00000000 00:00 0 [vvar]
7fff195f9000-7fff195fb000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

BUILD FAILED (Fedora 26 using ruby-build 20170523-25-g476d09b)

Inspect or clean up the working tree at /tmp/ruby-build.20170715203336.30405
Results logged to /tmp/ruby-build.20170715203336.30405.log

Last 10 log lines:
linking miniruby
generating encdb.h
rbconfig.rb updated
generating enc.mk
creating verconf.h
encdb.h updated
verconf.h updated
compiling loadpath.c
make: * [uncommon.mk:655: enc.mk] Aborted (core dumped)
make: *
Waiting for unfinished jobs....
`

Most helpful comment

I managed to install 2.3.1 and 2.3.5 a few minutes ago by forcing install of compat-openssl10-devel on Fedora 27. The only conflicting package was openssl-devel.

sudo dnf install compat-openssl10-devel --allowerasing

Afterwards, 2.3.5 installs just fine, as it was patched for gcc 7

rbenv install 2.3.5

while 2.3.1 installed with the gcc patch reference command suggested by @pmk1c

rbenv install -p 2.3.1 < <(curl -sSL https://bugs.ruby-lang.org/attachments/download/6655/ruby_2_3_gcc7.patch)

Finally, I replaced compat-openssl10-devel with the latest openssl-devel again:

sudo dnf install openssl-devel --allowerasing

@mbevc1 Before this, I spent a couple hours trying to downgrade openssl and its many dependencies. Didn't get anywhere with that. Would not recommend.

All 16 comments

Same thing here. I had to switch to the fedora ruby distribution for a moment.

Having the same problem. Downgrading to gcc-6 and using compat-openssl10-devel worked for me:

dnf downgrade gcc --releasever=25
dnf install compat-openssl10-devel --allowerasing

Not the best way, since you need to versionlock gcc (and don't upgrade via PackageKit / Gnome Software), but it works for now.

It seems a problem of gcc-7. I'm going to investigate this.

There is a patch for this, that got backported to Ruby 2.4.x. But it didn't get backported to 2.3.x., yet: https://bugs.ruby-lang.org/issues/13150

I tried to use it for 2.3.x, but it doesn't help. Probably more things to change here.

I created a patch for gcc-7 on fedora26 environment and requested to backport it patch to ruby_2_3 branch.

https://bugs.ruby-lang.org/attachments/6655/ruby_2_3_gcc7.patch

We will fix this issue on next stable release that is Ruby 2.3.5.

rbenv install -p 2.3.1 < <(curl -sSL https://bugs.ruby-lang.org/attachments/download/6655/ruby_2_3_gcc7.patch)

Seems to work for me. Thanks!

@AnwarShah I'm not rvm maintainer. You should ask rvm maintainer about rvm on rvm repository.

Ruby 2.3.5 was released.

I can confirm the problem was fixed, but still does not compile on Fedora 26 due to some X509/ASN library incompatibility :-(

I think it's incompatible with OpenSSL 1.1

@lzap see #1111

Yeah, that's true but installing openssl-devel-1.0 package is incompatible with 1.1 on Fedora and that is a dep to other packages as well....

I managed to install 2.3.1 and 2.3.5 a few minutes ago by forcing install of compat-openssl10-devel on Fedora 27. The only conflicting package was openssl-devel.

sudo dnf install compat-openssl10-devel --allowerasing

Afterwards, 2.3.5 installs just fine, as it was patched for gcc 7

rbenv install 2.3.5

while 2.3.1 installed with the gcc patch reference command suggested by @pmk1c

rbenv install -p 2.3.1 < <(curl -sSL https://bugs.ruby-lang.org/attachments/download/6655/ruby_2_3_gcc7.patch)

Finally, I replaced compat-openssl10-devel with the latest openssl-devel again:

sudo dnf install openssl-devel --allowerasing

@mbevc1 Before this, I spent a couple hours trying to downgrade openssl and its many dependencies. Didn't get anywhere with that. Would not recommend.

Cool, after replacing back to OpenSSL 1.1 does Ruby work as expected - are libraries statically linked there?

It's been fine so far running a large Rails 4 app.

Yeah, looks good on F27 here as well 馃憤 . Thanks @jarongao !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arpitchauhan picture arpitchauhan  路  4Comments

williambsb picture williambsb  路  5Comments

denisemauldin picture denisemauldin  路  4Comments

ghost picture ghost  路  4Comments

JDutil picture JDutil  路  3Comments