Skip to content

Commit d82359e

Browse files
committed
Merge branch 'master' into dist/3.4/jammy
2 parents 9019aad + 7830c51 commit d82359e

File tree

20 files changed

+488
-62
lines changed

20 files changed

+488
-62
lines changed

ChangeLog

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,215 @@
11
-*- coding: utf-8 -*-
22

3+
commit 7a5688e2a27668e48f8d6ff4af5b2208b98a2f5e
4+
Author: Takashi Kokubun <[email protected]>
5+
AuthorDate: 2025-10-08 01:42:48 +0900
6+
Commit: Takashi Kokubun <[email protected]>
7+
CommitDate: 2025-10-08 01:42:48 +0900
8+
9+
v3.4.7
10+
11+
commit ef3ce711fb29f7273216edb2fe41bb2604c835c3
12+
Author: Takashi Kokubun <[email protected]>
13+
AuthorDate: 2025-10-08 01:41:15 +0900
14+
Commit: Takashi Kokubun <[email protected]>
15+
CommitDate: 2025-10-08 01:41:15 +0900
16+
17+
merge revision(s) 7ae67e8f6ad6e7fd0677b28a7a10961f79d55495: [Backport #21568]
18+
19+
[PATCH] load.c: Fix dest and src of MEMMOVE
20+
21+
When multiple files with the same name are required, the features_index
22+
hash stores the indexes in `$LOADED_FEATURES` array into a darray.
23+
The dest and src arguments for `MEMMOVE` were wrongly reversed when
24+
inserting a new index in the darray.
25+
26+
[Bug #21568]
27+
28+
commit a7eb7e7c6fe02f7127ff527fff18a0914a7aa888
29+
Author: Takashi Kokubun <[email protected]>
30+
AuthorDate: 2025-10-07 02:53:24 +0900
31+
Commit: Takashi Kokubun <[email protected]>
32+
CommitDate: 2025-10-08 01:40:55 +0900
33+
34+
tool/merger.rb: Fetch diff from GitHub instead of cgit
35+
36+
Our cgit server has been shut down.
37+
38+
tool/merger.rb: Fetch a diff in the patch format
39+
40+
It expects "Subject:", so it needs to be a patch file.
41+
42+
commit d2cd7eaa11f57f81cdbacf0e8d5162d37e28337b
43+
Author: Nobuyoshi Nakada <[email protected]>
44+
AuthorDate: 2025-10-07 10:30:16 +0900
45+
Commit: Takashi Kokubun <[email protected]>
46+
CommitDate: 2025-10-08 01:15:46 +0900
47+
48+
Update rubyspec as of CVE-2025-27221
49+
50+
commit 71462666e0f1ea720062e12f97b2ea89166038d1
51+
Author: Hiroshi SHIBATA <[email protected]>
52+
AuthorDate: 2025-10-07 18:29:36 +0900
53+
Commit: Takashi Kokubun <[email protected]>
54+
CommitDate: 2025-10-08 01:15:46 +0900
55+
56+
Merge URI-1.0.4
57+
58+
commit 49d7295fc38583abf3018a16a2018667871d9f3d
59+
Author: Takashi Kokubun <[email protected]>
60+
AuthorDate: 2025-10-03 02:05:27 +0900
61+
Commit: Takashi Kokubun <[email protected]>
62+
CommitDate: 2025-10-03 02:05:39 +0900
63+
64+
macos.yml: macOS 13 hosted runner image is closing down
65+
66+
https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/
67+
68+
commit 264b2d78c366491834c9ce4499a4ad7b7564b89d
69+
Author: Takashi Kokubun <[email protected]>
70+
AuthorDate: 2025-09-30 07:10:37 +0900
71+
Commit: Takashi Kokubun <[email protected]>
72+
CommitDate: 2025-09-30 07:10:58 +0900
73+
74+
Reapply "merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]"
75+
76+
This reverts commit c414b9871f263331cde0af1c08cf5c1a47e1aedf.
77+
78+
commit c414b9871f263331cde0af1c08cf5c1a47e1aedf
79+
Author: Takashi Kokubun <[email protected]>
80+
AuthorDate: 2025-09-30 07:08:47 +0900
81+
Commit: Takashi Kokubun <[email protected]>
82+
CommitDate: 2025-09-30 07:08:47 +0900
83+
84+
Revert "merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]"
85+
86+
This reverts commit 4306c9048fb674d24b92dc46b6746a4749564147.
87+
88+
commit 22c2262b83224f6798d60d539f1f8609d9722766
89+
Author: Takashi Kokubun <[email protected]>
90+
AuthorDate: 2025-09-30 06:36:06 +0900
91+
Commit: Takashi Kokubun <[email protected]>
92+
CommitDate: 2025-09-30 06:36:06 +0900
93+
94+
merge revision(s) 354d47ae5bc4edcc94db4a5391ed71a8b9844e57: [Backport #21569]
95+
96+
IBF: Avoid unaligned load on 32 bit platforms
97+
98+
[Bug #21569]
99+
100+
commit 4306c9048fb674d24b92dc46b6746a4749564147
101+
Author: Takashi Kokubun <[email protected]>
102+
AuthorDate: 2025-09-30 06:35:15 +0900
103+
Commit: Takashi Kokubun <[email protected]>
104+
CommitDate: 2025-09-30 06:35:15 +0900
105+
106+
merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]
107+
108+
Properly unlock locked mutexes on thread cleanup.
109+
110+
Mutexes were being improperly unlocked on thread cleanup. This bug was
111+
introduced in 050a8954395.
112+
113+
We must keep a reference from the mutex to the thread, because if the fiber
114+
is collected before the mutex is, then we cannot unlink it from the thread in
115+
`mutex_free`. If it's not unlinked from the the thread when it's freed, it
116+
causes bugs in `rb_thread_unlock_all_locking_mutexes`.
117+
118+
We now mark the fiber when a mutex is locked, and the thread is marked
119+
as well. However, a fiber can still be freed in the same GC cycle as the
120+
mutex, so the reference to the thread is still needed.
121+
122+
The reason we need to mark the fiber is that `mutex_owned_p()` has an ABA
123+
issue where if the fiber is collected while it's locked, a new fiber could be
124+
allocated at the same memory address and we could get false positives.
125+
126+
Fixes [Bug #21342]
127+
128+
Co-authored-by: John Hawthorn <[email protected]>
129+
130+
commit 88a96147a21900a2c22d3ae84d05cd3f6ee795c7
131+
Author: Takashi Kokubun <[email protected]>
132+
AuthorDate: 2025-09-30 06:31:05 +0900
133+
Commit: Takashi Kokubun <[email protected]>
134+
CommitDate: 2025-09-30 06:31:05 +0900
135+
136+
merge revision(s) ef2b26cc3eaed06c5c9d4ef2c6d8669ff357afa4: [Backport #21611]
137+
138+
`struct iseq_catch_table` is packed
139+
140+
commit e900e9fc9ace5e36de5170c83df0f56167e4c8a9
141+
Author: Samuel Williams <[email protected]>
142+
AuthorDate: 2025-09-18 12:24:02 +0900
143+
Commit: GitHub <[email protected]>
144+
CommitDate: 2025-09-18 12:24:02 +0900
145+
146+
Use `ec->interrupt_mask` to prevent interrupts. [Backport #21610]
147+
148+
Disallow pending interrupts to be checked during `FiberScheduler#unblock`.
149+
150+
Ractors can send signals at any time, so the previous debug assertion can fail if a Ractor sends a signal.
151+
152+
Co-authored-by: Luke Gruber <[email protected]>
153+
154+
commit 6882012473b3bd3a9eb53ad7f7754144c0e63ef0
155+
Author: Jean Boussier <[email protected]>
156+
AuthorDate: 2025-09-17 06:17:51 +0900
157+
Commit: GitHub <[email protected]>
158+
CommitDate: 2025-09-17 06:17:51 +0900
159+
160+
[3.4] compile.c: Handle anonymous variables in `outer_variable_cmp` (#13493)
161+
162+
commit b5346f2c5be00f886c9ad2f4b807deb728265a0a
163+
Author: Nick Dower <[email protected]>
164+
AuthorDate: 2025-05-16 22:44:45 +0900
165+
Commit: Takashi Kokubun <[email protected]>
166+
CommitDate: 2025-09-17 05:36:08 +0900
167+
168+
Add a test case for `it` in a regex.
169+
170+
Co-authored-by: Alan Wu <[email protected]>
171+
172+
commit 1f6d845011cf8900c0e9c6fe5e4243a63a5ecae3
173+
Author: Nick Dower <[email protected]>
174+
AuthorDate: 2025-05-16 12:18:28 +0900
175+
Commit: Takashi Kokubun <[email protected]>
176+
CommitDate: 2025-09-17 05:36:08 +0900
177+
178+
[Bug #21313] Handle `it` in rescue and ensure blocks.
179+
180+
The following is crashing for me:
181+
182+
```shell
183+
ruby --yjit --yjit-call-threshold=1 -e '1.tap { raise rescue p it }'
184+
185+
ruby: YJIT has panicked. More info to follow...
186+
thread '<unnamed>' panicked at ./yjit/src/codegen.rs:2402:14:
187+
...
188+
```
189+
190+
It seems `it` sometimes points to the wrong value:
191+
192+
```shell
193+
ruby -e '1.tap { raise rescue p it }'
194+
false
195+
196+
ruby -e '1.tap { begin; raise; ensure; p it; end } rescue nil'
197+
false
198+
```
199+
200+
But only when `$!` is set:
201+
202+
```shell
203+
ruby -e '1.tap { begin; nil; ensure; p it; end }'
204+
1
205+
206+
ruby -e '1.tap { begin; nil; rescue; ensure; p it; end }'
207+
1
208+
209+
ruby -e '1.tap { begin; raise; rescue; ensure; p it; end }'
210+
1
211+
```
212+
3213
commit dbd83256b1cec76c69756ecb8758b9e1079833de
4214
Author: Takashi Kokubun <[email protected]>
5215
AuthorDate: 2025-09-16 07:38:23 +0900

common.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16575,6 +16575,7 @@ scheduler.$(OBJEXT): {$(VPATH)}config.h
1657516575
scheduler.$(OBJEXT): {$(VPATH)}constant.h
1657616576
scheduler.$(OBJEXT): {$(VPATH)}defines.h
1657716577
scheduler.$(OBJEXT): {$(VPATH)}encoding.h
16578+
scheduler.$(OBJEXT): {$(VPATH)}eval_intern.h
1657816579
scheduler.$(OBJEXT): {$(VPATH)}fiber/scheduler.h
1657916580
scheduler.$(OBJEXT): {$(VPATH)}id.h
1658016581
scheduler.$(OBJEXT): {$(VPATH)}id_table.h

compile.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13160,7 +13160,7 @@ ibf_load_catch_table(const struct ibf_load *load, ibf_offset_t catch_table_offse
1316013160
table->entries[i].sp = (unsigned int)ibf_load_small_value(load, &reading_pos);
1316113161

1316213162
rb_iseq_t *catch_iseq = (rb_iseq_t *)ibf_load_iseq(load, (const rb_iseq_t *)(VALUE)iseq_index);
13163-
RB_OBJ_WRITE(parent_iseq, &table->entries[i].iseq, catch_iseq);
13163+
RB_OBJ_WRITE(parent_iseq, UNALIGNED_MEMBER_PTR(&table->entries[i], iseq), catch_iseq);
1316413164
}
1316513165
return table;
1316613166
}
@@ -13236,6 +13236,13 @@ outer_variable_cmp(const void *a, const void *b, void *arg)
1323613236
{
1323713237
const struct outer_variable_pair *ap = (const struct outer_variable_pair *)a;
1323813238
const struct outer_variable_pair *bp = (const struct outer_variable_pair *)b;
13239+
13240+
if (!ap->name) {
13241+
return -1;
13242+
} else if (!bp->name) {
13243+
return 1;
13244+
}
13245+
1323913246
return rb_str_cmp(ap->name, bp->name);
1324013247
}
1324113248

@@ -13902,8 +13909,10 @@ ibf_dump_object_float(struct ibf_dump *dump, VALUE obj)
1390213909
static VALUE
1390313910
ibf_load_object_float(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
1390413911
{
13905-
const double *dblp = IBF_OBJBODY(double, offset);
13906-
return DBL2NUM(*dblp);
13912+
double d;
13913+
/* Avoid unaligned VFP load on ARMv7; IBF payload may be unaligned (C99 6.3.2.3 p7). */
13914+
memcpy(&d, IBF_OBJBODY(double, offset), sizeof(d));
13915+
return DBL2NUM(d);
1390713916
}
1390813917

1390913918
static void

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ruby3.4 (3.4.7-0nkmi1~dist) unstable; urgency=medium
2+
3+
* 3.4.7
4+
5+
-- Sorah Fukumori <[email protected]> Wed, 08 Oct 2025 20:53:03 +0900
6+
17
ruby3.4 (3.4.6-0nkmi1~dist) unstable; urgency=medium
28

39
* 3.4.6

lib/uri/generic.rb

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,18 @@ def initialize(scheme,
186186

187187
if arg_check
188188
self.scheme = scheme
189-
self.userinfo = userinfo
190189
self.hostname = host
191190
self.port = port
191+
self.userinfo = userinfo
192192
self.path = path
193193
self.query = query
194194
self.opaque = opaque
195195
self.fragment = fragment
196196
else
197197
self.set_scheme(scheme)
198-
self.set_userinfo(userinfo)
199198
self.set_host(host)
200199
self.set_port(port)
200+
self.set_userinfo(userinfo)
201201
self.set_path(path)
202202
self.query = query
203203
self.set_opaque(opaque)
@@ -511,7 +511,7 @@ def set_userinfo(user, password = nil)
511511
user, password = split_userinfo(user)
512512
end
513513
@user = user
514-
@password = password if password
514+
@password = password
515515

516516
[@user, @password]
517517
end
@@ -522,7 +522,7 @@ def set_userinfo(user, password = nil)
522522
# See also URI::Generic.user=.
523523
#
524524
def set_user(v)
525-
set_userinfo(v, @password)
525+
set_userinfo(v, nil)
526526
v
527527
end
528528
protected :set_user
@@ -574,6 +574,12 @@ def password
574574
@password
575575
end
576576

577+
# Returns the authority info (array of user, password, host and
578+
# port), if any is set. Or returns +nil+.
579+
def authority
580+
return @user, @password, @host, @port if @user || @password || @host || @port
581+
end
582+
577583
# Returns the user component after URI decoding.
578584
def decoded_user
579585
URI.decode_uri_component(@user) if @user
@@ -615,6 +621,13 @@ def set_host(v)
615621
end
616622
protected :set_host
617623

624+
# Protected setter for the authority info (+user+, +password+, +host+
625+
# and +port+). If +port+ is +nil+, +default_port+ will be set.
626+
#
627+
protected def set_authority(user, password, host, port = nil)
628+
@user, @password, @host, @port = user, password, host, port || self.default_port
629+
end
630+
618631
#
619632
# == Args
620633
#
@@ -639,6 +652,7 @@ def set_host(v)
639652
def host=(v)
640653
check_host(v)
641654
set_host(v)
655+
set_userinfo(nil)
642656
v
643657
end
644658

@@ -729,6 +743,7 @@ def set_port(v)
729743
def port=(v)
730744
check_port(v)
731745
set_port(v)
746+
set_userinfo(nil)
732747
port
733748
end
734749

@@ -1121,7 +1136,7 @@ def merge(oth)
11211136

11221137
base = self.dup
11231138

1124-
authority = rel.userinfo || rel.host || rel.port
1139+
authority = rel.authority
11251140

11261141
# RFC2396, Section 5.2, 2)
11271142
if (rel.path.nil? || rel.path.empty?) && !authority && !rel.query
@@ -1134,9 +1149,7 @@ def merge(oth)
11341149

11351150
# RFC2396, Section 5.2, 4)
11361151
if authority
1137-
base.set_userinfo(rel.userinfo)
1138-
base.set_host(rel.host)
1139-
base.set_port(rel.port || base.default_port)
1152+
base.set_authority(*authority)
11401153
base.set_path(rel.path)
11411154
elsif base.path && rel.path
11421155
base.set_path(merge_path(base.path, rel.path))

lib/uri/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module URI
22
# :stopdoc:
3-
VERSION_CODE = '010003'.freeze
3+
VERSION_CODE = '010004'.freeze
44
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
55
# :startdoc:
66
end

load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ features_index_add_single_callback(st_data_t *key, st_data_t *value, st_data_t r
284284
if (pos >= 0) {
285285
long *ptr = rb_darray_data_ptr(feature_indexes);
286286
long len = rb_darray_size(feature_indexes);
287-
MEMMOVE(ptr + pos, ptr + pos + 1, long, len - pos - 1);
287+
MEMMOVE(ptr + pos + 1, ptr + pos, long, len - pos - 1);
288288
ptr[pos] = FIX2LONG(offset);
289289
}
290290
}

0 commit comments

Comments
 (0)