Skip to content

Commit 39e1808

Browse files
fanquakesidhujag
authored and
sidhujag
committed
Merge bitcoin#16161: util: Fix compilation errors in support/lockedpool.cpp
30fb598 Fix segfault in allocator_tests/arena_tests (Jeffrey Czyz) 15c84f5 Define ARENA_DEBUG in Travis test runs (Jeffrey Czyz) ad71548 Fix compilation errors in support/lockedpool.cpp (Jeffrey Czyz) Pull request description: Changes in bitcoin#12048 cause a compilation error in Arena::walk() when ARENA_DEBUG is defined. Specifically, Arena's chunks_free map was changed to have a different value type. Additionally, missing includes cause other compilation errors when ARENA_DEBUG is defined. Reproduced with: make CPPFLAGS=-DARENA_DEBUG ACKs for top commit: laanwj: ACK 30fb598 fanquake: ACK 30fb598 - thanks for following up jkczyz. Tree-SHA512: 4eec368a4e9c67e4e2a27bc05608a807c2892d50c60d06ed21490cd274c0369f9671bc05b3006acc2a193316caf4896454c9c299603bfed29bd488f1987ec446
1 parent 86e4c92 commit 39e1808

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ci/test/00_setup_env_native_asan.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ export LC_ALL=C.UTF-8
99
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
1010
export NO_DEPENDS=1
1111
export GOAL="install"
12-
export SYSCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"
12+
export SYSCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"

ci/test/00_setup_env_native_tsan.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export DOCKER_NAME_TAG=ubuntu:16.04
1010
export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
1111
export NO_DEPENDS=1
1212
export GOAL="install"
13-
export SYSCOIN_CONFIG="--enable-zmq --disable-wallet --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"
13+
export SYSCOIN_CONFIG="--enable-zmq --disable-wallet --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"

src/support/lockedpool.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#endif
2424

2525
#include <algorithm>
26+
#ifdef ARENA_DEBUG
27+
#include <iomanip>
28+
#include <iostream>
29+
#endif
2630

2731
LockedPoolManager* LockedPoolManager::_instance = nullptr;
2832
std::once_flag LockedPoolManager::init_flag;
@@ -137,7 +141,7 @@ Arena::Stats Arena::stats() const
137141
}
138142

139143
#ifdef ARENA_DEBUG
140-
static void printchunk(char* base, size_t sz, bool used) {
144+
static void printchunk(void* base, size_t sz, bool used) {
141145
std::cout <<
142146
"0x" << std::hex << std::setw(16) << std::setfill('0') << base <<
143147
" 0x" << std::hex << std::setw(16) << std::setfill('0') << sz <<
@@ -149,7 +153,7 @@ void Arena::walk() const
149153
printchunk(chunk.first, chunk.second, true);
150154
std::cout << std::endl;
151155
for (const auto& chunk: chunks_free)
152-
printchunk(chunk.first, chunk.second, false);
156+
printchunk(chunk.first, chunk.second->first, false);
153157
std::cout << std::endl;
154158
}
155159
#endif

0 commit comments

Comments
 (0)