From: "Jory Pratt" <anarchy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/musl:master commit in: media-libs/mesa/files/, media-libs/mesa/
Date: Tue, 2 Jul 2019 17:27:45 +0000 (UTC) [thread overview]
Message-ID: <1562088456.60e4a8942f1e6ab43491beab75db633bb53bc857.anarchy@gentoo> (raw)
commit: 60e4a8942f1e6ab43491beab75db633bb53bc857
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 2 17:27:36 2019 +0000
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Tue Jul 2 17:27:36 2019 +0000
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=60e4a894
media-libs/mesa: Fix stack overflow issues with musl, upstream patch
Package-Manager: Portage-2.3.68, Repoman-2.3.16
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
.../files/mesa-19.1.0-cache_stack_overflow.patch | 56 ++++++++++++++++++++++
.../{mesa-19.1.1.ebuild => mesa-19.1.1-r1.ebuild} | 1 +
2 files changed, 57 insertions(+)
diff --git a/media-libs/mesa/files/mesa-19.1.0-cache_stack_overflow.patch b/media-libs/mesa/files/mesa-19.1.0-cache_stack_overflow.patch
new file mode 100644
index 0000000..3d6a8df
--- /dev/null
+++ b/media-libs/mesa/files/mesa-19.1.0-cache_stack_overflow.patch
@@ -0,0 +1,56 @@
+From 594d2ec43022871f3b9ad2737e9d7bb97991b2bb Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Mon, 17 Jun 2019 09:57:46 -0500
+Subject: [PATCH] The disk cache code tries to allocate a 256 Kbyte buffer on
+ the stack. Since musl only gives 80 Kbyte of stack space per thread, this
+ causes a trap.
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+---
+ src/util/disk_cache.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
+index 9977c38..c23abdb 100644
+--- a/src/util/disk_cache.c
++++ b/src/util/disk_cache.c
+@@ -732,7 +732,7 @@ static size_t
+ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
+ const char *filename)
+ {
+- unsigned char out[BUFSIZE];
++ unsigned char *out;
+
+ /* allocate deflate state */
+ z_stream strm;
+@@ -749,6 +749,11 @@ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
+ /* compress until end of in_data */
+ size_t compressed_size = 0;
+ int flush;
++
++ out = calloc(1, BUFSIZE);
++ if (out == NULL)
++ return 0;
++
+ do {
+ int remaining = in_data_size - BUFSIZE;
+ flush = remaining > 0 ? Z_NO_FLUSH : Z_FINISH;
+@@ -770,6 +775,7 @@ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
+ ssize_t written = write_all(dest, out, have);
+ if (written == -1) {
+ (void)deflateEnd(&strm);
++ free(out);
+ return 0;
+ }
+ } while (strm.avail_out == 0);
+@@ -784,6 +790,7 @@ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
+
+ /* clean up and return */
+ (void)deflateEnd(&strm);
++ free(out);
+ return compressed_size;
+ }
+
+--
+2.22.0
+
diff --git a/media-libs/mesa/mesa-19.1.1.ebuild b/media-libs/mesa/mesa-19.1.1-r1.ebuild
similarity index 99%
rename from media-libs/mesa/mesa-19.1.1.ebuild
rename to media-libs/mesa/mesa-19.1.1-r1.ebuild
index 759f4d0..a7bff8c 100644
--- a/media-libs/mesa/mesa-19.1.1.ebuild
+++ b/media-libs/mesa/mesa-19.1.1-r1.ebuild
@@ -244,6 +244,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-18-musl-invocation_name.patch
"${FILESDIR}"/${PN}-18-musl-pthread.patch
"${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
+ "${FILESDIR}"/${PN}-19.1.0-cache_stack_overflow.patch
)
llvm_check_deps() {
next reply other threads:[~2019-07-02 17:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 17:27 Jory Pratt [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-19 1:08 [gentoo-commits] proj/musl:master commit in: media-libs/mesa/files/, media-libs/mesa/ Anthony G. Basile
2021-08-20 14:14 Jory Pratt
2021-07-06 13:17 Jory Pratt
2021-03-10 15:06 Jory Pratt
2020-09-19 12:45 Jory Pratt
2020-03-09 0:53 Jory Pratt
2019-11-06 19:35 Jory Pratt
2019-08-11 22:46 Jory Pratt
2019-01-27 17:52 Anthony G. Basile
2019-01-23 19:29 Anthony G. Basile
2018-11-09 13:16 Anthony G. Basile
2018-10-29 11:48 Anthony G. Basile
2018-10-05 0:12 Anthony G. Basile
2018-07-08 21:58 Anthony G. Basile
2018-01-24 21:25 Aric Belsito
2017-12-29 22:23 Aric Belsito
2017-12-13 0:50 Aric Belsito
2017-12-11 22:29 Aric Belsito
2017-05-10 0:41 Aric Belsito
2016-03-14 2:22 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1562088456.60e4a8942f1e6ab43491beab75db633bb53bc857.anarchy@gentoo \
--to=anarchy@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox