From 2c8244caae9ee292bf66aec2745ed7d5d269aafe Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 5 Jan 2016 19:01:01 +0100 Subject: [PATCH] Make sure the DelayPipe thread is the last member initialized Otherwise the new thread might start running and access uninitialized members like d_pipe or d_work. On my host, running dnsdist in gdb without this modification results in a SIGSEGV at delaypipe.cc:141. --- pdns/delaypipe.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/delaypipe.hh b/pdns/delaypipe.hh index 68e6265be2..7f7e02a382 100644 --- a/pdns/delaypipe.hh +++ b/pdns/delaypipe.hh @@ -38,7 +38,6 @@ public: void submit(T& t, int msec); //!< don't try for more than 4294 msec private: - std::thread d_thread; void worker(); struct Combo { @@ -60,6 +59,7 @@ private: }; std::multimap d_work; void gettime(struct timespec* ts); + std::thread d_thread; }; #include "delaypipe.cc" -- 2.47.2