aboutsummaryrefslogtreecommitdiffstats
path: root/main/varnish/fix-stack-overflow.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/varnish/fix-stack-overflow.patch')
-rw-r--r--main/varnish/fix-stack-overflow.patch16
1 files changed, 8 insertions, 8 deletions
diff --git a/main/varnish/fix-stack-overflow.patch b/main/varnish/fix-stack-overflow.patch
index 67677b3306..23fb7cc12c 100644
--- a/main/varnish/fix-stack-overflow.patch
+++ b/main/varnish/fix-stack-overflow.patch
@@ -1,6 +1,6 @@
-From bc0b56b8703e7e02af745af28bc6fff48ab806ba Mon Sep 17 00:00:00 2001
+From f88f2ead8cc5958262d333c46e94ddc8a3c9ae18 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 2 Mar 2016 10:46:49 +0100
+Date: Tue, 21 Nov 2017 12:10:34 +0100
Subject: [PATCH] fix stack overflow in epoll waiter
musl libc has a default thread stack of 80k. avoid overflow the stack by
@@ -10,10 +10,10 @@ allocating the epol_event array on heap instead of stack.
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/varnishd/waiter/cache_waiter_epoll.c b/bin/varnishd/waiter/cache_waiter_epoll.c
-index f50ae46..65719e5 100644
+index 71c426a..ccbc64c 100644
--- a/bin/varnishd/waiter/cache_waiter_epoll.c
+++ b/bin/varnishd/waiter/cache_waiter_epoll.c
-@@ -71,7 +71,7 @@ struct vwe {
+@@ -74,7 +74,7 @@ struct vwe {
static void *
vwe_thread(void *priv)
{
@@ -22,16 +22,16 @@ index f50ae46..65719e5 100644
struct waited *wp;
struct waiter *w;
double now, then;
-@@ -83,6 +83,8 @@ vwe_thread(void *priv)
- w = vwe->waiter;
+@@ -87,6 +87,8 @@ vwe_thread(void *priv)
CHECK_OBJ_NOTNULL(w, WAITER_MAGIC);
THR_SetName("cache-epoll");
+ THR_Init();
+ ev = malloc(NEEV * sizeof(struct epoll_event));
+ assert(ev != NULL);
now = VTIM_real();
while (1) {
-@@ -146,6 +148,7 @@ vwe_thread(void *priv)
+@@ -154,6 +156,7 @@ vwe_thread(void *priv)
AZ(close(vwe->pipe[0]));
AZ(close(vwe->pipe[1]));
AZ(close(vwe->epfd));
@@ -40,5 +40,5 @@ index f50ae46..65719e5 100644
}
--
-2.7.2
+2.13.5