From: Vladislav Shchapov Date: Thu, 23 Dec 2021 12:39:11 +0000 (+0500) Subject: [PATCH] Fix issue #687 (test_eh_thread) X-Git-Tag: archive/raspbian/2021.5.0-15+rpi1~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fb2ebcdd4546bc9852b4e699645dd38474189d16;p=onetbb.git [PATCH] Fix issue #687 (test_eh_thread) Signed-off-by: Vladislav Shchapov Gbp-Pq: Name 8f78aa096459b8ea0fcb54d2f0854f1889043f5d.patch --- diff --git a/test/tbb/test_eh_thread.cpp b/test/tbb/test_eh_thread.cpp index aa6d764..af291f4 100644 --- a/test/tbb/test_eh_thread.cpp +++ b/test/tbb/test_eh_thread.cpp @@ -36,6 +36,7 @@ // TODO: enable limitThreads with sanitizer under docker #if TBB_USE_EXCEPTIONS && !_WIN32 && !__ANDROID__ +#include #include #include #include @@ -73,7 +74,8 @@ public: mValid = false; pthread_attr_t attr; // Limit the stack size not to consume all virtual memory on 32 bit platforms. - if (pthread_attr_init(&attr) == 0 && pthread_attr_setstacksize(&attr, 100*1024) == 0) { + std::size_t stacksize = utils::max(128*1024, PTHREAD_STACK_MIN); + if (pthread_attr_init(&attr) == 0 && pthread_attr_setstacksize(&attr, stacksize) == 0) { mValid = pthread_create(&mHandle, &attr, thread_routine, /* arg = */ nullptr) == 0; } }