[CP] Fix crash when isolates shares and use one RegEx concurrently #51130
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
cherry-pick-approved
Label for approved cherrypick request
merge-to-stable
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
The text was updated successfully, but these errors were encountered: