[Libreoffice-commits] core.git: sal/osl
Michael Stahl
mstahl at redhat.com
Wed Sep 10 23:33:35 PDT 2014
sal/osl/unx/thread.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit f49abb2ab3349d4c9956142e835b7f8bb5734692
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Sep 10 22:07:23 2014 +0200
sal: create threads on Linux with a larger stack for ASAN
The default on Fedora 20 is 8MB, which causes stack overflows from
CPython code in some of the JunitTests when built with clang 3.4
-fsanitize=address.
Change-Id: I3de9975564aad668e746cea74ae10931ef36a608
Signed-off-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index 17b4d6c..1c703ca 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -252,7 +252,7 @@ static oslThread osl_thread_create_Impl (
short nFlags)
{
Thread_Impl* pImpl;
-#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
+#if defined OPENBSD || ((defined MACOSX || defined LINUX) && !ENABLE_RUNTIME_OPTIMIZATIONS)
pthread_attr_t attr;
size_t stacksize;
#endif
@@ -268,12 +268,14 @@ static oslThread osl_thread_create_Impl (
pthread_mutex_lock (&(pImpl->m_Lock));
-#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
+#if defined OPENBSD || ((defined MACOSX || defined LINUX) && !ENABLE_RUNTIME_OPTIMIZATIONS)
if (pthread_attr_init(&attr) != 0)
return (0);
#if defined OPENBSD
stacksize = 262144;
+#elif defined LINUX
+ stacksize = 12 * 1024 * 1024; // 8MB is not enough for ASAN on x86-64
#else
stacksize = 100 * PTHREAD_STACK_MIN;
#endif
@@ -285,7 +287,7 @@ static oslThread osl_thread_create_Impl (
if ((nRet = pthread_create (
&(pImpl->m_hThread),
-#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
+#if defined OPENBSD || ((defined MACOSX || defined LINUX) && !ENABLE_RUNTIME_OPTIMIZATIONS)
&attr,
#else
PTHREAD_ATTR_DEFAULT,
@@ -302,7 +304,7 @@ static oslThread osl_thread_create_Impl (
return (0);
}
-#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
+#if defined OPENBSD || ((defined MACOSX || defined LINUX) && !ENABLE_RUNTIME_OPTIMIZATIONS)
pthread_attr_destroy(&attr);
#endif
More information about the Libreoffice-commits
mailing list