Skip to content
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: fix crash when SharedArrayBuffer outlives creating thread #29190

Conversation

addaleax
Copy link
Member

Keep a reference to the ArrayBuffer::Allocator alive for at least
as long as a SharedArrayBuffer allocated by it lives.

The tests are taken 1:1 from #28788.

Refs: #28788
Fixes: #28777
Fixes: #28773

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Keep a reference to the `ArrayBuffer::Allocator` alive for at least
as long as a `SharedArrayBuffer` allocated by it lives.

Refs: nodejs#28788
Fixes: nodejs#28777
Fixes: nodejs#28773
@addaleax addaleax added the worker Issues and PRs related to Worker support. label Aug 17, 2019
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Aug 17, 2019
@addaleax addaleax removed the lib / src Issues and PRs related to general changes in the lib or src directory. label Aug 17, 2019
@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 19, 2019
@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member Author

Landed in 119c4cc

@addaleax addaleax closed this Aug 19, 2019
addaleax added a commit that referenced this pull request Aug 19, 2019
Keep a reference to the `ArrayBuffer::Allocator` alive for at least
as long as a `SharedArrayBuffer` allocated by it lives.

Refs: #28788
Fixes: #28777
Fixes: #28773

PR-URL: #29190
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@addaleax addaleax deleted the worker-sharedarraybuffer-childthread-2 branch August 19, 2019 23:00
targos pushed a commit that referenced this pull request Aug 20, 2019
Keep a reference to the `ArrayBuffer::Allocator` alive for at least
as long as a `SharedArrayBuffer` allocated by it lives.

Refs: #28788
Fixes: #28777
Fixes: #28773

PR-URL: #29190
Reviewed-By: James M Snell <[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
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segfault when using SharedArrayBuffer from an unrefed worker thread Access Violation
4 participants