aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-09-28 14:17:19 -0600
committerAriadne Conill <ariadne@dereferenced.org>2020-09-28 14:17:19 -0600
commitbf7828cb57cb571a3d2187f9a36a9eac620bd4c3 (patch)
tree39791267c6fde65731ffdf517850fbf7ec3a8ccd
parent15f78694bc049a278e8a03c2b284379a5f3e2cb8 (diff)
downloadaports-bf7828cb57cb571a3d2187f9a36a9eac620bd4c3.tar.gz
aports-bf7828cb57cb571a3d2187f9a36a9eac620bd4c3.tar.bz2
aports-bf7828cb57cb571a3d2187f9a36a9eac620bd4c3.tar.xz
main/musl: from dalias, convert predictable hangs across fork into predictable crashes
-rw-r--r--main/musl/APKBUILD4
-rw-r--r--main/musl/convert-hangs-to-crashes.patch25
2 files changed, 28 insertions, 1 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 35fe0b1c8b..b69371b359 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.2.1
-pkgrel=1
+pkgrel=2
pkgdesc="the musl c library (libc) implementation"
url="https://musl.libc.org/"
arch="all"
@@ -22,6 +22,7 @@ source="https://musl.libc.org/releases/musl-$pkgver.tar.gz
0001-make-h_errno-thread-local.patch
0001-report-res_query-failures-including-nxdomain-nodata-.patch
0001-restore-h_errno-ABI-compatibility-with-ancient-binar.patch
+ convert-hangs-to-crashes.patch
ldconfig
__stack_chk_fail_local.c
@@ -168,6 +169,7 @@ a76f79b801497ad994746cf82bb6eaf86f9e1ae646e6819fbae8532a7f4eee53a96ac1d4e789ec8f
7dedeec490aeb50ea4cdd949e931a3b5fcc640a10dcd4624a0f1502ae56ece821f5038506b4288cea0684a6d05371e93f9c6607310efc7fab7fe0181ec8d1265 0001-make-h_errno-thread-local.patch
2294022a1128f221b3433f01b471382646abb6fb5cea69c3b6672ecd1b1b68c6cac73eaf1fc310af419ad7f3904e36828257a35974298c26201ff8fbd29be7e9 0001-report-res_query-failures-including-nxdomain-nodata-.patch
228304741328dad4d5331b0dd41c3a8e120a367b247013c71569e5acaab773bcb5d85b30d44dab0938f3bce4217a5b0164d7981c8bb1d5ab8c647657ad8d3b41 0001-restore-h_errno-ABI-compatibility-with-ancient-binar.patch
+ea286612041245fd1a706c5f1180ae42883dfbba7637aa92012bccafad012a395de4572c423b5f8ba3c0fb058b07c68c5b0f8079194b2e115703ef802ae443a9 convert-hangs-to-crashes.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c
diff --git a/main/musl/convert-hangs-to-crashes.patch b/main/musl/convert-hangs-to-crashes.patch
new file mode 100644
index 0000000000..326a9c7d33
--- /dev/null
+++ b/main/musl/convert-hangs-to-crashes.patch
@@ -0,0 +1,25 @@
+diff --git a/src/process/fork.c b/src/process/fork.c
+index 7e984ff8..c4fa7510 100644
+--- a/src/process/fork.c
++++ b/src/process/fork.c
+@@ -30,7 +30,7 @@ pid_t fork(void)
+ self->next = self->prev = self;
+ __thread_list_lock = 0;
+ libc.threads_minus_1 = 0;
+- if (libc.need_locks) libc.need_locks = -1;
++ if (libc.need_locks > 0) libc.need_locks = -2;
+ }
+ __restore_sigs(&set);
+ __fork_handler(!ret);
+diff --git a/src/thread/__lock.c b/src/thread/__lock.c
+index 60eece49..75412cc8 100644
+--- a/src/thread/__lock.c
++++ b/src/thread/__lock.c
+@@ -24,6 +24,7 @@ void __lock(volatile int *l)
+ int current = a_cas(l, 0, INT_MIN + 1);
+ if (need_locks < 0) libc.need_locks = 0;
+ if (!current) return;
++ if (need_locks < -1) a_crash();
+ /* A first spin loop, for medium congestion. */
+ for (unsigned i = 0; i < 10; ++i) {
+ if (current < 0) current -= INT_MIN + 1;