General

Profile

peterzhu2118 (Peter Zhu)

  • Login: peterzhu2118
  • Email: peter@peterzhu.ca
  • Registered on: 08/01/2020
  • Last sign in: 09/25/2026

Issues

open closed Total
Assigned issues 2 31 33
Reported issues 1 80 81

Projects

Project Roles Registered on
Ruby Committer 03/24/2021

Activity

Today

09:36 AM Ruby Revision d939272e (git): Fix out-of-bounds in Array#sample when array modified
The fix in commit 11f57c6 contained a bug where the calculated index should
be `len - i` and not `len - 1`. This script reproduces the crash:
ary = (1..100).to_a
gen = Object.new
gen.define_singleton_method(:rand) { |lim| 8 ...
peterzhu2118 (Peter Zhu)

09/26/2026

01:02 PM Ruby Revision 6eab8427 (git): Force postmortem GC to always run
Currently, if GC is disabled, postmortem GC is not ran when a Ractor dies.
This can cause the object space to have issues because we need to run the
postmortem GC. This commit will guarantee that it runs.
peterzhu2118 (Peter Zhu)
11:13 AM Ruby Revision 34ae1caa (git): Change raise to assertions in test_gc.rb
peterzhu2118 (Peter Zhu)
12:54 AM Ruby Revision 5299d8d1 (git): Dump Hash AR/ST status in ObjectSpace.dump
peterzhu2118 (Peter Zhu)

09/25/2026

08:54 AM Ruby Revision 413145a2 (git): Fix crash in Array#pack when format string modified
If the format string is modified during Array#pack (by conversion such
as to_str, to_int, etc.), it can cause an use-after-free since reading
p[-1] may be an use-after-free. We should read that byte before performing
the conversion.
The...
peterzhu2118 (Peter Zhu)
04:36 AM Ruby Bug #22382: IO#write of a shareable String from multiple Ractors causes use-after-free
Thank you for this bug report. I have a [fix here](https://github.com/ruby/ruby/pull/19023). peterzhu2118 (Peter Zhu)

09/24/2026

11:06 PM Ruby Revision 21017bde (git): Fix race condition crash in IO::Buffer#set_string
For strings larger than or equal to IO_BUFFER_BLOCKING_SIZE (which is 1KB),
IO::Buffer#set_string will perform the memmove without GVL. In this time,
another thread can resize the IO::Buffer object. In that case, the buffer
may be freed ...
peterzhu2118 (Peter Zhu)
08:46 AM Ruby Revision 7d4b5ed5 (git): Fix use-after-free in Marshal.dump
When the string buffer reaches BUFSIZ (8192 bytes), Marshal.dump will call
the write method on the IO object. This IO object can run arbitrary Ruby
code. If the object is a string, it writes the length of the string followed
by the bytes...
peterzhu2118 (Peter Zhu)

09/23/2026

10:00 AM Ruby Revision 4a71c493 (git): [ruby/mmtk] Bump to Rust 2024 edition
https://github.com/ruby/mmtk/commit/2801d95aa4 peterzhu2118 (Peter Zhu)
05:53 AM Ruby Revision 852b2434 (git): Fix use-after-free in String#unpack
If the source string is modified in the block of String#unpack, it can
cause an use-after-free. For example, the following script crashes:
fmt = "A" * 1_000_000
str = "C" * 1_000_000
str.unpack(fmt) { fmt.clear }
peterzhu2118 (Peter Zhu)

Also available in: Atom