Stream: git-wasmtime

Topic: wasmtime / PR #13450 Keep source/destination arrays alive...


view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 15:39):

vouillon requested fitzgen for a review on PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 15:39):

vouillon requested wasmtime-compiler-reviewers for a review on PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 15:39):

vouillon requested wasmtime-core-reviewers for a review on PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 15:39):

vouillon opened PR #13450 from vouillon:array-copy-fix to bytecodealliance:main:

translate_per_element_copy derives raw src_elem_addr / dst_elem_addr pointers once and uses only those raw pointers inside the per-element forward/backward loop. As a result, the original source and destination array gc-refs are dead in CLIF after the address computation and are not in the stack maps at safe points inside the loop.

This was harmless until the DRC collector started firing force_gc from inside the read barrier when the over-approximated-stack-roots list grew past 1024 entries (https://github.com/bytecodealliance/wasmtime/pull/13422). At that point, a GC could run mid-copy with neither the source nor the destination array marked from any frame's stack map. Sweep could then free the arrays out from under the copy.

Fix this by extracting the array gc-refs from the source and destination entities (when they are arrays) and threading them through the loop's forward and backward iteration blocks as block parameters. After the fix, the stack map at the in-barrier force_gc inside array.copy's loop lists the source and destination arrays in addition to the freshly-read element.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 15:43):

vouillon updated PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 16:32):

vouillon updated PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 17:48):

:thumbs_up: fitzgen submitted PR review:

Good catch, thanks!

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2026 at 17:49):

fitzgen commented on PR #13450:

Looks like this has some conflicts that need to be resolved before it can merge.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2026 at 16:42):

vouillon updated PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 23 2026 at 20:43):

vouillon updated PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 17:09):

fitzgen added PR #13450 Keep source/destination arrays alive across array.copy's per-element loop to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 19:14):

github-merge-queue[bot] removed PR #13450 Keep source/destination arrays alive across array.copy's per-element loop from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 19:45):

fitzgen added PR #13450 Keep source/destination arrays alive across array.copy's per-element loop to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 20:34):

github-merge-queue[bot] removed PR #13450 Keep source/destination arrays alive across array.copy's per-element loop from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 20:47):

fitzgen added PR #13450 Keep source/destination arrays alive across array.copy's per-element loop to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 21:29):

fitzgen removed PR #13450 Keep source/destination arrays alive across array.copy's per-element loop from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 21:29):

fitzgen added PR #13450 Keep source/destination arrays alive across array.copy's per-element loop to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 21:53):

:check: fitzgen merged PR #13450.

view this post on Zulip Wasmtime GitHub notifications bot (May 26 2026 at 21:53):

fitzgen removed PR #13450 Keep source/destination arrays alive across array.copy's per-element loop from the merge queue.


Last updated: Jun 01 2026 at 09:49 UTC