Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/files/, dev-lang/ruby/
Date: Fri, 26 May 2017 21:33:36
Message-Id: 1495834387.fca896513471e35284c8204fae25f6620a17a2e3.slyfox@gentoo
1 commit: fca896513471e35284c8204fae25f6620a17a2e3
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 26 21:32:04 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Fri May 26 21:33:07 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fca89651
7
8 dev-lang/ruby: fix stack scavenge crash on ia64, bug #561780
9
10 Reported-by: Émeric Maschino
11 Bug: https://bugs.gentoo.org/561780
12 Package-Manager: Portage-2.3.6, Repoman-2.3.2
13
14 dev-lang/ruby/files/ruby-2.1.9-ia64.patch | 63 +++++++++++++++++++++++++++++++
15 dev-lang/ruby/ruby-2.1.10.ebuild | 1 +
16 dev-lang/ruby/ruby-2.1.9.ebuild | 1 +
17 dev-lang/ruby/ruby-2.2.6.ebuild | 1 +
18 dev-lang/ruby/ruby-2.2.7-r1.ebuild | 1 +
19 dev-lang/ruby/ruby-2.2.7.ebuild | 1 +
20 dev-lang/ruby/ruby-2.3.3-r1.ebuild | 1 +
21 dev-lang/ruby/ruby-2.3.4-r1.ebuild | 1 +
22 dev-lang/ruby/ruby-2.3.4.ebuild | 1 +
23 dev-lang/ruby/ruby-2.4.1-r1.ebuild | 1 +
24 dev-lang/ruby/ruby-2.4.1.ebuild | 1 +
25 11 files changed, 73 insertions(+)
26
27 diff --git a/dev-lang/ruby/files/ruby-2.1.9-ia64.patch b/dev-lang/ruby/files/ruby-2.1.9-ia64.patch
28 new file mode 100644
29 index 00000000000..028c5d0e618
30 --- /dev/null
31 +++ b/dev-lang/ruby/files/ruby-2.1.9-ia64.patch
32 @@ -0,0 +1,63 @@
33 +https://bugs.gentoo.org/561780
34 +https://github.com/ruby/ruby/pull/1625
35 +
36 +fix crash on register stack mark/sweep pass
37 +
38 +The crash looks like
39 +
40 + Program received signal SIGSEGV, Segmentation fault.
41 + mark_locations_array (objspace=0x6000000000045db0, x=0x0, n=864692227966763116) at gc.c:3297
42 + 3297 v = *x;
43 + (gdb) bt
44 + #0 mark_locations_array (objspace=0x6000000000045db0, x=0x0, n=864692227966763116) at gc.c:3297
45 + #1 0x400000000014a040 in gc_mark_locations (objspace=0x6000000000045db0, start=0x0, end=0x6000080000000368) at gc.c:3310
46 + #2 0x400000000014b3a0 in mark_current_machine_context (objspace=0x6000000000045db0, th=0x60000000000455b0) at gc.c:3500
47 + #3 0x400000000014dfe0 in gc_mark_roots (objspace=0x6000000000045db0, full_mark=0, categoryp=0x0) at gc.c:4105
48 + #4 0x400000000014e6b0 in gc_marks_body (objspace=0x6000000000045db0, full_mark=0) at gc.c:4164
49 + #5 0x400000000014f260 in gc_marks (objspace=0x6000000000045db0, full_mark=0) at gc.c:4526
50 + #6 0x40000000001525c0 in garbage_collect_body (objspace=0x6000000000045db0, full_mark=0, immediate_sweep=0, reason=256) at gc.c:5024
51 + #7 0x400000000013c010 in heap_prepare_freepage (objspace=0x6000000000045db0, heap=0x6000000000045dc0) at gc.c:1219
52 + #8 0x400000000013c140 in heap_get_freeobj_from_next_freepage (objspace=0x6000000000045db0, heap=0x6000000000045dc0) at gc.c:1237
53 + #9 0x400000000013c360 in heap_get_freeobj (objspace=0x6000000000045db0, heap=0x6000000000045dc0) at gc.c:1259
54 + #10 0x400000000013c950 in newobj_of (klass=0, flags=40, v1=0, v2=0, v3=0) at gc.c:1303
55 + #11 0x400000000013ccc0 in rb_newobj_of (klass=0, flags=40) at gc.c:1356
56 + #12 0x4000000000163740 in hash_alloc (klass=0) at hash.c:289
57 + #13 0x4000000000163860 in rb_hash_new () at hash.c:309
58 + #14 0x400000000050e420 in Init_BareVM () at vm.c:2822
59 + #15 0x40000000000f6b60 in ruby_setup () at eval.c:54
60 + #16 0x40000000000f6f50 in ruby_init () at eval.c:75
61 + #17 0x400000000001b010 in main (argc=9, argv=0x60000fffffffb1d8) at main.c:35
62 +
63 +The problem here is in call
64 + gc_mark_locations (objspace=0x6000000000045db0, start=0x0, end=0x6000080000000368) at gc.c:3310
65 +where 'start' (native_main_thread.register_stack_start)
66 +is supposed to be stack start but it's not initialized.
67 +
68 +The initialization of 'native_main_thread.register_stack_start'
69 +is supposed to be done in 'ruby_init_stack()'.
70 +
71 +But code under 'MAINSTACKADDR_AVAILABLE' exits early.
72 +The fix is to move 'register_stack_start' earlier.
73 +
74 +diff --git a/thread_pthread.c b/thread_pthread.c
75 +index c8a7a16..9ad448b 100644
76 +--- a/thread_pthread.c
77 ++++ b/thread_pthread.c
78 +@@ -722,2 +722,8 @@ ruby_init_stack(volatile VALUE *addr
79 + native_main_thread.id = pthread_self();
80 ++#ifdef __ia64
81 ++ if (!native_main_thread.register_stack_start ||
82 ++ (VALUE*)bsp < native_main_thread.register_stack_start) {
83 ++ native_main_thread.register_stack_start = (VALUE*)bsp;
84 ++ }
85 ++#endif
86 + #if MAINSTACKADDR_AVAILABLE
87 +@@ -745,8 +751,2 @@ ruby_init_stack(volatile VALUE *addr
88 + #endif
89 +-#ifdef __ia64
90 +- if (!native_main_thread.register_stack_start ||
91 +- (VALUE*)bsp < native_main_thread.register_stack_start) {
92 +- native_main_thread.register_stack_start = (VALUE*)bsp;
93 +- }
94 +-#endif
95 + {
96
97 diff --git a/dev-lang/ruby/ruby-2.1.10.ebuild b/dev-lang/ruby/ruby-2.1.10.ebuild
98 index b8599122f9d..f052d94d038 100644
99 --- a/dev-lang/ruby/ruby-2.1.10.ebuild
100 +++ b/dev-lang/ruby/ruby-2.1.10.ebuild
101 @@ -65,6 +65,7 @@ PDEPEND="
102 src_prepare() {
103 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
104 epatch "${WORKDIR}/patches"
105 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
106
107 # We can no longer unbundle all of rake because rubygems now depends
108 # on this. We leave the actual rake code around to bootstrap
109
110 diff --git a/dev-lang/ruby/ruby-2.1.9.ebuild b/dev-lang/ruby/ruby-2.1.9.ebuild
111 index 0e1301fc8aa..9df13b9b0c2 100644
112 --- a/dev-lang/ruby/ruby-2.1.9.ebuild
113 +++ b/dev-lang/ruby/ruby-2.1.9.ebuild
114 @@ -61,6 +61,7 @@ PDEPEND="
115 src_prepare() {
116 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
117 epatch "${WORKDIR}/patches"
118 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
119
120 # We can no longer unbundle all of rake because rubygems now depends
121 # on this. We leave the actual rake code around to bootstrap
122
123 diff --git a/dev-lang/ruby/ruby-2.2.6.ebuild b/dev-lang/ruby/ruby-2.2.6.ebuild
124 index 874e266154a..40984e4c120 100644
125 --- a/dev-lang/ruby/ruby-2.2.6.ebuild
126 +++ b/dev-lang/ruby/ruby-2.2.6.ebuild
127 @@ -74,6 +74,7 @@ PDEPEND="
128 src_prepare() {
129 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
130 epatch "${WORKDIR}/patches"
131 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
132
133 # We can no longer unbundle all of rake because rubygems now depends
134 # on this. We leave the actual rake code around to bootstrap
135
136 diff --git a/dev-lang/ruby/ruby-2.2.7-r1.ebuild b/dev-lang/ruby/ruby-2.2.7-r1.ebuild
137 index 621e417b2cf..7f24baec881 100644
138 --- a/dev-lang/ruby/ruby-2.2.7-r1.ebuild
139 +++ b/dev-lang/ruby/ruby-2.2.7-r1.ebuild
140 @@ -74,6 +74,7 @@ PDEPEND="
141 src_prepare() {
142 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
143 epatch "${WORKDIR}/patches"
144 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
145
146 # We can no longer unbundle all of rake because rubygems now depends
147 # on this. We leave the actual rake code around to bootstrap
148
149 diff --git a/dev-lang/ruby/ruby-2.2.7.ebuild b/dev-lang/ruby/ruby-2.2.7.ebuild
150 index 815d51d8551..5b4776d845a 100644
151 --- a/dev-lang/ruby/ruby-2.2.7.ebuild
152 +++ b/dev-lang/ruby/ruby-2.2.7.ebuild
153 @@ -74,6 +74,7 @@ PDEPEND="
154 src_prepare() {
155 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
156 epatch "${WORKDIR}/patches"
157 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
158
159 # We can no longer unbundle all of rake because rubygems now depends
160 # on this. We leave the actual rake code around to bootstrap
161
162 diff --git a/dev-lang/ruby/ruby-2.3.3-r1.ebuild b/dev-lang/ruby/ruby-2.3.3-r1.ebuild
163 index cb9bbb4e590..2145136d85e 100644
164 --- a/dev-lang/ruby/ruby-2.3.3-r1.ebuild
165 +++ b/dev-lang/ruby/ruby-2.3.3-r1.ebuild
166 @@ -76,6 +76,7 @@ PDEPEND="
167 src_prepare() {
168 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
169 epatch "${WORKDIR}/patches"
170 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
171
172 einfo "Unbundling gems..."
173 cd "$S"
174
175 diff --git a/dev-lang/ruby/ruby-2.3.4-r1.ebuild b/dev-lang/ruby/ruby-2.3.4-r1.ebuild
176 index c3c8f0b9277..3f438d2601e 100644
177 --- a/dev-lang/ruby/ruby-2.3.4-r1.ebuild
178 +++ b/dev-lang/ruby/ruby-2.3.4-r1.ebuild
179 @@ -76,6 +76,7 @@ PDEPEND="
180 src_prepare() {
181 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
182 epatch "${WORKDIR}/patches"
183 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
184
185 einfo "Unbundling gems..."
186 cd "$S"
187
188 diff --git a/dev-lang/ruby/ruby-2.3.4.ebuild b/dev-lang/ruby/ruby-2.3.4.ebuild
189 index cb9bbb4e590..2145136d85e 100644
190 --- a/dev-lang/ruby/ruby-2.3.4.ebuild
191 +++ b/dev-lang/ruby/ruby-2.3.4.ebuild
192 @@ -76,6 +76,7 @@ PDEPEND="
193 src_prepare() {
194 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
195 epatch "${WORKDIR}/patches"
196 + epatch "${FILESDIR}"/${PN}-2.1.9-ia64.patch
197
198 einfo "Unbundling gems..."
199 cd "$S"
200
201 diff --git a/dev-lang/ruby/ruby-2.4.1-r1.ebuild b/dev-lang/ruby/ruby-2.4.1-r1.ebuild
202 index 18a9fd3fe32..e316adee159 100644
203 --- a/dev-lang/ruby/ruby-2.4.1-r1.ebuild
204 +++ b/dev-lang/ruby/ruby-2.4.1-r1.ebuild
205 @@ -75,6 +75,7 @@ PDEPEND="
206 src_prepare() {
207 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
208 epatch "${WORKDIR}/patches"
209 + eapply "${FILESDIR}"/${PN}-2.1.9-ia64.patch
210
211 einfo "Unbundling gems..."
212 cd "$S"
213
214 diff --git a/dev-lang/ruby/ruby-2.4.1.ebuild b/dev-lang/ruby/ruby-2.4.1.ebuild
215 index 1f1300c8139..18cdd65b8f9 100644
216 --- a/dev-lang/ruby/ruby-2.4.1.ebuild
217 +++ b/dev-lang/ruby/ruby-2.4.1.ebuild
218 @@ -75,6 +75,7 @@ PDEPEND="
219 src_prepare() {
220 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
221 epatch "${WORKDIR}/patches"
222 + eapply "${FILESDIR}"/${PN}-2.1.9-ia64.patch
223
224 einfo "Unbundling gems..."
225 cd "$S"