Merge pull request #4459
bcf3f6affuzz_tests: catch unhandled exceptions (moneromooo-monero)3ebd05d4miner: restore stream flags after changing them (moneromooo-monero)a093092elevin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)1eebb82bnet_helper: do not propagate exceptions through dtor (moneromooo-monero)fb6a3630miner: do not propagate exceptions through dtor (moneromooo-monero)2e2139ffepee: do not propagate exception through dtor (moneromooo-monero)0749a8bddb_lmdb: do not propagate exceptions in dtor (moneromooo-monero)1b0afeebwallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)418a9936unit_tests: catch unhandled exceptions (moneromooo-monero)ea7f9543threadpool: do not propagate exceptions through the dtor (moneromooo-monero)6e855422gen_multisig: nice exit on unhandled exception (moneromooo-monero)53df2debdb_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)e67016ddblockchain_blackball: catch failure to commit db transaction (moneromooo-monero)661439f4mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)5fdcda50easylogging++: test for NULL before dereference (moneromooo-monero)7ece1550performance_test: fix bad last argument calling add_arg (moneromooo-monero)a085da32unit_tests: add check for page size > 0 before dividing (moneromooo-monero)d8b1ec8bunit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)02563bf4simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)c57a65b2blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
This commit is contained in:
@@ -1145,7 +1145,10 @@ BlockchainLMDB::~BlockchainLMDB()
|
||||
|
||||
// batch transaction shouldn't be active at this point. If it is, consider it aborted.
|
||||
if (m_batch_active)
|
||||
batch_abort();
|
||||
{
|
||||
try { batch_abort(); }
|
||||
catch (...) { /* ignore */ }
|
||||
}
|
||||
if (m_open)
|
||||
close();
|
||||
}
|
||||
@@ -3589,7 +3592,9 @@ void BlockchainLMDB::migrate_0_1()
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for block_heights: ", result).c_str()));
|
||||
if (!i) {
|
||||
MDB_stat ms;
|
||||
mdb_stat(txn, m_block_heights, &ms);
|
||||
result = mdb_stat(txn, m_block_heights, &ms);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to query block_heights table: ", result).c_str()));
|
||||
i = ms.ms_entries;
|
||||
}
|
||||
}
|
||||
@@ -3692,7 +3697,9 @@ void BlockchainLMDB::migrate_0_1()
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for block_timestamps: ", result).c_str()));
|
||||
if (!i) {
|
||||
MDB_stat ms;
|
||||
mdb_stat(txn, m_block_info, &ms);
|
||||
result = mdb_stat(txn, m_block_info, &ms);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to query block_info table: ", result).c_str()));
|
||||
i = ms.ms_entries;
|
||||
}
|
||||
}
|
||||
@@ -3812,7 +3819,9 @@ void BlockchainLMDB::migrate_0_1()
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for spent_keys: ", result).c_str()));
|
||||
if (!i) {
|
||||
MDB_stat ms;
|
||||
mdb_stat(txn, m_hf_versions, &ms);
|
||||
result = mdb_stat(txn, m_hf_versions, &ms);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to query hf_versions table: ", result).c_str()));
|
||||
i = ms.ms_entries;
|
||||
}
|
||||
}
|
||||
@@ -3967,7 +3976,9 @@ void BlockchainLMDB::migrate_0_1()
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs: ", result).c_str()));
|
||||
if (!i) {
|
||||
MDB_stat ms;
|
||||
mdb_stat(txn, m_txs, &ms);
|
||||
result = mdb_stat(txn, m_txs, &ms);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to query txs table: ", result).c_str()));
|
||||
i = ms.ms_entries;
|
||||
if (i) {
|
||||
MDB_val_set(pk, "txblk");
|
||||
|
||||
@@ -401,7 +401,8 @@ static bool for_all_transactions(const std::string &filename, uint64_t &start_id
|
||||
}
|
||||
|
||||
mdb_cursor_close(cur);
|
||||
mdb_txn_commit(txn);
|
||||
dbr = mdb_txn_commit(txn);
|
||||
if (dbr) throw std::runtime_error("Failed to commit db transaction: " + std::string(mdb_strerror(dbr)));
|
||||
tx_active = false;
|
||||
mdb_dbi_close(env, dbi);
|
||||
mdb_env_close(env);
|
||||
@@ -471,7 +472,8 @@ static uint64_t find_first_diverging_transaction(const std::string &first_filena
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
mdb_cursor_close(cur[i]);
|
||||
mdb_txn_commit(txn[i]);
|
||||
dbr = mdb_txn_commit(txn[i]);
|
||||
if (dbr) throw std::runtime_error("Failed to query transaction: " + std::string(mdb_strerror(dbr)));
|
||||
tx_active[i] = false;
|
||||
mdb_dbi_close(env[i], dbi[i]);
|
||||
mdb_env_close(env[i]);
|
||||
@@ -675,7 +677,7 @@ static uint64_t get_ring_subset_instances(MDB_txn *txn, uint64_t amount, const s
|
||||
uint64_t extra = 0;
|
||||
std::vector<uint64_t> subset;
|
||||
subset.reserve(ring.size());
|
||||
for (uint64_t mask = 1; mask < (1u << ring.size()) - 1; ++mask)
|
||||
for (uint64_t mask = 1; mask < (((uint64_t)1) << ring.size()) - 1; ++mask)
|
||||
{
|
||||
subset.resize(0);
|
||||
for (size_t i = 0; i < ring.size(); ++i)
|
||||
|
||||
@@ -57,7 +57,8 @@ threadpool::~threadpool() {
|
||||
has_work.notify_all();
|
||||
}
|
||||
for (size_t i = 0; i<threads.size(); i++) {
|
||||
threads[i].join();
|
||||
try { threads[i].join(); }
|
||||
catch (...) { /* ignore */ }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,8 @@ namespace cryptonote
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
miner::~miner()
|
||||
{
|
||||
stop();
|
||||
try { stop(); }
|
||||
catch (...) { /* ignore */ }
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
bool miner::set_block_template(const block& bl, const difficulty_type& di, uint64_t height)
|
||||
@@ -198,8 +199,9 @@ namespace cryptonote
|
||||
{
|
||||
uint64_t total_hr = std::accumulate(m_last_hash_rates.begin(), m_last_hash_rates.end(), 0);
|
||||
float hr = static_cast<float>(total_hr)/static_cast<float>(m_last_hash_rates.size());
|
||||
const auto flags = std::cout.flags();
|
||||
const auto precision = std::cout.precision();
|
||||
std::cout << "hashrate: " << std::setprecision(4) << std::fixed << hr << precision << ENDL;
|
||||
std::cout << "hashrate: " << std::setprecision(4) << std::fixed << hr << flags << precision << ENDL;
|
||||
}
|
||||
}
|
||||
m_last_hr_merge_time = misc_utils::get_tick_count();
|
||||
|
||||
@@ -167,6 +167,8 @@ static bool generate_multisig(uint32_t threshold, uint32_t total, const std::str
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
TRY_ENTRY();
|
||||
|
||||
po::options_description desc_params(wallet_args::tr("Wallet options"));
|
||||
command_line::add_arg(desc_params, arg_filename_base);
|
||||
command_line::add_arg(desc_params, arg_scheme);
|
||||
@@ -254,5 +256,5 @@ int main(int argc, char* argv[])
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
//CATCH_ENTRY_L0("main", 1);
|
||||
CATCH_ENTRY_L0("main", 1);
|
||||
}
|
||||
|
||||
@@ -8073,6 +8073,8 @@ void simple_wallet::commit_or_save(std::vector<tools::wallet2::pending_tx>& ptx_
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
TRY_ENTRY();
|
||||
|
||||
#ifdef WIN32
|
||||
// Activate UTF-8 support for Boost filesystem classes on Windows
|
||||
std::locale::global(boost::locale::generator().generate(""));
|
||||
@@ -8167,5 +8169,5 @@ int main(int argc, char* argv[])
|
||||
w.deinit();
|
||||
}
|
||||
return 0;
|
||||
//CATCH_ENTRY_L0("main", 1);
|
||||
CATCH_ENTRY_L0("main", 1);
|
||||
}
|
||||
|
||||
@@ -3457,6 +3457,8 @@ public:
|
||||
std::string const t_executor::NAME = "Wallet RPC Daemon";
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
TRY_ENTRY();
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
const auto arg_wallet_file = wallet_args::arg_wallet_file();
|
||||
@@ -3500,4 +3502,5 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
return daemonizer::daemonize(argc, const_cast<const char**>(argv), t_executor{}, *vm) ? 0 : 1;
|
||||
CATCH_ENTRY_L0("main", 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user