Commit 5ba28583 authored by Kenton Varda's avatar Kenton Varda

Fix valgrind errors.

parent 98113bf5
...@@ -782,8 +782,10 @@ public: ...@@ -782,8 +782,10 @@ public:
} }
private: private:
SocketAddress(): addrlen(0) { SocketAddress() {
memset(&addr, 0, sizeof(addr)); // We need to memset the whole object 0 otherwise Valgrind gets unhappy when we write it to a
// pipe, due to the padding bytes being uninitialized.
memset(this, 0, sizeof(*this));
} }
socklen_t addrlen; socklen_t addrlen;
......
...@@ -809,7 +809,7 @@ const InsertionOrderIndex::Link InsertionOrderIndex::EMPTY_LINK = { 0, 0 }; ...@@ -809,7 +809,7 @@ const InsertionOrderIndex::Link InsertionOrderIndex::EMPTY_LINK = { 0, 0 };
InsertionOrderIndex::InsertionOrderIndex(): capacity(0), links(const_cast<Link*>(&EMPTY_LINK)) {} InsertionOrderIndex::InsertionOrderIndex(): capacity(0), links(const_cast<Link*>(&EMPTY_LINK)) {}
InsertionOrderIndex::~InsertionOrderIndex() noexcept(false) { InsertionOrderIndex::~InsertionOrderIndex() noexcept(false) {
if (links != &EMPTY_LINK) delete links; if (links != &EMPTY_LINK) delete[] links;
} }
void InsertionOrderIndex::reserve(size_t size) { void InsertionOrderIndex::reserve(size_t size) {
......
...@@ -516,7 +516,7 @@ if [ "x`uname`" != xDarwin ] && which valgrind > /dev/null; then ...@@ -516,7 +516,7 @@ if [ "x`uname`" != xDarwin ] && which valgrind > /dev/null; then
# Running the fuzz tests under Valgrind is a great thing to do -- but it takes # Running the fuzz tests under Valgrind is a great thing to do -- but it takes
# some 40 minutes. So, it needs to be done as a separate step of the release # some 40 minutes. So, it needs to be done as a separate step of the release
# process, perhaps along with the AFL tests. # process, perhaps along with the AFL tests.
CAPNP_SKIP_FUZZ_TEST=1 doit valgrind --leak-check=full --track-fds=yes --error-exitcode=1 ./capnp-test CAPNP_SKIP_FUZZ_TEST=1 doit valgrind --leak-check=full --track-fds=yes --error-exitcode=1 --child-silent-after-fork=yes --sim-hints=lax-ioctls ./capnp-test
fi fi
doit make maintainer-clean doit make maintainer-clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment