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.patch32
1 files changed, 8 insertions, 24 deletions
diff --git a/main/varnish/fix-stack-overflow.patch b/main/varnish/fix-stack-overflow.patch
index 67677b3306..639d0e69f6 100644
--- a/main/varnish/fix-stack-overflow.patch
+++ b/main/varnish/fix-stack-overflow.patch
@@ -1,19 +1,6 @@
-From bc0b56b8703e7e02af745af28bc6fff48ab806ba Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 2 Mar 2016 10:46:49 +0100
-Subject: [PATCH] fix stack overflow in epoll waiter
-
-musl libc has a default thread stack of 80k. avoid overflow the stack by
-allocating the epol_event array on heap instead of stack.
----
- bin/varnishd/waiter/cache_waiter_epoll.c | 5 ++++-
- 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
---- a/bin/varnishd/waiter/cache_waiter_epoll.c
-+++ b/bin/varnishd/waiter/cache_waiter_epoll.c
-@@ -71,7 +71,7 @@ struct vwe {
+--- ./bin/varnishd/waiter/cache_waiter_epoll.c.orig
++++ ./bin/varnishd/waiter/cache_waiter_epoll.c
+@@ -70,7 +70,7 @@
static void *
vwe_thread(void *priv)
{
@@ -22,7 +9,7 @@ index f50ae46..65719e5 100644
struct waited *wp;
struct waiter *w;
double now, then;
-@@ -83,6 +83,8 @@ vwe_thread(void *priv)
+@@ -82,6 +82,8 @@
w = vwe->waiter;
CHECK_OBJ_NOTNULL(w, WAITER_MAGIC);
THR_SetName("cache-epoll");
@@ -31,14 +18,11 @@ index f50ae46..65719e5 100644
now = VTIM_real();
while (1) {
-@@ -146,6 +148,7 @@ vwe_thread(void *priv)
- AZ(close(vwe->pipe[0]));
- AZ(close(vwe->pipe[1]));
- AZ(close(vwe->epfd));
+@@ -149,6 +151,7 @@
+ closefd(&vwe->pipe[0]);
+ closefd(&vwe->pipe[1]);
+ closefd(&vwe->epfd);
+ free(ev);
return (NULL);
}
---
-2.7.2
-