From: Ian Jackson Date: Fri, 22 Feb 2019 13:38:13 +0000 (+0000) Subject: xenstore: Increase stack size for xs reader thread X-Git-Tag: archive/raspbian/4.8.5.final+shim4.10.4-1+deb9u12+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ea35fe81094d54e4d274b2219cdec7f0ed60d84d;p=xen.git xenstore: Increase stack size for xs reader thread 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 Suggested-by: Damian Pietras Tested-by: Damian Pietras Signed-off-by: Ian Jackson Gbp-Pq: Name 0033-xenstore-Increase-stack-size-for-xs-reader-thread.patch --- diff --git a/shim/tools/xenstore/xs.c b/shim/tools/xenstore/xs.c index abffd9cd80..3891e4907c 100644 --- a/shim/tools/xenstore/xs.c +++ b/shim/tools/xenstore/xs.c @@ -800,7 +800,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token) 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) diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c index be82927528..f25ccd7bd4 100644 --- a/tools/xenstore/xs.c +++ b/tools/xenstore/xs.c @@ -725,7 +725,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token) 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)