Gentoo Archives: gentoo-commits

From: Amy Liffey <amynka@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-scheme/guile/, dev-scheme/guile/files/
Date: Mon, 27 Nov 2017 12:47:45
Message-Id: 1511786833.182b1b496f7535bee46bba54544fa3e567be2beb.amynka@gentoo
1 commit: 182b1b496f7535bee46bba54544fa3e567be2beb
2 Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 27 12:44:50 2017 +0000
4 Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 27 12:47:13 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=182b1b49
7
8 dev-scheme/guile: fix ia64 segmentation fault
9
10 Closes: https://bugs.gentoo.org/613986
11 Package-Manager: Portage-2.3.13, Repoman-2.3.3
12
13 dev-scheme/guile/Manifest | 2 +-
14 ...0.14-ia64-fix-crash-thread-context-switch.patch | 63 ++++++++++++++++++++++
15 ...ile-2.0.14-r2.ebuild => guile-2.0.14-r3.ebuild} | 1 +
16 3 files changed, 65 insertions(+), 1 deletion(-)
17
18 diff --git a/dev-scheme/guile/Manifest b/dev-scheme/guile/Manifest
19 index de6ab3b87ea..91a787d19b7 100644
20 --- a/dev-scheme/guile/Manifest
21 +++ b/dev-scheme/guile/Manifest
22 @@ -1,3 +1,3 @@
23 DIST guile-1.8.8.tar.gz 3956654 SHA256 c3471fed2e72e5b04ad133bbaaf16369e8360283679bcf19800bc1b381024050 SHA512 ede6feb90cd419d8763feb8c5169275490a653919573c4dfced025b74cf591072b3a10ffb9a3f6ee3fe7b0a0956ffcf434e0859b421455c8349cea56bf427db0 WHIRLPOOL 104810030b5dae16805595a5b398e5a7e600771b64b08d5ff686036e2f273dcec3829a16e4cdb1dbb9db5813f2e225476f83e0535a789bc570fc2fc15a76dbe2
24 DIST guile-2.0.13.tar.gz 7808173 SHA256 ee8073c4582bb4f06412452fdf5dd185aae607441f1313c824f44bdd668b0bde SHA512 79fd5fda5064331eb687934ec3eaf07943f5b23bd05fbce23ab5ee3698864250b33746e33b8f074692b56f7b428dac42ed5d3f5b9dc17d171aa6dfadc1625b00 WHIRLPOOL 5f8b8e0f0e5fd2cde8fd4b1ca89ebe0231dd5f746945d71412a9d1ce57094013882972d9791511ef47e9bf1f2e9eff77a515dab8b4a6c0316122cb9ef49b5a7d
25 -DIST guile-2.0.14.tar.gz 7823099 SHA256 8aeb2f353881282fe01694cce76bb72f7ffdd296a12c7a1a39255c27b0dfe5f1 SHA512 d69c9bdf589fedcc227f3203012f6ed11c327cef3a0147d8e016fe276abecdb4272625efe1d0c7aa68219fe8f29bbced44089a4b479e4eafe01976c6b2b83633 WHIRLPOOL 3b355f40b47c940bf9330a3521447efd2da7c7c9c3615c208513e36fec937c06a9f307fb2c59d652c09e6e0e13e858d7ef7949efbe32d530431a7aace3d9a165
26 +DIST guile-2.0.14.tar.gz 7823099 BLAKE2B e7fa5a4ca19dc4adfcc151350b0ed4e211b8470b0d12f65451697a818c3139a4a5992a019bd213114748230cb15ec755d1af70d42b901230854915c0ee7b05de SHA512 d69c9bdf589fedcc227f3203012f6ed11c327cef3a0147d8e016fe276abecdb4272625efe1d0c7aa68219fe8f29bbced44089a4b479e4eafe01976c6b2b83633
27
28 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
29 new file mode 100644
30 index 00000000000..c2f136ddd10
31 --- /dev/null
32 +++ b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch
33 @@ -0,0 +1,63 @@
34 +From f92888853439a8ded221f3423865c78de2a96a14 Mon Sep 17 00:00:00 2001
35 +From: Sergei Trofimovich <slyfox@g.o>
36 +Date: Sun, 5 Nov 2017 09:30:45 +0000
37 +Subject: ia64: Fix crash in thread context switch.
38 +MIME-Version: 1.0
39 +Content-Type: text/plain; charset=UTF-8
40 +Content-Transfer-Encoding: 8bit
41 +
42 +Fixes <https://bugs.gnu.org/29151> and <https://bugs.gentoo.org/613986>.
43 +
44 +Backtrace looks like that:
45 +
46 + Program terminated with signal SIGSEGV, Segmentation fault.
47 + #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372
48 + 372 t->pending_rbs_continuation->backing_store,
49 + [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))]
50 + (gdb) bt
51 + #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372
52 + #1 0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0, tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at control.c:239
53 + #2 0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304) at control.c:258
54 + (gdb) print t
55 + $2 = (scm_i_thread *) 0x6000000000068000
56 + (gdb) print t->pending_rbs_continuation
57 + $3 = (scm_t_contregs *) 0xffeb
58 +
59 +The problem here is the value of 't->pending_rbs_continuation' pointer.
60 +It's supposed to poin to a register stack pointer or be NULL if not yet
61 +backed up.
62 +
63 +The problem is it is never initialized to NULL at creation time and
64 +contained garbage on stack. Sometimes people are lucky and have zeros
65 +on stack and guile works. But sometimes there is something and guile
66 +crashes.
67 +
68 +The fix is trivial: initialize 'pending_rbs_continuation = NULL'
69 +at thread registration time (the same way other threads are registered).
70 +
71 +Reported-by: Matt Turner
72 +
73 +* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation
74 +to avoid crash on ia64.
75 +
76 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
77 +Signed-off-by: Ludovic Courtès <ludo@×××.org>
78 +---
79 + libguile/threads.c | 1 +
80 + 1 file changed, 1 insertion(+)
81 +
82 +diff --git a/libguile/threads.c b/libguile/threads.c
83 +index 9ceb5b8..770f62c 100644
84 +--- a/libguile/threads.c
85 ++++ b/libguile/threads.c
86 +@@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister)
87 + t.base = base->mem_base;
88 + #ifdef __ia64__
89 + t.register_backing_store_base = base->reg_base;
90 ++ t.pending_rbs_continuation = 0;
91 + #endif
92 + t.continuation_root = SCM_EOL;
93 + t.continuation_base = t.base;
94 +--
95 +cgit v1.0-41-gc330
96 +
97
98 diff --git a/dev-scheme/guile/guile-2.0.14-r2.ebuild b/dev-scheme/guile/guile-2.0.14-r3.ebuild
99 similarity index 97%
100 rename from dev-scheme/guile/guile-2.0.14-r2.ebuild
101 rename to dev-scheme/guile/guile-2.0.14-r3.ebuild
102 index 37a3cd3ede7..56165f81bcb 100644
103 --- a/dev-scheme/guile/guile-2.0.14-r2.ebuild
104 +++ b/dev-scheme/guile/guile-2.0.14-r3.ebuild
105 @@ -37,6 +37,7 @@ DOCS=( GUILE-VERSION HACKING README )
106 PATCHES=(
107 "${FILESDIR}/${PN}-2-snarf.patch"
108 "${FILESDIR}/${P}-darwin.patch"
109 + "${FILESDIR}/${P}-ia64-fix-crash-thread-context-switch.patch"
110 )
111
112 src_prepare() {