From b7b7ac19fd9e2afbf5aea4db5e3f318576e6809f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Dec 2017 09:39:22 +0100 Subject: executor: check format strings I see a crash which says: #0: too much cover 0 (errno 0) while the code is: uint64_t n = ...; if (n >= kCoverSize) fail("#%d: too much cover %u", th->id, n); It seems that the high part of n is set, but we don't see it. Add printf format attribute to fail and friends and fix all similar cases. Caught a bunch of similar cases and a missing argument in: exitf("opendir(%s) failed due to NOFILE, exiting"); --- executor/executor_linux.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'executor/executor_linux.cc') diff --git a/executor/executor_linux.cc b/executor/executor_linux.cc index 38ecf42f5..d66be92d2 100644 --- a/executor/executor_linux.cc +++ b/executor/executor_linux.cc @@ -262,9 +262,9 @@ uint64_t read_cover_size(thread_t* th) if (!flag_cover) return 0; uint64_t n = __atomic_load_n(th->cover_size_ptr, __ATOMIC_RELAXED); - debug("#%d: read cover size = %u\n", th->id, n); + debug("#%d: read cover size = %llu\n", th->id, n); if (n >= kCoverSize) - fail("#%d: too much cover %u", th->id, n); + fail("#%d: too much cover %llu", th->id, n); return n; } -- cgit mrf-deployment