Erlang crypto_drv in R13B02/03 fails to load on amd64-Solaris2.10

Peter-Henry Mander <>
Fri Nov 20 16:43:23 CET 2009


Hi Gentlepeople,

Does anyone else use the Erlang crypto application on Solaris 10, U8?
We try to compile Erlang to run as a amd64 binary to access the 64Gb
RAM on our servers. I know that crypto will load on Linux amd64, so
the driver is capable of doing what's written on the tin.

The symptom are appended below. R12B-5 can load the crypto_drv, but
R13B0{2,3} cannot.

I'm confident that the openssl-0.9.8i library is fine, we use stunnel
linked to this and it works.

We tried GCC-3.4.3 as supplied by Sun, and tried with GCC-4.4.2,
compiling with the option -mcmodel=medium to see if adjusting the
memory model would help, to no avail. This was prompted by indications
that the relocation error was due to AMD ABI, address register
relative memory access was spanning ranges beyond 2Gb in size, and
would not fit in the 32bit offset.

Help please? Yes, it works on Linux, no I can't consider deploying
that option just yet. If compiling Erlang R13B as a 32bit runtime
still enables access to the full 64Gb of memory, I may consider this
option (I haven't tried yet).

Pete.

> ~/R12B-5/bin/erl
Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [smp:8]
[async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.6.5  (abort with ^G)
1> application:start(crypto).
ok


> ~/R13B02/bin/erl
Erlang R13B02 (erts-5.7.3) [source] [64-bit] [smp:8:8] [rq:8]
[async-threads:0] [kernel-poll:false]

Eshell V5.7.3  (abort with ^G)
1> PrivDir = code:priv_dir(crypto).
"/Software/R13B02/lib/erlang/lib/crypto-1.6.1/priv"
2> LibDir1 = filename:join([PrivDir, "lib"]).
"/Software/R13B02/lib/erlang/lib/crypto-1.6.1/priv/lib"
3> erl_ddll:load_driver(LibDir1, crypto_drv).
{error,{open_error,-10}}
4> erl_ddll:format_error({open_error,-10}).
"ld.so.1: beam.smp: fatal: relocation error: R_AMD64_PC32: file
/Software/R13B02/lib/erlang/lib/crypto-1.6.1/priv/lib/crypto_drv.so:
symbol main: value 0x28002cb378c does not fit"


> ~/R13B03-2009-11-19/bin/erl
Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:8:8] [rq:8]
[async-threads:0] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
1> application:start(crypto).

=ERROR REPORT==== 20-Nov-2009::15:24:25 ===
Unable to load crypto_drv. Failed with error:
"ld.so.1: beam.smp: fatal: relocation error: R_AMD64_32: file
/Software/R13B03-2009-11-19/lib/erlang/lib/crypto-1.6.3/priv/lib/crypto_drv.so:
symbol (unknown): value 0xfffffd7ffd514fdf does not fit"
OpenSSL might not be installed on this system.
{error,{shutdown,{crypto_app,start,[normal,[]]}}}

=INFO REPORT==== 20-Nov-2009::15:24:25 ===
    application: crypto
    exited: {shutdown,{crypto_app,start,[normal,[]]}}
    type: temporary


More information about the erlang-questions mailing list