-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src,worker: fix race of WorkerHeapSnapshotTaker #44745
Conversation
test/sequential/test-watch-mode.mjs failed. However, it is a known issue, fixed in #44739 |
@addaleax Could you help moving this PR forward? |
Any WorkerHeapSnapshotTaker instance should be fully owned by main thread. Remove buggy access to it from the worker thread.
aa28fc3
to
76845e1
Compare
Hey, any idea? :) |
Shall we proceed to get this PR landed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; I'm AFK, unless someone else is faster than me. I will land this one. Thanks for this 💚
Another 3 failure of running |
Landed in 66cedb4 |
Any WorkerHeapSnapshotTaker instance should be fully owned by main thread. Remove buggy access to it from the worker thread. PR-URL: #44745 Fixes: #44515 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
Fix: #44515 #39686
maybe more... there are serval crash reports about
worker heap snapshot
With one extra line of code, this concurency bug can be easily demonstrated and reproduced.
Since
BaseObjectPtr
is not thread safe(no synchronization around checking and manipulating the refcnt), the fix is to ensureWorkerHeapSnapshotTaker
is not shared by worker thread and main thread