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

Segfault [contains backtrace] [links to PR fix] #2276

Closed
6 tasks
xloem opened this issue Sep 28, 2020 · 2 comments · Fixed by #2288
Closed
6 tasks

Segfault [contains backtrace] [links to PR fix] #2276

xloem opened this issue Sep 28, 2020 · 2 comments · Fixed by #2288
Labels
3d Bug Classification indicating the existing implementation does not match the intention of the design

Comments

@xloem
Copy link
Contributor

xloem commented Sep 28, 2020

Bug Description
witness_node segfaults on launch apparently due to dereference of null pointer in libraries/fc

$ gdb --args programs/witness_node/witness_node --help
GNU gdb (GDB) Red Hat Enterprise Linux 8.0.1-36.el7
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
---Type <return> to continue, or q <return> to quit---
Type "apropos word" to search for commands related to "word"...
Reading symbols from programs/witness_node/witness_node...
done
(gdb) run
Starting program: /shared/src/bitshares-core/build/programs/witness_node/witness_node --help
Missing separate debuginfos, use: debuginfo-install glibc-2.17-292.el7.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff696cef3 in std::string::empty() const () from /lib64/libstdc++.so.6
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.26-23.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-37.el7_7.2.x86_64 libcom_err-1.42.9-16.el7.x86_64 libcurl-7.29.0-54.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libidn-1.28-4.el7.x86_64 libselinux-2.5-14.1.el7.x86_64 libssh2-1.8.0-3.el7.x86_64 libstdc++-4.8.5-39.el7.x86_64 nspr-4.21.0-1.el7.x86_64 nss-3.44.0-4.el7.x86_64 nss-softokn-freebl-3.44.0-5.el7.x86_64 nss-util-3.44.0-3.el7.x86_64 openldap-2.4.44-21.el7_6.x86_64 openssl-libs-1.0.2k-19.el7.x86_64 pcre-8.32-17.el7.x86_64 zlib-1.2.7-18.el7.x86_64
(gdb) bt
#0  0x00007ffff696cef3 in std::string::empty() const () from /lib64/libstdc++.so.6
#1  0x00000000094bf0ca in boost::filesystem::path::empty (this=0xf1aeae0 <fc::openssl_scope::_configurationFilePath>) at /usr/local/include/boost/filesystem/path.hpp:515
#2  0x000000000961a413 in fc::openssl_scope::openssl_scope (this=0xf1aeb08 <fc::init_openssl()::ossl>) at /home/user/src/bitshares-core/libraries/fc/src/crypto/openssl.cpp:22
#3  0x0000000009619ddf in fc::init_openssl () at /home/user/src/bitshares-core/libraries/fc/src/crypto/openssl.cpp:63
#4  0x00000000094f567a in fc::ecc::detail::_init_lib () at /home/user/src/bitshares-core/libraries/fc/src/crypto/elliptic_secp256k1.cpp:32
#5  0x00000000094f9c9e in fc::ecc::detail::public_key_impl::public_key_impl (this=0x7fffffffdc90) at /home/user/src/bitshares-core/libraries/fc/src/crypto/elliptic_secp256k1.cpp:41
#6  0x00000000094f9b90 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /home/user/src/bitshares-core/libraries/fc/src/crypto/elliptic_secp256k1.cpp:63
#7  0x00000000094f9bfc in _GLOBAL__sub_I_elliptic_secp256k1.cpp(void) () at /home/user/src/bitshares-core/libraries/fc/src/crypto/elliptic_secp256k1.cpp:306
#8  0x000000000b30434d in __libc_csu_init ()
#9  0x00007ffff5fec4d5 in __libc_start_main () from /lib64/libc.so.6
#10 0x000000000884bf65 in _start ()
(gdb) up 2
#2  0x000000000961a413 in fc::openssl_scope::openssl_scope (this=0xf1aeb08 <fc::init_openssl()::ossl>) at /home/user/src/bitshares-core/libraries/fc/src/crypto/openssl.cpp:22
22                if(boostPath.empty() == false)
(gdb) list
17             {
18                ERR_load_crypto_strings(); 
19                OpenSSL_add_all_algorithms();
20
21                const boost::filesystem::path& boostPath = _configurationFilePath;
22                if(boostPath.empty() == false)
23                {
24                  std::string varSetting("OPENSSL_CONF=");
25                  varSetting += _configurationFilePath.to_native_ansi_path();
26      #if defined(WIN32)
(gdb) break 21
Breakpoint 1 at 0x961a3f4: file /home/user/src/bitshares-core/libraries/fc/src/crypto/openssl.cpp, line 21.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /shared/src/bitshares-core/build/programs/witness_node/witness_node --help
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, fc::openssl_scope::openssl_scope (this=0xf1aeb08 <fc::init_openssl()::ossl>) at /home/user/src/bitshares-core/libraries/fc/src/crypto/openssl.cpp:21
21                const boost::filesystem::path& boostPath = _configurationFilePath;
(gdb) s
fc::path::operator boost::filesystem::path& (this=0xf1aeae0 <fc::openssl_scope::_configurationFilePath>) at /home/user/src/bitshares-core/libraries/fc/src/filesystem.cpp:90
90          return *_p;
(gdb) p _p
$1 = {_store = '\000' <repeats 31 times>}
(gdb) p (bool)_p
$2 = false

Host Environment
Please provide details about the host environment. Much of this information can be found running: witness_node --version.

  • Host OS: Red Hat Enterprise Linux Workstation release 7.7 (Maipo)
  • Host Physical RAM 16GB
  • BitShares Version: 5.0.0
  • OpenSSL Version: 1.1.1h-dev
  • Boost Version: 1.67.0

CORE TEAM TASK LIST

  • Evaluate / Prioritize Bug Report
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
@xloem xloem changed the title Segfault [contains backtrace] Segfault [contains backtrace] [links to PR fix] Sep 28, 2020
@abitmore abitmore added the 3d Bug Classification indicating the existing implementation does not match the intention of the design label Sep 28, 2020
@abitmore abitmore added this to the 5.1.0 - Feature Release milestone Sep 28, 2020
@abitmore
Copy link
Member

TODO: bump FC to include bitshares/bitshares-fc#211.

@abitmore
Copy link
Member

Fixed by bitshares/bitshares-fc#211 and #2288.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3d Bug Classification indicating the existing implementation does not match the intention of the design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants