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

bitcoin-0.8.6 'make test' error on Fedora 19 using OpenSSL 1.0.1e #3464

Closed
georgerapp opened this issue Dec 26, 2013 · 7 comments
Closed

bitcoin-0.8.6 'make test' error on Fedora 19 using OpenSSL 1.0.1e #3464

georgerapp opened this issue Dec 26, 2013 · 7 comments

Comments

@georgerapp
Copy link

Summary: I've built OpenSSL 1.0.1e from source and installed it in /usr/local, then attempted to compile bitcoin-0.8.6 (headless bitcoind) on a Fedora 19 box using the OpenSSL installed in /usr/local, not the Fedora OpenSSL without EC. 'make test' returns *** 38 failures detected in test suite "Bitcoin Test Suite"

Details:

Steps I took to compile OpenSSL 1.0.1e:

    $ tar xvzf openssl-1.0.1e.tar.gz
    $ cd openssl-1.0.1e.tar.gz

$ ./config --prefix=/usr/local enable-ec enable-ecdh enable-ecdsa Update: see below

    $ make 
    $ make test 
    $ cd ..

$ patch -po < openssl-1.0.1e-fix_pod_syntax-1.patch Update: see below

    $ cd openssl-1.0.1e
    $ su -
    # make install 
    $ cd /usr/local/bin
    $ ./openssl version
    OpenSSL 1.0.1e 11 Feb 2013

For OpenSSL, 'make test' returned ALL TESTS SUCCESSFUL.

Steps I took to compile bitcoin-0.8.6, downloaded from http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.6/:

    $ tar xvzf bitcoin-0.8.6-linux.tar.gz
    $ cd bitcoin-0.8.6-linux
    $ cd src/src

$ export OPENSSL_INCLUDE_PATH="/usr/local/ssl/include" Update: see below
$ export OPENSSL_LIB_PATH="/usr/local/ssl/lib" Update: see below

    $ make -f makefile.unix 
    $ make -f makefile.unix test

For bitcoin-0.8.6-linux, 'make test' prints the following on stderr:

    fatal: Not a git repository (or any of the parent directories): .git

    *** 38 failures detected in test suite "Bitcoin Test Suite"
    make: *** [test] Error 201

and stdout has a bunch of errors of the following form:

    /bin/sh ../share/genbuild.sh obj/build.h
    ./test_bitcoin
    Running 94 test cases...
    unknown location(0): fatal error in "key_test1": std::runtime_error: CKey::CKey() : EC_KEY_new_by_curve_name failed
    unknown location(0): fatal error in "test_Get": std::runtime_error: CKey::CKey() : EC_KEY_new_by_curve_name failed
    test/transaction_tests.cpp(170): last checkpoint
    unknown location(0): fatal error in "test_IsStandard": std::runtime_error: CKey::CKey() : EC_KEY_new_by_curve_name failed
    test/transaction_tests.cpp(170): last checkpoint

    [... snip ...]

    unknown location(0): fatal error in "rpc_addmultisig": std::runtime_error: value is type null, expected str
    test/rpc_tests.cpp(37): last checkpoint
    unknown location(0): fatal error in "rpc_rawsign": std::runtime_error: CKey::CKey() : EC_KEY_new_by_curve_name failed
    test/rpc_tests.cpp(128): last checkpoint

System information:

    $ uname -r
    3.12.5-200.fc19.i686.PAE
    $ gcc --version
    gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@laanwj
Copy link
Member

laanwj commented Dec 26, 2013

Can you run 'ldd' on the bitcoin-test executable?
I have the suspicion that it's using your default system openssl at run
time not the one in /usr/local.
If so, you can use LD_LIBRARY_PATH to point it at the right lib dir.

@georgerapp
Copy link
Author

Ah, thanks. It appears that you may be right:

    $ ldd bitcoind
    linux-gate.so.1 =>  (0xb77a6000)
    libboost_system-mt.so.1.53.0 => /lib/libboost_system-mt.so.1.53.0 (0x4bed0000)
    libboost_filesystem-mt.so.1.53.0 => /lib/libboost_filesystem-mt.so.1.53.0 (0x4990e000)
    libboost_program_options-mt.so.1.53.0 => /lib/libboost_program_options-mt.so.1.53.0 (0xb771a000)
    libboost_thread-mt.so.1.53.0 => /lib/libboost_thread-mt.so.1.53.0 (0x4d13e000)
    libdb_cxx-5.3.so => /lib/libdb_cxx-5.3.so (0xb7534000)
    libssl.so.10 => /lib/libssl.so.10 (0x4c420000)
    libcrypto.so.10 => /lib/libcrypto.so.10 (0x4bcaf000)
    libminiupnpc.so.8 => /lib/libminiupnpc.so.8 (0x49221000)
    libz.so.1 => /lib/libz.so.1 (0x49289000)
    libdl.so.2 => /lib/libdl.so.2 (0x49266000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x4926d000)
    libstdc++.so.6 => /lib/libstdc++.so.6 (0x4967e000)
    libm.so.6 => /lib/libm.so.6 (0xb74f0000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x492a2000)
    libc.so.6 => /lib/libc.so.6 (0x49060000)
    librt.so.1 => /lib/librt.so.1 (0x492c1000)
    libgssapi_krb5.so.2 => /lib/libgssapi_krb5.so.2 (0x4bf9c000)
    libkrb5.so.3 => /lib/libkrb5.so.3 (0x4c02b000)
    libcom_err.so.2 => /lib/libcom_err.so.2 (0x4be7d000)
    libk5crypto.so.3 => /lib/libk5crypto.so.3 (0x4bf64000)
    libresolv.so.2 => /lib/libresolv.so.2 (0x495f2000)
    /lib/ld-linux.so.2 (0x4903d000)
    libkrb5support.so.0 => /lib/libkrb5support.so.0 (0x4c00c000)
    libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x4bfe6000)
    libselinux.so.1 => /lib/libselinux.so.1 (0x49336000)
    libpcre.so.1 => /lib/libpcre.so.1 (0x492cc000)

However, the LD_LIBRARY_PATH fix didn't work, as I only have the static OpenSSL libraries in /usr/local/lib, not the shared object libraries. It appears I need to fix that on the OpenSSL side. I will try that later today and update this issue.

Thanks for the quick response.

@laanwj
Copy link
Member

laanwj commented Dec 26, 2013

Right, linking openssl statically instead of dynamically sounds like the
right choice in this case. No need to mess around with linker paths then.

@georgerapp
Copy link
Author

@laanwj, thanks so much for your assistance!

For any other Fedora folk who may come upon this same error, I needed to compile OpenSSL from source, as I mentioned above. In bitcoin-0.8.5, it appears that libssl and libcrypto were compiled into bitcoind statically:

    $ cd bitcoin-0.8.5-linux/src/src
    $ ldd ./bitcoind | grep -i ssl
    $ ldd ./bitcoind | grep -i crypto
    $ ldd ./bitcoind | wc -l
    17

In bitcoind-0.8.6, on the other hand, by default, libssl is dynamically linked:

    $ cd bitcoin-0.8.6-linux/src/src
    $ ldd ./bitcoind | grep -i ssl
            libssl.so.1.0.0 => /usr/local/lib/libssl.so.1.0.0 (0xb7431000)
    $ ldd ./bitcoind | grep -i crypto
            libcrypto.so.1.0.0 => /usr/local/lib/libcrypto.so.1.0.0 (0xb72df000)
    $ ldd ./bitcoind | wc -l
    19

To correct what I wrote above, I needed to configure OpenSSL to produce shared libraries:

    ./config --prefix=/usr/local enable-ec enable-ecdh enable-ecdsa shared

and recompile. Before 'make install' would succeed, due to Perl POD syntax errors, I had to patch some of the files in the openssl-1.0.1e directory, using a patch file I found at http://ftp.cc.uoc.gr/mirrors/linux/fatdog/arm/sources/src-blfs/openssl-1.0.1e-fix_pod_syntax-1.patch

    $ cd ..
    $ patch -p0 < openssl-1.0.1e-fix_pod_syntax-1.patch
    $ cd openssl-1.0.1e
    $ su -
    # make install 

I needed to set two environment variables at compile time to use my compiled version of OpenSSL, rather than the (brain-damaged) Fedora installation:

    export OPENSSL_INCLUDE_PATH=/usr/local/include
    export OPENSSL_LIB_PATH=/usr/local/lib

and then either compile statically, as @laanwj suggests, or do what I did: set another environment variable at run time:

    export LD_LIBRARY_PATH=/usr/local/lib

If I forgot, my output from ldd shows 'not found', and bitcoind will not work:

    libssl.so.1.0.0 => not found
    libcrypto.so.1.0.0 => not found

@georgerapp
Copy link
Author

Marking closed. Thanks again!

@laanwj
Copy link
Member

laanwj commented Dec 27, 2013

Are you sure that this changed between bitcoin 0.8.5 and 0.8.6?
You're building bitcoin from source right?
AFAIK there were no build system changes. It is likely something else in your environment that changed.

@georgerapp
Copy link
Author

Yep. Compiled both 0.8.5 and 0.8.6 from the GitHub source. Don't think I
did anything different between the two builds, except for all the noted
changes to get 0.8.6 to compile.
On Dec 27, 2013 12:56 AM, "Wladimir J. van der Laan" <
notifications@github.com> wrote:

Are you sure that this changed between bitcoin 0.8.5 and 0.8.6?
You're building bitcoin from source right?
AFAIK there were no build system changes. It is likely something else in
your environment that changed.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3464#issuecomment-31249516
.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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

2 participants