General

Profile

peterzhu2118 (Peter Zhu)

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

Issues

open closed Total
Assigned issues 0 33 33
Reported issues 1 80 81

Projects

Project Roles Registered on
Ruby Committer 03/24/2021

Activity

Today

05:18 AM Ruby Revision 87e70777 (git): Fix memory leak in String#each_grapheme_cluster
If the block raises or breaks in String#each_grapheme_cluster, then the
compiled regexp can leak memory because it is never freed.
For example, the following code leaks memory:
s = "abc".encode("UTF-16LE")
10.times do
10_...
peterzhu2118 (Peter Zhu)
12:52 AM Ruby Revision a76ddf54 (git): Check if orig modified in rb_str_tmp_frozen_release
The string orig could have been modified by the time rb_str_tmp_frozen_release
is called which would incorrectly modify orig. This can cause crashes.
Each of the tests in this commit demonstrates a crash from users of
rb_str_tmp_frozen_r...
peterzhu2118 (Peter Zhu)

11/22/2026

12:54 PM Ruby Bug #21203 (Closed): TestGc#test_gc_parameter_init_slots is flaky results
peterzhu2118 (Peter Zhu)
01:08 AM Ruby Revision 297f4b25 (git): Fix use-after-free in Array#sort! when tmp shared
Array#sort! makes ary shared and tmp the shared root. The assumption is
that tmp is never referred to by any object other than ary. However, if
ary is sliced, than another array would also refer to tmp. This can cause
an use-after-free w...
peterzhu2118 (Peter Zhu)

11/20/2026

03:45 AM Ruby Revision 88e0be34 (git): Fix missing write-barrier in Array#sort!
Since ary takes over tmp's buffer in Array#sort!, it ary needs to be remembered
otherwise if ary is old and tmp is young, then the objects in tmp can get
garbage collected in the next GC cycle.
The following script reproduces the issue:...
peterzhu2118 (Peter Zhu)
12:39 AM Ruby Revision 966eaa89 (git): Fix negative character length in String#tr
If the receiving string is modified during the to_str call on the hash keys
and values, then it could cache stale encoding and coderange, which could
give negative character lengths.
For example, the following code reproduces the issue:...
peterzhu2118 (Peter Zhu)

11/19/2026

11:57 PM Ruby Revision df9e4249 (git): Consistently use unsigned int for param and local size
iseq param_size and local_size are all unsigned ints, so we should use
unsigned int consistently.
peterzhu2118 (Peter Zhu)
01:09 PM Ruby Revision 1e71e987 (git): Add TEST_BUNDLED_GEMS_ALLOW_FAILURES for Windows CI
Also skips failing test repl_type_completor like in 2979ed4. peterzhu2118 (Peter Zhu)
07:14 AM Ruby Revision 2e6b197f (git): Fix tailcall optimization with ... arguments
With tailcall optimization enabled, ... argument forwarding incorrectly
used the first argument as the parameter count.
For example, the following code crashes:
def bar(*a) = a
def foo(...)
bar(...)
end
RubyVM::In...
peterzhu2118 (Peter Zhu)

11/18/2026

10:02 PM Ruby Revision a4beace1 (git): Fix buffer overflow in Thread with certain symbol procs
Passing send symbol proc into a Thread will cause a buffer overflow where
it will read past the VM stack.
For example, the following script crashes in ASAN:
p Thread.new(1, :to_s, &:send).value
Crashes with:
ERROR: AddressSan...
peterzhu2118 (Peter Zhu)

Also available in: Atom