summaryrefslogtreecommitdiff
path: root/dev-scheme/guile/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-12-01 03:04:39 +0000
committerV3n3RiX <venerix@redcorelinux.org>2017-12-01 03:04:39 +0000
commit407525b571b48cfd65e1ad7a02d250a927c967c9 (patch)
tree844bea44d85dc7218f54970af1c42cc9d55c3f1a /dev-scheme/guile/files
parent89c6c06b8c42107dd231687a1012354e7d3039fc (diff)
gentoo resync : 01.12.2017
Diffstat (limited to 'dev-scheme/guile/files')
-rw-r--r--dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch
new file mode 100644
index 000000000000..c2f136ddd104
--- /dev/null
+++ b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch
@@ -0,0 +1,63 @@
+From f92888853439a8ded221f3423865c78de2a96a14 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun, 5 Nov 2017 09:30:45 +0000
+Subject: ia64: Fix crash in thread context switch.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes <https://bugs.gnu.org/29151> and <https://bugs.gentoo.org/613986>.
+
+Backtrace looks like that:
+
+ Program terminated with signal SIGSEGV, Segmentation fault.
+ #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372
+ 372 t->pending_rbs_continuation->backing_store,
+ [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))]
+ (gdb) bt
+ #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372
+ #1 0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0, tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at control.c:239
+ #2 0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304) at control.c:258
+ (gdb) print t
+ $2 = (scm_i_thread *) 0x6000000000068000
+ (gdb) print t->pending_rbs_continuation
+ $3 = (scm_t_contregs *) 0xffeb
+
+The problem here is the value of 't->pending_rbs_continuation' pointer.
+It's supposed to poin to a register stack pointer or be NULL if not yet
+backed up.
+
+The problem is it is never initialized to NULL at creation time and
+contained garbage on stack. Sometimes people are lucky and have zeros
+on stack and guile works. But sometimes there is something and guile
+crashes.
+
+The fix is trivial: initialize 'pending_rbs_continuation = NULL'
+at thread registration time (the same way other threads are registered).
+
+Reported-by: Matt Turner
+
+* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation
+to avoid crash on ia64.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+Signed-off-by: Ludovic Courtès <ludo@gnu.org>
+---
+ libguile/threads.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libguile/threads.c b/libguile/threads.c
+index 9ceb5b8..770f62c 100644
+--- a/libguile/threads.c
++++ b/libguile/threads.c
+@@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister)
+ t.base = base->mem_base;
+ #ifdef __ia64__
+ t.register_backing_store_base = base->reg_base;
++ t.pending_rbs_continuation = 0;
+ #endif
+ t.continuation_root = SCM_EOL;
+ t.continuation_base = t.base;
+--
+cgit v1.0-41-gc330
+