Skip to content

[pull] master from ruby:master - #1393

Merged
pull[bot] merged 8 commits into
turkdevops:masterfrom
ruby:master
Sep 10, 2026
Merged

[pull] master from ruby:master#1393
pull[bot] merged 8 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Sep 10, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ko1 and others added 8 commits September 10, 2026 05:13
A message sent to a Ractor::Port is enqueued on the receiving Ractor's
recv_queue, and only moved to that port's own queue when the Ractor
receives or closes.  rb_ractor_reap_dead_ports() sweeps the port queues
held in sync.ports, so a message whose port became unreachable before any
delivery happened was never reaped: it stayed on recv_queue, off-heap and
invisible to ObjectSpace, for the life of the process.

    200.times { p = Ractor::Port.new; 1000.times { p << ("z" * 4000) } }

grew without bound (RSS 858 -> 1692 -> 2523 MB over three such passes),
and needs no Ractor at all to hit.  Closing the port, or any receive on
the same Ractor, moved the messages to the port queue and hid the leak.

Sweep recv_queue in the reap as well, dropping the baskets whose port is
no longer in the table.  The reap takes no sync lock: what keeps out the
foreign senders that write recv_queue is the caller's gate in
rb_ractor_finish_marking(), where a global GC has the world stopped and a
single objspace has exactly one live Ractor.  Assert that at the callee,
so a second caller cannot lose the guarantee silently.

[Bug #22122]

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ey are given

The pure-Ruby generator's private _configure gives every keyword a literal
default, so a call that passes one option silently resets the other fifteen.
The method is also aliased as merge, so a state built with indent/object_nl
starts emitting compact JSON after any later configure call.

The C extension does not behave this way. configure_state_i walks only the
keys actually present in the hash, so State#merge really merges there.
Default the keywords to the current ivars so the pure generator agrees.

initialize already assigns every ivar to its literal default before calling
_configure(**opts), so construction is unchanged.

ruby/json@46fbe24b04
It's not a bug to be out of memory. Though, the code did have a separate
bug: perror() can fail to write to stderr and set `errno` which made
the check that followed it questionable. When perror() succeeds it
could clobber `errno` anyways, because the spec allows it.

Just abort.
`rb_concurrent_set_foreach_with_replace` is not safe to run in the case of other running mutators or GCs.
The IPv4 branch matches 224.0.0.0/24, the Local Network Control Block,
but the IPv4-mapped branch masked with 0xffff0000, which is a /16, even
though its comment says /24. So an address was classified differently
depending on whether it arrived as 224.0.1.1 or ::ffff:224.0.1.1, which
is the form a dual-stack AF_INET6 socket hands you.

The other predicates in the family already use the same mask on both
branches.

ruby/ipaddr@eebe5b237d
GC.measure_total_time= writes the flag of the calling Ractor's objspace,
and every new objspace started with the flag on, so turning the timing
off never reached the Ractors created afterwards: each of them kept
paying two clock reads per GC phase, and GC.stat :time in a Ractor did
not follow the setting.

Start a Ractor's objspace with its creator's current value, the way
ractor_create already carries over verbose and debug.  The creating
Ractor's thread is the one running this init, so the value is read
without touching another Ractor's objspace.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Sep 10, 2026
@pull pull Bot added the ⤵️ pull label Sep 10, 2026
@pull
pull Bot merged commit a636d09 into turkdevops:master Sep 10, 2026
0 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants