]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/mtasker.cc
rec: Allocate one more stack byte to make _GLIBCXX_ASSERTIONS happy
[thirdparty/pdns.git] / pdns / mtasker.cc
index 9fcb7d31f2dd6fd5dc58447c6a8611c2ba3caf49..16027b61011f488f82a238e08b9635fa74727a20 100644 (file)
@@ -268,10 +268,10 @@ template<class Key, class Val>void MTasker<Key,Val>::makeThread(tfunc_t *start,
   auto uc=std::make_shared<pdns_ucontext_t>();
   
   uc->uc_link = &d_kernel; // come back to kernel after dying
-  uc->uc_stack.resize (d_stacksize);
+  uc->uc_stack.resize (d_stacksize+1);
 #ifdef PDNS_USE_VALGRIND
   uc->valgrind_id = VALGRIND_STACK_REGISTER(&uc->uc_stack[0],
-                                            &uc->uc_stack[uc->uc_stack.size()]);
+                                            &uc->uc_stack[uc->uc_stack.size()-1]);
 #endif /* PDNS_USE_VALGRIND */
 
   auto& thread = d_threads[d_maxtid];