-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
worker_threads: multiple crashes caused by duplicate objects in transferList #25786
Labels
worker
Issues and PRs related to Worker support.
Comments
chjj
added a commit
to chjj/bthreads
that referenced
this issue
Jan 29, 2019
addaleax
added a commit
to addaleax/node
that referenced
this issue
Jan 30, 2019
Throw a `DataCloneError` exception when encountering duplicate `ArrayBuffer`s or `MessagePort`s in the transfer list. Fixes: nodejs#25786
3 tasks
#25815 should address this – thanks for the issue, and please keep reporting any issues you run into with Workers! :) |
addaleax
added a commit
that referenced
this issue
Feb 1, 2019
Throw a `DataCloneError` exception when encountering duplicate `ArrayBuffer`s or `MessagePort`s in the transfer list. Fixes: #25786 PR-URL: #25815 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm currently creating a
worker_threads
compatability library which seeks to replicateworker_threads
behavior as accurately as possible using thechild_process
module. This has caused me to investigate a number of edge cases with theworker_threads
module.My own implementation question was something like this:
What should happen? Should
postMessage
throw or simply ignore the second entry in the transfer list? It turns out node.js does neither.Example case:
It seems that a duplicate port in the transfer list causes a segfault (I'm sorry I don't currently have a debug build available to provide a stack trace).
Transferring a duplicate array buffer causes a fatal error (at least a bit more descriptive):
Update:
After some more investigating, it looks like the browser throws a
DataCloneError
in both of these edge cases.Duplicate port:
Duplicate array buffer:
The text was updated successfully, but these errors were encountered: