Skip to content

[CP] Fix crash when isolates shares and use one RegEx concurrently #51130

Closed
@aam

Description

@aam

Commit(s) to merge

438b81c, 4275d59

Target

both

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/279747

Issue Description

RegEx runtime execution state was incorrectly shared between isolates, which resulted in one isolate potentially affecting another by overwriting currently running RegEx execution state(backtracking stack, etc). If one has long running RegEx, that probability of a crash increases significantly.

What is the fix

First commit disables sharing of RegEx completely, fixing the crash, but regressing the performance of sending RegEx across isolates.
Second commit restored fast RegEx sharing, making sure that runtime state(backtracking stack and others) are kept local to every isolate.

Why cherry-pick

The fix missed the window for 2.19.0, users would like the fix to be available on stable.

Risk

medium

Issue link(s)

#50082

Extra Info

No response

Metadata

Metadata

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.cherry-pick-approvedLabel for approved cherrypick requestmerge-to-stable

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions