summaryrefslogtreecommitdiff
path: root/user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-03 04:54:31 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-03 04:54:31 -0500
commit76033d6ea82669a441290a19804b54e3892388a7 (patch)
tree4296076d60bcd864383468669d18e83e9ec453c6 /user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch
parentc7b5a77ca52ce331d117cb8d5892277a487b95ce (diff)
downloadpackages-76033d6ea82669a441290a19804b54e3892388a7.tar.gz
packages-76033d6ea82669a441290a19804b54e3892388a7.tar.bz2
packages-76033d6ea82669a441290a19804b54e3892388a7.tar.xz
packages-76033d6ea82669a441290a19804b54e3892388a7.zip
user/qemu: new package
Diffstat (limited to 'user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch')
-rw-r--r--user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch b/user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch
new file mode 100644
index 000000000..116254223
--- /dev/null
+++ b/user/qemu/ignore-signals-33-and-64-to-allow-golang-emulation.patch
@@ -0,0 +1,56 @@
+From db186a3f83454268c43fc793a48bc28c41368a6c Mon Sep 17 00:00:00 2001
+From: Petros Angelatos <petrosagg@gmail.com>
+Date: Thu, 3 Mar 2016 23:58:53 -0800
+Subject: [PATCH] linux-user: ignore signals 33 and 64 to allow golang
+ emulation
+
+Signal 33 will always fail. This causes golang crash since
+https://github.com/golang/go/commit/675eb72c285cd0dd44a5f280bb3fa456ddf6de16
+
+As explained in that commit, these signals are very rarely used in a
+way that causes problems, so it's ok-ish to ignore one of them.
+
+Signal 64 will fail because QEMU uses SIGRTMAX for itself. This causes
+golang to crash for versions earlier than
+https://github.com/golang/go/commit/d10675089d74db0408f2432eae3bd89a8e1c2d6a
+
+Since after that commit golang ignores that signal, we also ignore it here to
+allow earlier versions to run as well.
+
+Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
+---
+ linux-user/signal.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/linux-user/signal.c b/linux-user/signal.c
+index 9a4d894..90aca55 100644
+--- a/linux-user/signal.c
++++ b/linux-user/signal.c
+@@ -744,6 +744,27 @@ int do_sigaction(int sig, const struct target_sigaction *act,
+ }
+
+ k = &sigact_table[sig - 1];
++
++ /* This signal will always fail. This causes golang crash since
++ * https://github.com/golang/go/commit/675eb72c285cd0dd44a5f280bb3fa456ddf6de16
++ *
++ * As explained in that commit, these signals are very rarely used in a
++ * way that causes problems, so it's ok-ish to ignore one of them here.
++ */
++ if (sig == 33) {
++ return 0;
++ }
++ /* This signal will fail because QEMU uses SIGRTMAX for itself. This causes
++ * golang to crash for versions earlier than
++ * https://github.com/golang/go/commit/d10675089d74db0408f2432eae3bd89a8e1c2d6a
++ *
++ * Since after that commit golang ignores that signal, we also ignore it here to
++ * allow earlier versions to run as well.
++ */
++ if (sig == 64) {
++ return 0;
++ }
++
+ if (oact) {
+ __put_user(k->_sa_handler, &oact->_sa_handler);
+ __put_user(k->sa_flags, &oact->sa_flags);