Commit Graph
100 Commits
Author SHA1 Message Date
practicalswift e4f4ea47eb lint: Catch use of [] or {} as default parameter values in Python functions 2019-08-26 10:53:10 +00:00
practicalswift 25dd867150 Avoid using mutable default parameter values 2019-08-26 10:45:25 +00:00
practicalswift 37f2784952 tests: Use colors and dots in test_runner.py output only if standard output is a terminal -- allows for using the test runner output as input to other programs 2019-08-15 09:52:28 +00:00
practicalswift 0c78e49be3 tests: Switch one of the Travis jobs to an unsigned char environment (-funsigned-char) 2019-06-26 21:16:15 +02:00
practicalswift 9a841696c1 tests: Reduce compilation time and unneccessary recompiles by removing unused includes in tests 2019-06-26 20:37:48 +02:00
practicalswift c4606b8432 Add Travis check for single parameter constructors not marked "explicit" 2019-06-26 16:57:14 +02:00
practicalswift f8995807e4 tests: Make coins_tests/updatecoins_simulation_test deterministic 2019-06-17 19:13:30 +02:00
practicalswift d9753383b9 addrdb: Remove temporary files created in SerializeFileDB. Fixes non-determinism in unit tests. 2019-06-14 08:30:43 +02:00
practicalswift 67f4e9c522 Include core_io.h from core_read.cpp 2019-06-06 08:00:33 +02:00
practicalswift 0959d37e3e Don't use global (external) symbols for symbols that are used in only one translation unit 2019-06-06 07:45:56 +02:00
practicalswift c061be1e2f tests: Mark unit test blockfilter_index_initial_sync as non-deterministic 2019-06-04 12:28:04 +02:00
practicalswift eca9767673 Make reasoning about dependencies easier by not including unused dependencies 2019-06-02 17:15:23 +02:00
practicalswift 3c5254a820 Limit Python linting to files in the repo 2019-05-30 22:36:54 +02:00
practicalswift fb434159d1 Remove global symbols: Avoid using the global namespace if possible
Rename CCriticalSection to RecursiveMutex (both are AnnotatedMixin<std::recursive_mutex>)

```
$ git grep -E '(typedef|using).*(CCriticalSection|RecursiveMutex)'
src/sync.h:using RecursiveMutex = AnnotatedMixin<std::recursive_mutex>;
src/sync.h:typedef AnnotatedMixin<std::recursive_mutex> CCriticalSection;
```
2019-05-25 23:23:11 +02:00
practicalswift 9f85e9cb3d scripted-diff: Rename LockAnnotation to LockAssertion
-BEGIN VERIFY SCRIPT-
git grep -l LockAnnotation | xargs sed -i 's/LockAnnotation/LockAssertion/'
-END VERIFY SCRIPT-
2019-05-17 13:29:04 +02:00
practicalswift de9b5dbca3 Make sure the compile-time locking promises given via LockAnnotation:s hold also in practice at runtime (ifdef DEBUG_LOCKORDER) 2019-05-17 13:29:04 +02:00
practicalswift 3a809446b3 Move LockAnnotation to make it reflect the truth 2019-05-17 13:29:04 +02:00
practicalswift cc2588579c Move LockAnnotation from threadsafety.h (imported code) to sync.h (our code) 2019-05-17 13:29:04 +02:00
practicalswift 9402ef0739 Remove temporary method assumeLocked(). Remove LockingStateImpl. Remove redundant cs_main locks. 2019-05-16 21:43:22 +02:00
practicalswift 593a8e8a2c wallet: Use chain.lock() instead of temporary chain.assumeLocked() 2019-05-16 21:42:34 +02:00
practicalswift 1609809fb2 validation: Hold cs_main when reading chainActive in RewindBlockIndex 2019-05-15 14:58:15 +02:00
practicalswift 62d50ef308 Add LOCKS_EXCLUDED(cs_main) to LimitValidationInterfaceQueue(...) which does AssertLockNotHeld(cs_main)
Add LOCKS_EXCLUDED(cs_main) to functions calling LimitValidationInterfaceQueue(...) which does AssertLockNotHeld(cs_main)

Add LOCKS_EXCLUDED(cs_main) to functions calling CChainState::InvalidateBlock(...) which calls LimitValidationInterfaceQueue(...) which in turn does AssertLockNotHeld(cs_main)

Add LOCKS_EXCLUDED(cs_main) to functions calling CChainState::RewindBlockIndex(...) which calls LimitValidationInterfaceQueue(...) which in turn does AssertLockNotHeld(cs_main)
2019-05-08 10:31:54 +02:00
practicalswift beb42d71a0 Silence GCC 7 warning "control reaches end of non-void function" (-Wreturn-type) in psbt.cpp 2019-05-02 15:08:22 +02:00
practicalswift a34081b7c3 Remove unused OpenSSL includes to make it more clear where OpenSSL is used 2019-04-29 12:53:24 +02:00
practicalswift 6dd469a3be Disconnect BlockNotifyGenesisWait and RPCNotifyBlockChange properly. Remove no-op CClientUIInterface::[signal_name]_disconnect. 2019-03-29 19:34:53 +01:00
practicalswift 0aef39d067 Silence "Test case [...] did not check any assertions" warnings when running "test_bitcoin --log_level=test_suite" 2019-03-29 15:31:48 +01:00
practicalswift 5fd73c8694 Avoid repeated log messages in tests by connecting to signal handlers (ThreadSafeMessageBox, etc.) only once 2019-03-29 15:14:35 +01:00
practicalswift e502c3c515 tests: Reduce noise level in test_bitcoin output 2019-03-29 15:14:09 +01:00
practicalswift f6ee177f7d Remove unused AES-128 code 2019-03-25 14:46:30 +01:00
practicalswift bb6195e34d refactor: Remove unused function 2019-03-20 10:51:15 +01:00
practicalswift c7a7250302 Document assumptions about C++ compiler 2019-03-05 11:19:32 +01:00
practicalswift 82c3b3f8e0 Remove sharp edge (uninitialized m_filter_type) when using the compiler-generated constructor for BlockFilter 2019-03-05 09:08:04 +01:00
practicalswift c7ea8d3236 Add sizeof(size_t) assumptions 2019-03-04 14:15:58 +01:00
practicalswift 543ef7d626 tests: Add missing cs_main locks required when accessing pcoinsdbview, pcoinsTip or pblocktree 2019-02-15 10:41:52 +01:00
practicalswift 43206239a8 tests: Add script checking for deterministic line coverage 2019-02-15 09:38:07 +01:00
practicalswift 7cee85807c Add compile time verification of assumptions we're currently making implicitly/tacitly 2019-02-14 16:10:02 +01:00
practicalswift d855e4cac8 Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...) 2019-02-07 22:30:25 +01:00
practicalswift ef0b01217a tests: Make updatecoins_simulation_test deterministic 2019-02-03 10:34:22 +01:00
practicalswift fa2a69fcb9 doc: Add cs_main lock annotations for mapBlockIndex 2019-02-01 15:32:16 -05:00
practicalswift eea02be70e Add locking annotation for vNodes. vNodes is guarded by cs_vNodes. 2019-01-19 18:23:53 +01:00
practicalswift a517541794 Remove no longer needed shellcheck suppressions 2019-01-16 15:47:56 +01:00
practicalswift 0b7196ecad Fix warnings introduced in shellcheck v0.6.0 2019-01-16 15:47:56 +01:00
practicalswift 07a53dce9f Remove repeated suppression. Fix indentation. 2019-01-16 15:47:56 +01:00
practicalswift 638e53b472 Pin shellcheck version to v0.6.0 2019-01-16 15:47:56 +01:00
practicalswift b9dafe7d9f Fix remaining compiler warnings (MSVC). Move disabling of specific warnings from /nowarn to project file. 2019-01-15 20:15:26 +01:00
practicalswift 9096276e0b Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)
Qt-only changes.
2019-01-13 03:25:14 -08:00
practicalswift ca126d490b Fix out-of-bounds write in case of failing mmap(...) in PosixLockedPageAllocator::AllocateLocked 2019-01-06 17:45:53 +01:00
practicalswift 6c10037f72 rpc: Fix data race (UB) in InterruptRPC() 2018-12-18 18:52:12 +01:00
practicalswift eaf4070e3a Add suppression for InterruptRPC (fRPCRunning) data race 2018-12-18 09:33:02 +01:00
practicalswift 069752b726 build: Enable functional tests in the ThreadSanitizer (TSan) build job 2018-12-17 09:24:37 +01:00
practicalswift d98a29ec40 Fix cuckoocache_tests TSAN failure introduced in #14935. Fixes #14967. 2018-12-15 16:14:36 +01:00
practicalswift 4de11a3682 Remove Python 2 import workarounds 2018-12-13 16:46:31 +01:00
practicalswift c84c2b8c92 tests: Test for expected return values when calling functions returning a success code 2018-12-13 09:37:23 +01:00
practicalswift 8931a95bec Include util/strencodings.h which is required for IsSpace(...) 2018-12-06 12:12:15 +01:00
practicalswift cf4b0327ed Use std::numeric_limits<UNSIGNED>::max()) instead of (UNSIGNED)-1 2018-12-04 19:55:04 +02:00
practicalswift dae1423e5a Add locking annotations to feeStats, shortStats and longStats 2018-12-03 00:14:33 +01:00
practicalswift 764e42fee2 scripted-diff: Rename from cs_feeEstimator to m_cs_fee_estimator
-BEGIN VERIFY SCRIPT-
sed -i 's/cs_feeEstimator/m_cs_fee_estimator/' src/policy/fees.cpp src/policy/fees.h
-END VERIFY SCRIPT-
2018-12-02 21:18:04 +01:00
practicalswift 9a789d4dc6 policy: Add Clang thread safety annotations for variables guarded by cs_feeEstimator 2018-12-02 21:18:04 +01:00
practicalswift 4894133dc5 Add missing lock in CNode::copyStats(...) 2018-11-28 09:36:25 +01:00
practicalswift b312cd7707 Add missing locking annotations 2018-11-28 09:36:25 +01:00
practicalswift 6541d59ddc Add LSan suppression warnings 2018-11-26 23:33:17 +01:00
practicalswift ff7212ec32 Add ASan Travis build 2018-11-26 22:20:46 +01:00
practicalswift ebd3bf2590 Make test p2p_invalid_messages.py pass: Allow for expected Travis ASAN memory increase 2018-11-26 22:20:46 +01:00
practicalswift 4f4993fe2a Remove UBSan suppression 2018-11-23 16:58:44 +01:00
practicalswift 958e1a307e streams: Remove unused seek(size_t) 2018-11-23 16:58:44 +01:00
practicalswift c82190cdb6 tests: Add Python dead code linter (vulture) 2018-11-07 18:09:14 +01:00
practicalswift 590a57fdec tests: Remove unused testing code 2018-11-07 18:07:49 +01:00
practicalswift 4773fa8207 Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers. 2018-11-06 17:45:54 +01:00
practicalswift 7c9f790761 Update KNOWN_VIOLATIONS: Remove fixed violations 2018-11-06 17:32:33 +01:00
practicalswift 587924f000 Use IsSpace(...) instead of boost::is_space 2018-11-06 17:32:13 +01:00
practicalswift c5fd143edb Use ToLower(...) instead of std::tolower 2018-11-06 17:32:13 +01:00
practicalswift e70cc8983c Use IsDigit(...) instead of std::isdigit 2018-11-06 17:32:08 +01:00
practicalswift 5c292dafcd Add UBSan suppressions needed to pass test suite 2018-11-06 14:07:18 +01:00
practicalswift fced6b5086 Add UBSan options: print_stacktrace + halt_on_error 2018-11-06 10:25:00 +01:00
practicalswift 9f49db7335 Enable functional tests in UBSAN job. Enable -fsanitize=integer (part of UBSAN). Merge UBSAN Travis job with no depends. 2018-11-05 20:04:02 +01:00
practicalswift 9cc0230cfc Add NODISCARD to all {Decode,Parse}[...](...) functions returning bool. Sort includes. 2018-11-05 17:03:11 +01:00
practicalswift 579497e77a tests: Explicitly ignore the return value of DecodeBase58(...) 2018-11-05 16:52:59 +01:00
practicalswift 145fe95ec7 tests: Check return value of ParseParameters(...) 2018-11-05 16:52:59 +01:00
practicalswift 7c5bc2a523 miner: Default to DEFAULT_BLOCK_MIN_TX_FEE if unable to parse -blockmintxfee 2018-11-05 16:52:59 +01:00
practicalswift ab8c6f24d2 Add SAFE_CHARS[SAFE_CHARS_URI]: Chars allowed in URIs (RFC 3986) 2018-11-05 13:27:04 +01:00
practicalswift 991248649b rpc: Make HTTP RPC debug logging more informative 2018-11-05 13:27:02 +01:00
practicalswift 15db77f4dd Don't rely on locale dependent functions in base_blob<BITS>::SetHex(...) (uint256), DecodeBase58(...), ParseMoney(...) and ParseHex(...) 2018-10-26 19:42:58 +02:00
practicalswift bc60c615a5 Avoid 1 << 31 (UB) in calculation of SEQUENCE_LOCKTIME_DISABLE_FLAG 2018-10-18 23:14:20 +02:00
practicalswift 96f6dc9fc5 Avoid triggering undefined behaviour in base_uint<BITS>::bits() 2018-10-18 11:17:05 +02:00
practicalswift ee0b7c4e8a build: Pin to specific versions of Python packages we install from PyPI in Travis 2018-10-16 13:48:16 +02:00
practicalswift c32cf6a0f2 Add ignored word: mut 2018-10-16 13:34:10 +02:00
practicalswift 4ae50daaa7 Revert "qa: Fix codespell error and have lint-spelling error instead of warn"
This reverts commit e413c2ddd1.
2018-10-16 13:33:05 +02:00
practicalswift 0089905361 Add compile time checking for cs_main locks which we assert at run time 2018-10-10 11:28:43 +02:00
practicalswift 69e7ee2dd8 Add GUARDED_BY(cs_wallet) for setExternalKeyPool, mapKeyMetadata, m_script_metadata and setLockedCoins 2018-10-09 15:04:26 +02:00
practicalswift 37b2538c2d Add GUARDED_BY(cs_wallet) for encrypted_batch, nWalletMaxVersion, m_max_keypool_index and nOrderPosNext
* AddKeyPubKeyWithDB(...) reads encrypted_batch which potentially races with write in the same method.
* IncOrderPosNext(...) reads nOrderPosNext which potentially races with write in BlockDisconnected(...).
* LoadKeyPool(...) reads m_max_keypool_index which potentially races with write in BlockDisconnected(...).
* LoadMinVersion(...) reads nWalletMaxVersion which potentially races with write in BlockDisconnected(...).
2018-10-09 12:12:27 +02:00
practicalswift dee42927c9 wallet: Add Clang thread safety analysis annotations 2018-10-09 11:58:32 +02:00
practicalswift 1c7e25db0c wallet: Add missing locks 2018-10-09 11:58:32 +02:00
practicalswift 3e9f6c821b Add missing locks and locking annotations for CAddrMan 2018-10-08 17:19:25 +02:00
practicalswift ff94da7887 tests: Make appveyor run with --usecli 2018-10-03 11:36:54 +02:00
practicalswift db01839361 test: Add missing call to skip_if_no_cli() 2018-10-03 10:10:35 +02:00
practicalswift 97ddc6026b validation: Pass chainparams in AcceptToMemoryPoolWorker(...) 2018-09-24 16:03:06 +02:00
practicalswift ba923e32a0 test: Fix broken segwit test 2018-09-23 22:03:38 +02:00
practicalswift b6718e373e tests: Use MakeUnique to construct objects owned by unique_ptrs 2018-09-21 11:03:21 +02:00
practicalswift a23a7f60aa wallet: Avoid potential use of unitialized value bnb_used in CWallet::CreateTransaction(...) 2018-09-19 14:11:14 +02:00
practicalswift f8a81f73ac lint: Add spell check linter (codespell) 2018-09-04 13:11:26 +02:00