Skip to content

Update - #878

Merged
SebKrantz merged 3 commits into
developmentfrom
master
Aug 30, 2026
Merged

Update #878
SebKrantz merged 3 commits into
developmentfrom
master

Conversation

@SebKrantz

Copy link
Copy Markdown
Member

No description provided.

SebKrantz and others added 3 commits August 11, 2026 00:00
setcopyv() wrote element pointers directly into STRSXP/VECSXP backing
arrays, skipping R's generational write barrier. On an old-generation
target this can leave an unrecorded reference to a younger CHARSXP/list
element, which a subsequent young-generation GC may free while still
referenced, causing memory corruption, cryptic CHAR()/SET_STRING_ELT()
errors, or segfaults.

Use SET_STRING_ELT()/SET_VECTOR_ELT() for the boxed-type write loops so
the reference is properly recorded, while leaving the numeric/raw
branches unchanged. Also drops the omp simd pragma from the boxed
write paths, since the barriered setters are function calls and are not
safely vectorizable.

Co-authored-by: Sebastian Krantz <48053842+SebKrantz@users.noreply.github.com>
Fix: write barrier bypass in setv()/copyv() for STRSXP/VECSXP targets
@SebKrantz
SebKrantz merged commit 5fac845 into development Aug 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant