Skip to content

🐛 fix(dom, xslt): lock subtree copies#635

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/cross-tree-copy-lock
Jul 10, 2026
Merged

🐛 fix(dom, xslt): lock subtree copies#635
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/cross-tree-copy-lock

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Jul 10, 2026

Copy link
Copy Markdown
Member

th_tree_copy_node read mutable source nodes without holding their tree handles. Concurrent attribute writes could pair a copied pointer with a length from another source state; the 3.14t reproducer returned one L where only s or 4,096 L characters were valid.

Acquire source and destination handles with the ordered two-object critical section during adoption. Standalone DOM copies and stylesheet merges lock their source handles, while XSLT execution locks both the source and stylesheet. The copy remains a single arena pass; GIL builds preprocess the new handle expressions away.

@gaborbernat gaborbernat added the bug Something isn't working label Jul 10, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 93 untouched benchmarks
⏩ 18 skipped benchmarks1


Comparing gaborbernat:fix/cross-tree-copy-lock (ab4801b) with main (6809125)

Open in CodSpeed

Footnotes

  1. 18 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Free-threaded copies read mutable source trees without holding their critical
sections. Lock source and destination handles together during adoption, and
lock standalone DOM and stylesheet copies at the source.
@gaborbernat gaborbernat force-pushed the fix/cross-tree-copy-lock branch from 94db8bd to ab4801b Compare July 10, 2026 22:04
@gaborbernat gaborbernat changed the title 🐛 fix(dom, xslt): lock mutable subtree copies 🐛 fix(dom, xslt): lock subtree copies Jul 10, 2026
@gaborbernat gaborbernat merged commit 16fff0d into tox-dev:main Jul 10, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant