René's URL Explorer Experiment


Title: buffer,n-api: release external buffers from BackingStore callback by addaleax · Pull Request #33321 · nodejs/node · GitHub

Open Graph Title: buffer,n-api: release external buffers from BackingStore callback by addaleax · Pull Request #33321 · nodejs/node

X Title: buffer,n-api: release external buffers from BackingStore callback by addaleax · Pull Request #33321 · nodejs/node

Description: (The first commit is #33320, split out due to different backportability, hence the blocked label.) Release Buffer and ArrayBuffer instances that were created through our addon APIs and have finalizers attached to them only after V8 has called the deleter callback passed to the BackingStore, instead of relying on our own GC callback(s). This fixes the following race condition: Addon code allocates pointer P via malloc. P is passed into napi_create_external_buffer with a finalization callback which calls free(P). P is inserted into V8’s global array buffer table for tracking. The finalization callback is executed on GC. P is freed and returned to the allocator. P is not yet removed from V8’s global array buffer table. (!) Addon code attempts to allocate memory once again. The allocator returns P, as it is now available. P is passed into napi_create_external_buffer. P still has not been removed from the v8 global array buffer table. The world ends with Check failed: result.second. Since our API contract is to call the finalizer on the JS thread on which the ArrayBuffer was created, but V8 may call the BackingStore deleter callback on another thread, fixing this requires posting a task back to the JS thread. Refs: #32463 (comment) Fixes: #32463 Checklist make -j4 test (UNIX), or vcbuild test (Windows) passes tests and/or benchmarks are included commit message follows commit guidelines

Open Graph Description: (The first commit is #33320, split out due to different backportability, hence the blocked label.) Release Buffer and ArrayBuffer instances that were created through our addon APIs and have finaliz...

X Description: (The first commit is #33320, split out due to different backportability, hence the blocked label.) Release Buffer and ArrayBuffer instances that were created through our addon APIs and have finaliz...

Opengraph URL: https://github.com/nodejs/node/pull/33321

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:8d3da50b-e5d2-808d-e8f7-0cc93e54466b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id94C8:27CA34:7FC3CC:AF1F81:6AEDCBD0
html-safe-nonce835b77b1f2a156c696e405aeb4b91f3ead28a084b7d61b135247a2bfb83a364c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEM4OjI3Q0EzNDo3RkMzQ0M6QUYxRjgxOjZBRURDQkQwIiwidmlzaXRvcl9pZCI6IjkyMTQ5MjIzOTkxNjM0Njg3NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6dba25ebe3a7f64791e79c127a8c992c85021c4377d5d26a98ad70855b6c9f7f
hovercard-subject-tagpull_request:415520460
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
twitter:imagehttps://avatars.githubusercontent.com/u/899444?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/899444?s=400&v=4
og:image:alt(The first commit is #33320, split out due to different backportability, hence the blocked label.) Release Buffer and ArrayBuffer instances that were created through our addon APIs and have finaliz...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef60373873bb1ef795e8511ea1f2a76997e9c649d72b02942aedf2def3423a0ce
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0f55cfa61438c7dc93d1024a1e5e5182b36830e2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F33321%2Fcommits%2F655585c7dbd9735f254319611f62332165baf5ae
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F33321%2Fcommits%2F655585c7dbd9735f254319611f62332165baf5ae
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
Reloadhttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
Reloadhttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues655 (655)https://github.com/nodejs/node/issues
Pull requests664 (664)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
addaleaxhttps://github.com/addaleax
nodejs:masterhttps://github.com/nodejs/node/tree/master
addaleax:buffer-callback-after-backingstore-freehttps://github.com/addaleax/node/tree/buffer-callback-after-backingstore-free
Conversation 13 https://github.com/nodejs/node/pull/33321
Commits 3 https://github.com/nodejs/node/pull/33321/commits
Checks 0 https://github.com/nodejs/node/pull/33321/checks
Files changed https://github.com/nodejs/node/pull/33321/files
Please reload this pagehttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
buffer,n-api: release external buffers from BackingStore callback https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#top
Show all changes 3 commits https://github.com/nodejs/node/pull/33321/files
5d2eeec src: distinguish refed/unrefed threadsafe Immediates addaleax May 9, 2020 https://github.com/nodejs/node/pull/33321/commits/5d2eeece3aa94be0dd2d49d9640c318db661e888
655585c buffer,n-api: release external buffers from BackingStore callback addaleax May 9, 2020 https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
d33de7a fixup! buffer,n-api: release external buffers from BackingStore callback addaleax May 10, 2020 https://github.com/nodejs/node/pull/33321/commits/d33de7ac7a035eef411c9f882c41759b780b83eb
Clear filters https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
Please reload this pagehttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
Please reload this pagehttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
js_native_api_v8.cc https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-4b35cbf831be523a4f3e5aac3729c95490ed220892695d0e4245c15c1f63cfc1
node_buffer.cc https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
binding.cc https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-e5c6686f857a1bf19fae6c018d3e6eaa840965d1099716ac34094ca440c2f3a9
test.js https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-f38a1c261469563c0afec418d9b074a8ac2faafb4be0d392afa4ee8cf76c6675
test.js https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-46cbe3f4e793d86c3c7d02981682cc08dfb98fcbed3cafb8d8af991642b819f4
Prev https://github.com/nodejs/node/pull/33321/commits/5d2eeece3aa94be0dd2d49d9640c318db661e888
Next https://github.com/nodejs/node/pull/33321/commits/d33de7ac7a035eef411c9f882c41759b780b83eb
#32463 (comment)https://github.com/nodejs/node/issues/32463#issuecomment-625877175
#32463https://github.com/nodejs/node/issues/32463
Please reload this pagehttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae
https://github.com/addaleax
addaleaxhttps://github.com/nodejs/node/commits?author=addaleax
src/js_native_api_v8.cchttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-4b35cbf831be523a4f3e5aac3729c95490ed220892695d0e4245c15c1f63cfc1
View file https://github.com/addaleax/node/blob/655585c7dbd9735f254319611f62332165baf5ae/src/js_native_api_v8.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/33321/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-4b35cbf831be523a4f3e5aac3729c95490ed220892695d0e4245c15c1f63cfc1
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-4b35cbf831be523a4f3e5aac3729c95490ed220892695d0e4245c15c1f63cfc1
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-4b35cbf831be523a4f3e5aac3729c95490ed220892695d0e4245c15c1f63cfc1
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-4b35cbf831be523a4f3e5aac3729c95490ed220892695d0e4245c15c1f63cfc1
src/node_buffer.cchttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
View file https://github.com/addaleax/node/blob/655585c7dbd9735f254319611f62332165baf5ae/src/node_buffer.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/33321/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-81f77f34c4f5b8cc35f1a506808b94e2a281f3341c0f1a38ef2b8a8ba730b22b
test/addons/null-buffer-neuter/binding.cchttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-e5c6686f857a1bf19fae6c018d3e6eaa840965d1099716ac34094ca440c2f3a9
View file https://github.com/addaleax/node/blob/655585c7dbd9735f254319611f62332165baf5ae/test/addons/null-buffer-neuter/binding.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/33321/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-e5c6686f857a1bf19fae6c018d3e6eaa840965d1099716ac34094ca440c2f3a9
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-e5c6686f857a1bf19fae6c018d3e6eaa840965d1099716ac34094ca440c2f3a9
test/addons/null-buffer-neuter/test.jshttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-f38a1c261469563c0afec418d9b074a8ac2faafb4be0d392afa4ee8cf76c6675
View file https://github.com/addaleax/node/blob/655585c7dbd9735f254319611f62332165baf5ae/test/addons/null-buffer-neuter/test.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/33321/commits/{{ revealButtonHref }}
test/node-api/test_buffer/test.jshttps://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-46cbe3f4e793d86c3c7d02981682cc08dfb98fcbed3cafb8d8af991642b819f4
View file https://github.com/addaleax/node/blob/655585c7dbd9735f254319611f62332165baf5ae/test/node-api/test_buffer/test.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/33321/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/33321/commits/655585c7dbd9735f254319611f62332165baf5ae#diff-46cbe3f4e793d86c3c7d02981682cc08dfb98fcbed3cafb8d8af991642b819f4
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.