[erlang-questions] erlang fails to load crypto on solaris 10 x86_64

81 views
Skip to first unread message

Venu Middela

unread,
Nov 7, 2012, 11:24:53 PM11/7/12
to erlang-q...@erlang.org
Hi All,

Trying to load crypto module on  solaris 10 x86_64, getting the following error.
I've seen previous posts similar to this one, but none of the solutions/work-arounds provided in those threads helped resolve the error below...
recompiled openssl few times with multiple different options, recompiled erlang a few times with different combinations of arguments...

Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.1  abort with ^G)
1> l(crypto).
{error,on_load_failure}
=ERROR REPORT==== 7-Nov-2012::22:13:54 ===
Unable to load crypto library. Failed with error:
"load_failed, Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.1/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"
OpenSSL might not be installed on this system.

=ERROR REPORT==== 7-Nov-2012::22:13:54 ===
The on_load function for module crypto returned {error,
                                                 {load_failed,
                                                  "Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.1/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"}} 
2> q().


here are ldd and file outputs for crypto.so

/usr/local/lib/erlang/lib/crypto-2.1/priv/lib# ldd crypto.so 
        libcrypto.so.0.9.7 =>    /usr/sfw/lib/64/libcrypto.so.0.9.7
        libssl.so.0.9.7 =>       /usr/sfw/lib/64/libssl.so.0.9.7
        libc.so.1 =>     /lib/64/libc.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1
        libscf.so.1 =>   /lib/64/libscf.so.1
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        libcrypto_extra.so.0.9.7 =>      /usr/sfw/lib/amd64/libcrypto_extra.so.0.9.7
        libssl_extra.so.0.9.7 =>         /usr/sfw/lib/amd64/libssl_extra.so.0.9.7
        libm.so.2 =>     /lib/64/libm.so.2


#file /usr/local/lib/erlang/lib/crypto-2.1/priv/lib# ldd crypto.so 
/usr/local/lib/erlang/lib/crypto-2.1/priv/lib/crypto.so:        ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped


any ideas how to load crypto on 64bit Erlang R15B01 on solaris10x86_64.

Thanks,
Venu

Sverker Eriksson

unread,
Nov 8, 2012, 4:59:01 AM11/8/12
to Venu Middela, erlang-q...@erlang.org
crypto needs OpenSSL 0.9.8, you have 0.9.7.

Either install 0.9.8 or patch crypto by removing the NIF
des_ede3_cfb_crypt which is the only one that needs 0.9.8.

/Sverker, Erlang/OTP Ericsson

Venu Middela wrote:
>
>
> Hi All,
>
>
> Trying to load crypto module on solaris 10 x86_64, getting the following error.
> I've seen previous posts similar to this one, but none of the solutions/work-arounds provided in those threads helped resolve the error below...recompiled openssl few times with multiple different options, recompiled erlang a few times with different combinations of arguments...
> Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]Eshell V5.9.1 abort with ^G)1> l(crypto).{error,on_load_failure}=ERROR REPORT==== 7-Nov-2012::22:13:54 ===Unable to load crypto library. Failed with error:"load_failed, Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.1/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"OpenSSL might not be installed on this system.
> =ERROR REPORT==== 7-Nov-2012::22:13:54 ===The on_load function for module crypto returned {error, {load_failed, "Failed to load NIF library: 'ld.so.1: beam.smp: fatal: relocation error: file /usr/local/lib/erlang/lib/crypto-2.1/priv/lib/crypto.so: symbol DES_ede3_cfb_encrypt: referenced symbol not found'"}} 2> q().
>
> here are ldd and file outputs for crypto.so
> /usr/local/lib/erlang/lib/crypto-2.1/priv/lib# ldd crypto.so libcrypto.so.0.9.7 => /usr/sfw/lib/64/libcrypto.so.0.9.7 libssl.so.0.9.7 => /usr/sfw/lib/64/libssl.so.0.9.7 libc.so.1 => /lib/64/libc.so.1 libsocket.so.1 => /lib/64/libsocket.so.1 libnsl.so.1 => /lib/64/libnsl.so.1 libmp.so.2 => /lib/64/libmp.so.2 libmd.so.1 => /lib/64/libmd.so.1 libscf.so.1 => /lib/64/libscf.so.1 libdoor.so.1 => /lib/64/libdoor.so.1 libuutil.so.1 => /lib/64/libuutil.so.1 libgen.so.1 => /lib/64/libgen.so.1 libcrypto_extra.so.0.9.7 => /usr/sfw/lib/amd64/libcrypto_extra.so.0.9.7 libssl_extra.so.0.9.7 => /usr/sfw/lib/amd64/libssl_extra.so.0.9.7 libm.so.2 => /lib/64/libm.so.2
>
> #file /usr/local/lib/erlang/lib/crypto-2.1/priv/lib# ldd crypto.so /usr/local/lib/erlang/lib/crypto-2.1/priv/lib/crypto.so: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped
>
> any ideas how to load crypto on 64bit Erlang R15B01 on solaris10x86_64.
> Thanks,Venu
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions
>

_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Kostis Sagonas

unread,
Nov 8, 2012, 6:34:05 AM11/8/12
to erlang-q...@erlang.org
On 11/08/2012 10:59 AM, Sverker Eriksson wrote:
> crypto needs OpenSSL 0.9.8, you have 0.9.7.
>
> Either install 0.9.8 or patch crypto by removing the NIF
> des_ede3_cfb_crypt which is the only one that needs 0.9.8.

Shouldn't this be checked or isn't this something which is done better
as part of the configure script? I.e. checking at configure time which
OpenSSL version is used and taking some appropriate action?

Kostis

Sverker Eriksson

unread,
Nov 8, 2012, 8:58:19 AM11/8/12
to Kostis Sagonas, erlang-q...@erlang.org
Kostis Sagonas wrote:
> On 11/08/2012 10:59 AM, Sverker Eriksson wrote:
>> crypto needs OpenSSL 0.9.8, you have 0.9.7.
>>
>> Either install 0.9.8 or patch crypto by removing the NIF
>> des_ede3_cfb_crypt which is the only one that needs 0.9.8.
>
> Shouldn't this be checked or isn't this something which is done better
> as part of the configure script? I.e. checking at configure time
> which OpenSSL version is used and taking some appropriate action?
>
Yes, that would be nicer.

In R16 crypto will support OpenSSL 0.9.7.

crypto:des3_cfb_encrypt and des3_cfb_decrypt will then throw exception
'notsup'.

/Sverker

Venu Middela

unread,
Nov 8, 2012, 3:12:12 PM11/8/12
to sverker....@ericsson.com, erlang-q...@erlang.org
Steve,
 Thanks for pointing out the correct version of crypto.
Could you please point to instructions on how to patch crypto to remove the NIF des_ede3_cfb_crypt.
I couldnt find a solaris package version 0.9.8. Looked through oracle sites for updated package and/or any patch that would
upgrade openssl to 0.9.8, but no luck.

Thanks
Venu

> Date: Thu, 8 Nov 2012 14:58:19 +0100
> From: sverker....@ericsson.com
> To: kos...@cs.ntua.gr
> CC: erlang-q...@erlang.org
> Subject: Re: [erlang-questions] erlang fails to load crypto on solaris 10 x86_64

Attila Rajmund Nohl

unread,
Nov 8, 2012, 3:50:21 PM11/8/12
to erlang-questions
2012/11/8 Venu Middela <mv...@hotmail.com>:
> Steve,
> Thanks for pointing out the correct version of crypto.
> Could you please point to instructions on how to patch crypto to remove the
> NIF des_ede3_cfb_crypt.
> I couldnt find a solaris package version 0.9.8. Looked through oracle sites
> for updated package and/or any patch that would
> upgrade openssl to 0.9.8, but no luck.

Check sunfreeware.com (or one of its mirrors). For example this is a
0.9.8 package for Solaris 10 on x86:
http://sunfreeware.saix.net/programlistintel10.html#openssl098p It
seems that now the main site requires registration :-(

Venu Middela

unread,
Nov 8, 2012, 4:07:40 PM11/8/12
to attila...@gmail.com, erlang-q...@erlang.org
Attila,
 I did try installing the package openssl0.9.8, but the binaries from this package are 32 bit.
also, when i tried to compile from the  sourcecode , strangely, the compile/make is not building the 64-bit binaries for libcrypto and libssl..
here's the contents of compiled /usr/local/ssl/lib
bash-3.2$ pwd                                                                   /usr/local/ssl/lib                                                              
-bash-3.2$ ls   
engines      libcrypto.a  libssl.a     pkgconfig


Thanks,
Venu

> Date: Thu, 8 Nov 2012 21:50:21 +0100
> From: attila...@gmail.com
> To: erlang-q...@erlang.org

> Subject: Re: [erlang-questions] erlang fails to load crypto on solaris 10 x86_64
>

Sverker Eriksson

unread,
Nov 9, 2012, 4:25:51 AM11/9/12
to Venu Middela, erlang-q...@erlang.org
You have to configure openssl source tree with option 'shared' to get
dynamic libraries.
Option 'no-asm' might also help if you get compile problems. Read INSTALL.

/Sverker
> ------------------------------------------------------------------------

Venu Middela

unread,
Nov 9, 2012, 4:50:25 PM11/9/12
to sverker....@ericsson.com, erlang-q...@erlang.org
Sverker, Thanks for the quick suggestion.. I was able to compile and build  64-bit openssl along with building shared objects.
Now, when i try to compile erlang 15B01, running into a new compilation error..

Here's my configure parameters before running gmake..

#./configure --enable-m64-build --prefix=/export/home/vmi/ERL --enable-threads --enable-smp-support 
--with-ssl=/usr/local/ssl --with-ssl-lib=/usr/local/ssl/lib


Heres' the compilation error:
gcc -m64  -m64  -fPIC -I/export/home/vmi/otp/otp_src_R15B01/erts/i386-pc-so
laris2.10  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DERTS_SMP -DHAVE_CONFIG_
H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -
DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_PTHREAD_SEMANT
ICS  -Ii386-pc-solaris2.10/opt/smp -Ibeam -Isys/unix -Isys/common -Ii386-pc-sola
ris2.10 -Izlib  -Ipcre -Ihipe -I../include -I../include/i386-pc-solaris2.10 -I..
/include/internal -I../include/internal/i386-pc-solaris2.10 -c i386-pc-solaris2.
10/opt/smp/hipe_amd64_bifs.S -o obj/i386-pc-solaris2.10/opt/smp/hipe_amd64_bifs.
o                                                                               
i386-pc-solaris2.10/opt/smp/hipe_amd64_bifs.S:2005:2: #endif without #if        
gmake[3]: *** [obj/i386-pc-solaris2.10/opt/smp/hipe_amd64_bifs.o] Error 1       
gmake[3]: Leaving directory `/export/home/vmi/otp/otp_src_R15B01/erts/emula
tor'                                                                            
gmake[2]: *** [opt] Error 2                                                     
gmake[2]: Leaving directory `/export/home/vmi/otp/otp_src_R15B01/erts/emula
tor'                                                                            
gmake[1]: *** [smp] Error 2                                                     
gmake[1]: Leaving directory `/export/home/vmi/otp/otp_src_R15B01/erts'     
gmake: *** [emulator] Error 2                                                   
ddela/otp/otp_src_R15B01root@secunderabad:/export/home/vmi/otp/otp_src_R15B
Thanks,
Venu

> Date: Fri, 9 Nov 2012 10:25:51 +0100
> From: sverker....@ericsson.com
> To: mv...@hotmail.com
> CC: attila...@gmail.com; erlang-q...@erlang.org

Sverker Eriksson

unread,
Nov 12, 2012, 6:03:55 AM11/12/12
to Venu Middela, erlang-q...@erlang.org
Use --disable-hipe as a workaround if you do not plan to use hipe.

In either way, could you sent me (off list) the generated file
erts/emulator/i386-pc-solaris2.10/opt/smp/hipe_amd64_bifs.S

/Sverker

Sverker Eriksson

unread,
Nov 13, 2012, 6:24:47 AM11/13/12
to Venu Middela, erlang-questions
Looks like this bug is dependent on which implementation/version of the
"m4" macro processor is used.

Here is a patch. Note the two different types of quote characters around
the word ifdef.

diff --git a/erts/emulator/hipe/hipe_bif_list.m4
b/erts/emulator/hipe/hipe_bif_list.m4
index 942fa0c..7f78ddd 100644
--- a/erts/emulator/hipe/hipe_bif_list.m4
+++ b/erts/emulator/hipe/hipe_bif_list.m4
@@ -245,7 +245,7 @@ noproc_primop_interface_5(nbif_bs_put_big_integer,
hipe_bs_put_big_integer)

gc_bif_interface_0(nbif_check_get_msg, hipe_check_get_msg)

-#ifdef NO_FPE_SIGNALS
+#`ifdef' NO_FPE_SIGNALS
nocons_nofail_primop_interface_0(nbif_emulate_fpe, hipe_emulate_fpe)
#endif

/Sverker


Venu Middela wrote:
> Hi Sverker, attached is the amd64_bifs.S. We do not have Hipe enabled as part of the application. I'm in the process of compiling erlang with "==disable-hipe" option to see if it compiles successfully.will let you know.
>
> Thanks,Venu
>
>
>> Date: Mon, 12 Nov 2012 12:03:55 +0100
>> From: sverker....@ericsson.com
>> To: mv...@hotmail.com
>> CC: sverker....@ericsson.com; erlang-q...@erlang.org
Reply all
Reply to author
Forward
0 new messages