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/common_bsd.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'executor/common_bsd.h') diff --git a/executor/common_bsd.h b/executor/common_bsd.h index a9c4933db..ff450f94a 100644 --- a/executor/common_bsd.h +++ b/executor/common_bsd.h @@ -51,13 +51,11 @@ static void segv_handler(int sig, siginfo_t* info, void* uctx) const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; if (__atomic_load_n(&skip_segv, __ATOMIC_RELAXED) && (addr < prog_start || addr > prog_end)) { - debug("SIGSEGV on %p, skipping\n", addr); + debug("SIGSEGV on %p, skipping\n", (void*)addr); _longjmp(segv_env, 1); } - debug("SIGSEGV on %p, exiting\n", addr); + debug("SIGSEGV on %p, exiting\n", (void*)addr); doexit(sig); - for (;;) { - } } static void install_segv_handler() -- cgit mrf-deployment