bitshares1-core icon indicating copy to clipboard operation
bitshares1-core copied to clipboard

Linux bitsharesGUI Segfault on Start

Open djthread opened this issue 11 years ago • 8 comments

I just grabbed bitsharesGUI-0.6.1-linux-x86_64.tar.gz, moved away ~/.BitShares and ~/.config/BitShares, and fired it up.

thread@mobius(0)~/a/bitsharesGUI-0.6.1-linux-x86_64> ./BitShares 
Could not start new instance listener. Attempting to remove defunct listener... Success.
Listening for new instances on /tmp/BitShares
242082ms th_a       thread.cpp:95                 thread               ] name:bitshares tid:140715206080256
244075ms th_a       MainWindow.cpp:999            loadWebUpdates       ] No web update package found.
244090ms th_a       ClientWrapper.cpp:136         initialize           ] config: {
  "logging": {
    "includes": [],
    "appenders": [{
        "name": "stderr",
        "type": "console",
        "args": {
          "stream": "std_error",
          "level_colors": [{
              "level": "debug",
              "color": "green"
            },{
              "level": "warn",
              "color": "brown"
            },{
              "level": "error",
              "color": "red"
            }
          ]
        },
        "enabled": true
      },{
        "name": "stdout",
        "type": "console",
        "args": {
          "stream": "std_out",
          "level_colors": [{
              "level": "debug",
              "color": "green"
            },{
              "level": "warn",
              "color": "brown"
            },{
              "level": "error",
              "color": "red"
            }
          ]
        },
        "enabled": true
      }
    ],
    "loggers": [{
        "name": "default",
        "parent": null,
        "level": "debug",
        "enabled": true,
        "additivity": false,
        "appenders": [
          "stderr"
        ]
      }
    ]
  },
  "ignore_console": false,
  "client_debug_name": "",
  "rpc": {
    "enable": false,
    "enable_cache": true,
    "rpc_user": "randomuser",
    "rpc_password": "108c****is this sensitive?****6f121",
    "rpc_endpoint": "127.0.0.1:0",
    "httpd_endpoint": "127.0.0.1:0",
    "encrypted_rpc_endpoint": "127.0.0.1:0",
    "encrypted_rpc_wif_key": "",
    "htdocs": "./htdocs"
  },
  "genesis_config": null,
  "statistics_enabled": false,
  "default_peers": [
    "46.226.109.66:1776",
    "54.77.51.177:1776",
    "54.79.27.224:1776",
    "61.129.33.213:1776",
    "84.238.140.192:42577",
    "85.214.53.224:1776",
    "95.85.33.16:8764",
    "104.131.35.149:1776",
    "106.185.26.162:1776",
    "178.62.50.61:1776",
    "178.62.50.61:1777",
    "178.62.50.61:1778",
    "178.62.50.61:1779",
    "178.62.157.161:1776",
    "180.153.142.120:1777",
    "185.25.22.21:1776",
    "188.226.195.137:60696"
  ],
  "maximum_number_of_connections": 200,
  "use_upnp": true,
  "chain_servers": [],
  "chain_server": {
    "enabled": false,
    "listen_port": 0
  },
  "wallet_enabled": true,
  "min_relay_fee": 10000,
  "wallet_callback_url": "",
  "light_network_fee": 10000,
  "light_relay_fee": 10000,
  "relay_account_name": "",
  "faucet_account_name": "",
  "growl_notify_endpoint": null,
  "growl_password": null,
  "growl_bitshares_client_identifier": null,
  "mail_client_enabled": false,
  "mail_server_enabled": false
}
244090ms th_a       ClientWrapper.cpp:139         initialize           ] Starting client with data-dir: /home/thread/.BitShares
Creating default config file at: /home/thread/.BitShares/config.json
Logging to file: /home/thread/.BitShares/logs/default/default.log
Logging RPC to file: /home/thread/.BitShares/logs/rpc/rpc.log
Logging blockchain to file: /home/thread/.BitShares/logs/blockchain/blockchain.log
Logging P2P to file: /home/thread/.BitShares/logs/p2p/p2p.log
Erasing all state
Initializing state from built-in genesis file
Successfully replayed 0 blocks in 1 seconds.                          
Blockchain size changed from 0MiB to 0MiB.
fish: Job 1, \u201c./BitShares \u201d terminated by signal SIGSEGV (Address boundary error)

djthread avatar Feb 10 '15 19:02 djthread

@djthread Can you run this in gdb and give us a stack trace of the crash?

vikramrajkumar avatar Feb 10 '15 19:02 vikramrajkumar

Cheers, Vikram. Thanks for looking at this.

Perhaps this is what you're looking for?

thread@mobius(0)~/a/bitsharesGUI-0.6.1-linux-x86_64> gdb ./BitShares 
GNU gdb (GDB) 7.8.2
Copyright (C) 2014 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-unknown-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 "apropos word" to search for commands related to "word"...
Reading symbols from ./BitShares...done.
(gdb) set pagination 0
(gdb) run
Starting program: /home/thread/apps/bitsharesGUI-0.6.1-linux-x86_64/BitShares 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe78b8700 (LWP 7693)]
Could not start new instance listener. Attempting to remove defunct listener... Success.
Listening for new instances on /tmp/BitShares
[New Thread 0x7fffe5382700 (LWP 7694)]
[New Thread 0x7fff9fffd700 (LWP 7695)]
2419024ms th_a       thread.cpp:95                 thread               ] name:bitshares tid:140735877732096
[New Thread 0x7fff97d9a700 (LWP 7697)]
[New Thread 0x7fff97599700 (LWP 7698)]
[New Thread 0x7fff96d98700 (LWP 7699)]
[New Thread 0x7fff96597700 (LWP 7700)]
[New Thread 0x7fff95b91700 (LWP 7701)]
2422205ms th_a       MainWindow.cpp:999            loadWebUpdates       ] No web update package found.
2422230ms th_a       ClientWrapper.cpp:136         initialize           ] config: {
  "logging": {
    "includes": [],
    "appenders": [{
        "name": "stderr",
        "type": "console",
        "args": {
          "stream": "std_error",
          "level_colors": [{
              "level": "debug",
              "color": "green"
            },{
              "level": "warn",
              "color": "brown"
            },{
              "level": "error",
              "color": "red"
            }
          ]
        },
        "enabled": true
      },{
        "name": "stdout",
        "type": "console",
        "args": {
          "stream": "std_out",
          "level_colors": [{
              "level": "debug",
              "color": "green"
            },{
              "level": "warn",
              "color": "brown"
            },{
              "level": "error",
              "color": "red"
            }
          ]
        },
        "enabled": true
      }
    ],
    "loggers": [{
        "name": "default",
        "parent": null,
        "level": "debug",
        "enabled": true,
        "additivity": false,
        "appenders": [
          "stderr"
        ]
      }
    ]
  },
  "ignore_console": false,
  "client_debug_name": "",
  "rpc": {
    "enable": false,
    "enable_cache": true,
    "rpc_user": "randomuser",
    "rpc_password": "***",
    "rpc_endpoint": "127.0.0.1:0",
    "httpd_endpoint": "127.0.0.1:0",
    "encrypted_rpc_endpoint": "127.0.0.1:0",
    "encrypted_rpc_wif_key": "",
    "htdocs": "./htdocs"
  },
  "genesis_config": null,
  "statistics_enabled": false,
  "default_peers": [
    "46.226.109.66:1776",
    "54.77.51.177:1776",
    "54.79.27.224:1776",
    "61.129.33.213:1776",
    "84.238.140.192:42577",
    "85.214.53.224:1776",
    "95.85.33.16:8764",
    "104.131.35.149:1776",
    "106.185.26.162:1776",
    "178.62.50.61:1776",
    "178.62.50.61:1777",
    "178.62.50.61:1778",
    "178.62.50.61:1779",
    "178.62.157.161:1776",
    "180.153.142.120:1777",
    "185.25.22.21:1776",
    "188.226.195.137:60696"
  ],
  "maximum_number_of_connections": 200,
  "use_upnp": true,
  "chain_servers": [],
  "chain_server": {
    "enabled": false,
    "listen_port": 0
  },
  "wallet_enabled": true,
  "min_relay_fee": 10000,
  "wallet_callback_url": "",
  "light_network_fee": 10000,
  "light_relay_fee": 10000,
  "relay_account_name": "",
  "faucet_account_name": "",
  "growl_notify_endpoint": null,
  "growl_password": null,
  "growl_bitshares_client_identifier": null,
  "mail_client_enabled": false,
  "mail_server_enabled": false
}
2422230ms th_a       ClientWrapper.cpp:139         initialize           ] Starting client with data-dir: /home/thread/.BitShares
Loading config from file: /home/thread/.BitShares/config.json
[New Thread 0x7fff94d0f700 (LWP 7705)]
[New Thread 0x7fff8ffff700 (LWP 7706)]
[New Thread 0x7fff8f7fe700 (LWP 7707)]
[New Thread 0x7fff8effd700 (LWP 7708)]
[New Thread 0x7fff8e7fc700 (LWP 7709)]
[New Thread 0x7fff8dffb700 (LWP 7710)]
[New Thread 0x7fff8d7fa700 (LWP 7711)]
Erasing all state
Initializing state from built-in genesis file
[New Thread 0x7fff6bfff700 (LWP 7734)]
Successfully replayed 0 blocks in 2 seconds.                          
Blockchain size changed from 0MiB to 0MiB.
[New Thread 0x7fff6b7fe700 (LWP 7735)]
[New Thread 0x7fff6affd700 (LWP 7736)]
[New Thread 0x7fff6a7fc700 (LWP 7737)]
[New Thread 0x7fff69ffb700 (LWP 7738)]
[New Thread 0x7fff697fa700 (LWP 7739)]
[New Thread 0x7fff68ff9700 (LWP 7740)]
[New Thread 0x7fff45dee700 (LWP 7741)]
[New Thread 0x7fff4377e700 (LWP 7743)]
[New Thread 0x7fff42f7d700 (LWP 7744)]
[New Thread 0x7fff4277c700 (LWP 7745)]
[New Thread 0x7fff41f7b700 (LWP 7746)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff2ee329a in __strcmp_sse2_unaligned () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff2ee329a in __strcmp_sse2_unaligned () from /usr/lib/libc.so.6
#1  0x00000000019a3b1d in lh_insert ()
#2  0x0000000001982977 in OBJ_NAME_add ()
#3  0x00007fff40ce1f97 in SSL_library_init () from /usr/lib/libssl.so.1.0.0
#4  0x00007ffff416a57e in ?? () from libQt5Network.so.5
#5  0x00007ffff416c4d9 in ?? () from libQt5Network.so.5
#6  0x00007ffff414e646 in QSslCertificate::QSslCertificate(QByteArray const&, QSsl::EncodingFormat) () from libQt5Network.so.5
#7  0x00007ffff4151167 in QSslConfiguration::QSslConfiguration() () from libQt5Network.so.5
#8  0x00007ffff40e4844 in ?? () from libQt5Network.so.5
#9  0x00007ffff40ee8b5 in ?? () from libQt5Network.so.5
#10 0x00007ffff40c0ec5 in QNetworkAccessManager::createRequest(QNetworkAccessManager::Operation, QNetworkRequest const&, QIODevice*) () from libQt5Network.so.5
#11 0x00007ffff40bdc84 in QNetworkAccessManager::get(QNetworkRequest const&) () from libQt5Network.so.5
#12 0x00007ffff59ad717 in ?? () from libQt5WebKit.so.5
#13 0x00007ffff59ad947 in ?? () from libQt5WebKit.so.5
#14 0x00007ffff59a89a8 in ?? () from libQt5WebKit.so.5
#15 0x00007ffff59aa3be in ?? () from libQt5WebKit.so.5
#16 0x00007ffff59a47ce in ?? () from libQt5WebKit.so.5
#17 0x00007ffff58d7da8 in ?? () from libQt5WebKit.so.5
#18 0x00007ffff57ad06a in ?? () from libQt5WebKit.so.5
#19 0x00007ffff57b2364 in ?? () from libQt5WebKit.so.5
#20 0x00007ffff57b27b6 in ?? () from libQt5WebKit.so.5
#21 0x00007ffff57617b5 in ?? () from libQt5WebKit.so.5
#22 0x00007ffff576f086 in ?? () from libQt5WebKit.so.5
#23 0x00007ffff5771055 in ?? () from libQt5WebKit.so.5
#24 0x00007ffff5778420 in ?? () from libQt5WebKit.so.5
#25 0x00007ffff578dc00 in ?? () from libQt5WebKit.so.5
#26 0x00007ffff578dc3d in ?? () from libQt5WebKit.so.5
#27 0x00007ffff57a08dc in ?? () from libQt5WebKit.so.5
#28 0x00007ffff57a50cd in ?? () from libQt5WebKit.so.5
#29 0x00007ffff5440e39 in ?? () from libQt5WebKit.so.5
#30 0x00007ffff57a6f22 in ?? () from libQt5WebKit.so.5
#31 0x00007ffff578e96e in ?? () from libQt5WebKit.so.5
#32 0x00007ffff578ed32 in ?? () from libQt5WebKit.so.5
#33 0x00007ffff578f0db in ?? () from libQt5WebKit.so.5
#34 0x00007ffff54538f1 in QWebFrameAdapter::load(QNetworkRequest const&, QNetworkAccessManager::Operation, QByteArray const&) () from libQt5WebKit.so.5
#35 0x00007ffff4d66f31 in QWebFrame::load(QUrl const&) () from libQt5WebKitWidgets.so.5
#36 0x000000000099ec20 in QtPrivate::QFunctorSlotObject<BitSharesApp::prepareStartupSequence(ClientWrapper*, Html5Viewer*, MainWindow*, QSplashScreen*)::{lambda()#3}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()
#37 0x00007ffff3c29035 in QMetaObject::activate(QObject*, int, int, void**) () from libQt5Core.so.5
#38 0x000000000097a11c in fc::detail::void_functor_run<ClientWrapper::initialize(ClientWrapper::INotifier*)::{lambda()#1}::operator()() const::{lambda()#9}>::run(void*, ClientWrapper::initialize(ClientWrapper::INotifier*)::{lambda()#1}::operator()() const::{lambda()#9}) ()
#39 0x00000000011eef45 in fc::task_base::run_impl() ()
#40 0x00000000011ed0df in fc::thread_d::process_tasks() ()
#41 0x00000000011ed331 in fc::thread_d::start_process_tasks(long) ()
#42 0x00000000019374ee in make_fcontext ()
#43 0x0000000002f9b4b0 in ?? ()
#44 0x0000000002f9b790 in ?? ()
#45 0x00007fff66b73350 in ?? ()
#46 0x0000000000000000 in ?? ()
(gdb) 

djthread avatar Feb 10 '15 19:02 djthread

@nathanhourt Any ideas on this?

vikramrajkumar avatar Feb 10 '15 19:02 vikramrajkumar

I did a trace of all threads, too. It's a bit unwieldy... the top bit went off my term buffer, even. I don't think that part is important, though.

http://threadbox.net/tmp/thread-apply-all-bt.txt

djthread avatar Feb 10 '15 19:02 djthread

Some Googling found a vaguely similar backtrace in another application on Mac, see https://bugreports.qt.io/browse/QTBUG-33113

but it looks like there is about ~50% chance that is a different Qt bug entirely.

I also found https://github.com/CESNET/canl-c/issues/7 -- apparently one OpenSSL user is having issues with crashes due to multiple calls to SSL_library_init() from multiple threads. I'm wondering if maybe SSL_library_init() is called by both qt main thread and some other thread. Maybe the Qt client's main() needs to call something that forces SSL_library_init() to happen before additional threads are created.

theoreticalbts avatar Feb 10 '15 20:02 theoreticalbts

@theoreticalbts That's an interesting find. If both Qt and FC are initializing OpenSSL, we may have problems.

Most likely this is caused by using https to fetch the manifest. If we bounce that fetch task back out to the main thread, it may circumvent this issue.

nathanielhourt avatar Feb 10 '15 20:02 nathanielhourt

Will assume addressed by https://github.com/BitShares/qt_wallet/compare/c28c0947e5...f941bc3a11 until we hear otherwise.

vikramrajkumar avatar Apr 21 '15 20:04 vikramrajkumar

Still happening: https://github.com/BitShares/bitshares/issues/1519#issuecomment-96797237

vikramrajkumar avatar Apr 28 '15 14:04 vikramrajkumar