From b90ec71deb791bd936bef30b4a474f6a04ffdf04 Mon Sep 17 00:00:00 2001 From: Jonathan Giszczak Date: Mon, 25 Feb 2019 12:45:38 -0600 Subject: [PATCH 1/2] GCC defect fixes. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66297 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 --- libraries/chain/controller.cpp | 2 +- plugins/net_plugin/net_plugin.cpp | 2 +- plugins/state_history_plugin/state_history_plugin.cpp | 4 ++-- plugins/wallet_plugin/yubihsm_wallet.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 20f5478a079..677f7a0ab41 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -206,7 +206,7 @@ struct controller_impl { SET_APP_HANDLER( eosio, eosio, canceldelay ); fork_db.irreversible.connect( [&]( auto b ) { - on_irreversible(b); + this->on_irreversible(b); // gcc defect https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 }); } diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index bf14a2bc040..e4adc0dd6ac 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -686,7 +686,7 @@ namespace eosio { chain_plugin* chain_plug = nullptr; - constexpr auto stage_str(stages s ); + constexpr static auto stage_str(stages s); public: explicit sync_manager(uint32_t span); diff --git a/plugins/state_history_plugin/state_history_plugin.cpp b/plugins/state_history_plugin/state_history_plugin.cpp index 49c47041e3d..cc238618079 100644 --- a/plugins/state_history_plugin/state_history_plugin.cpp +++ b/plugins/state_history_plugin/state_history_plugin.cpp @@ -320,7 +320,7 @@ struct state_history_plugin_impl : std::enable_shared_from_thisdo_accept(); }); // gcc defect https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 return; } catch_and_log([&] { @@ -328,7 +328,7 @@ struct state_history_plugin_impl : std::enable_shared_from_thisstart(std::move(*socket)); }); - catch_and_log([&] { do_accept(); }); + catch_and_log([&] { this->do_accept(); }); }); } diff --git a/plugins/wallet_plugin/yubihsm_wallet.cpp b/plugins/wallet_plugin/yubihsm_wallet.cpp index 5676089c0e1..ff562006e53 100644 --- a/plugins/wallet_plugin/yubihsm_wallet.cpp +++ b/plugins/wallet_plugin/yubihsm_wallet.cpp @@ -133,9 +133,9 @@ struct yubihsm_wallet_impl { yh_cmd resp_cmd; size_t resp_sz = 1; if(yh_send_secure_msg(session, YHC_ECHO, &data, 1, &resp_cmd, &resp, &resp_sz)) - lock(); + this->lock(); // gcc defect https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 else - prime_keepalive_timer(); + this->prime_keepalive_timer(); }); } @@ -269,4 +269,4 @@ optional yubihsm_wallet::try_sign_digest(const digest_type diges return my->try_sign_digest(digest, public_key); } -}} \ No newline at end of file +}} From c3d63f1c5c0ce68e37f86cd06af36664d0f6c1b7 Mon Sep 17 00:00:00 2001 From: Jonathan Giszczak Date: Tue, 26 Feb 2019 12:19:56 -0600 Subject: [PATCH 2/2] Work around GCC defect 67274 without explicit this pointers. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 --- libraries/chain/controller.cpp | 4 ++-- plugins/state_history_plugin/state_history_plugin.cpp | 6 +++--- plugins/wallet_plugin/yubihsm_wallet.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 677f7a0ab41..77c0504de13 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -205,8 +205,8 @@ struct controller_impl { SET_APP_HANDLER( eosio, eosio, canceldelay ); - fork_db.irreversible.connect( [&]( auto b ) { - this->on_irreversible(b); // gcc defect https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 + fork_db.irreversible.connect( [&]( const block_state_ptr& b ) { + on_irreversible(b); }); } diff --git a/plugins/state_history_plugin/state_history_plugin.cpp b/plugins/state_history_plugin/state_history_plugin.cpp index cc238618079..0df317198d7 100644 --- a/plugins/state_history_plugin/state_history_plugin.cpp +++ b/plugins/state_history_plugin/state_history_plugin.cpp @@ -315,12 +315,12 @@ struct state_history_plugin_impl : std::enable_shared_from_this(app().get_io_service()); - acceptor->async_accept(*socket, [self = shared_from_this(), socket, this](auto ec) { + acceptor->async_accept(*socket, [self = shared_from_this(), socket, this](const boost::system::error_code& ec) { if (stopping) return; if (ec) { if (ec == boost::system::errc::too_many_files_open) - catch_and_log([&] { this->do_accept(); }); // gcc defect https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 + catch_and_log([&] { do_accept(); }); return; } catch_and_log([&] { @@ -328,7 +328,7 @@ struct state_history_plugin_impl : std::enable_shared_from_thisstart(std::move(*socket)); }); - catch_and_log([&] { this->do_accept(); }); + catch_and_log([&] { do_accept(); }); }); } diff --git a/plugins/wallet_plugin/yubihsm_wallet.cpp b/plugins/wallet_plugin/yubihsm_wallet.cpp index ff562006e53..cda0d208333 100644 --- a/plugins/wallet_plugin/yubihsm_wallet.cpp +++ b/plugins/wallet_plugin/yubihsm_wallet.cpp @@ -125,7 +125,7 @@ struct yubihsm_wallet_impl { void prime_keepalive_timer() { keepalive_timer.expires_at(std::chrono::steady_clock::now() + std::chrono::seconds(20)); - keepalive_timer.async_wait([this](auto ec){ + keepalive_timer.async_wait([this](const boost::system::error_code& ec){ if(ec || !session) return; @@ -133,9 +133,9 @@ struct yubihsm_wallet_impl { yh_cmd resp_cmd; size_t resp_sz = 1; if(yh_send_secure_msg(session, YHC_ECHO, &data, 1, &resp_cmd, &resp, &resp_sz)) - this->lock(); // gcc defect https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 + lock(); else - this->prime_keepalive_timer(); + prime_keepalive_timer(); }); }