Because of a glibc bug, PTHREAD_STACK_MIN can be too small for any
thread. Especially on Intel machines with AVX, as reported in
Debian bug #900746.
In recent Xen this is worked around more comprehensively in:
448c03b3cbe1487
tools/xenstore: try to get minimum thread stack size for watch thread
but this is not a good candidate for an upstream stable
backport because it introduces new linking dependencies etc.
So bodge it by doubling the size. This is almost entirely risk-free.
Even if in theory someone might be using libxenstore in a very highly
multithreaded program, we only steal one extra 16k of address space.
Closes: #900746
Reported-by: Christian Schwamborn <christian.schwamborn@nswit.de>
Suggested-by: Damian Pietras <damianp@daper.net>
Tested-by: Damian Pietras <damianp@daper.net>
Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
Gbp-Pq: Name 0033-xenstore-Increase-stack-size-for-xs-reader-thread.patch
struct iovec iov[2];
#ifdef USE_PTHREAD
-#define DEFAULT_THREAD_STACKSIZE (16 * 1024)
+#define DEFAULT_THREAD_STACKSIZE (32 * 1024)
#define READ_THREAD_STACKSIZE \
((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ? \
PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE)
struct iovec iov[2];
#ifdef USE_PTHREAD
-#define DEFAULT_THREAD_STACKSIZE (16 * 1024)
+#define DEFAULT_THREAD_STACKSIZE (32 * 1024)
#define READ_THREAD_STACKSIZE \
((DEFAULT_THREAD_STACKSIZE < PTHREAD_STACK_MIN) ? \
PTHREAD_STACK_MIN : DEFAULT_THREAD_STACKSIZE)