aboutsummaryrefslogtreecommitdiffstats
path: root/main/mesa/adjust-cache-deflate-buffer.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-12-14 14:02:21 +0200
committerTimo Teräs <timo.teras@iki.fi>2018-12-14 14:03:40 +0200
commitff8996cea00e39d93c869434e263268eab704591 (patch)
tree87bb3d4acdfe0ffb75473fb513f39aafd6e6167e /main/mesa/adjust-cache-deflate-buffer.patch
parent3a9dae77f9b009c82b2a95ef18c0283c59640772 (diff)
downloadaports-ff8996cea00e39d93c869434e263268eab704591.tar.gz
aports-ff8996cea00e39d93c869434e263268eab704591.tar.bz2
aports-ff8996cea00e39d93c869434e263268eab704591.tar.xz
main/mesa: fix crashes due to large stack buffers
Diffstat (limited to 'main/mesa/adjust-cache-deflate-buffer.patch')
-rw-r--r--main/mesa/adjust-cache-deflate-buffer.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/main/mesa/adjust-cache-deflate-buffer.patch b/main/mesa/adjust-cache-deflate-buffer.patch
new file mode 100644
index 0000000000..3c116cb69e
--- /dev/null
+++ b/main/mesa/adjust-cache-deflate-buffer.patch
@@ -0,0 +1,16 @@
+diff -ru mesa-18.1.7.orig/src/util/disk_cache.c mesa-18.1.7/src/util/disk_cache.c
+--- mesa-18.1.7.orig/src/util/disk_cache.c 2018-08-24 19:25:19.000000000 +0300
++++ mesa-18.1.7/src/util/disk_cache.c 2018-12-14 13:59:15.433631846 +0200
+@@ -721,8 +721,11 @@
+ /* From the zlib docs:
+ * "If the memory is available, buffers sizes on the order of 128K or 256K
+ * bytes should be used."
++ *
++ * But that is performance optimization for large files. To keep stack usage
++ * in sensible amount (wrt. musl default stack) we use smaller stack on Alpine.
+ */
+-#define BUFSIZE 256 * 1024
++#define BUFSIZE 4 * 1024
+
+ /**
+ * Compresses cache entry in memory and writes it to disk. Returns the size