René's URL Explorer Experiment


Title: Abort "Lazy deopt after a fast API call with return value is unsupported" in Buffer.byteLength called from maybePrepareFinalChunk / res.end(string) · Issue #66870 · nodejs/node · GitHub

Open Graph Title: Abort "Lazy deopt after a fast API call with return value is unsupported" in Buffer.byteLength called from maybePrepareFinalChunk / res.end(string) · Issue #66870 · nodejs/node

X Title: Abort "Lazy deopt after a fast API call with return value is unsupported" in Buffer.byteLength called from maybePrepareFinalChunk / res.end(string) · Issue #66870 · nodejs/node

Description: Version v26.10.0 (node-26.10.0-linux-x64 from actions/setup-node@v5). The same abort also occurred on 2026-08-28 in a second CI run on the then-current 26.x build, so it is not a one-off. Platform Linux 6.x x64 (GitHub Actions ubuntu-lat...

Open Graph Description: Version v26.10.0 (node-26.10.0-linux-x64 from actions/setup-node@v5). The same abort also occurred on 2026-08-28 in a second CI run on the then-current 26.x build, so it is not a one-off. Platform ...

X Description: Version v26.10.0 (node-26.10.0-linux-x64 from actions/setup-node@v5). The same abort also occurred on 2026-08-28 in a second CI run on the then-current 26.x build, so it is not a one-off. Platform ...

Opengraph URL: https://github.com/nodejs/node/issues/66870

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Abort \"Lazy deopt after a fast API call with return value is unsupported\" in Buffer.byteLength called from maybePrepareFinalChunk / res.end(string)","articleBody":"### Version\r\n\r\n`v26.10.0` (`node-26.10.0-linux-x64` from `actions/setup-node@v5`).\r\n\r\nThe same abort also occurred on 2026-08-28 in a second CI run on the then-current 26.x build, so it is not a one-off.\r\n\r\n### Platform\r\n\r\n```text\r\nLinux 6.x x64 (GitHub Actions ubuntu-latest runner)\r\n```\r\n\r\nAll local attempts to reproduce on Windows 11 x64 with `v26.10.0` and `v26.12.0` failed (details below).\r\n\r\n### Subsystem\r\n\r\n`http` / `buffer` (V8 fast API call inside `Buffer.byteLength`, reached from `_http_outgoing`).\r\n\r\n### What steps will reproduce the bug?\r\n\r\nThere is no standalone minimal repro yet - this is the report of a real production abort with a complete V8 stack. The reproducing workload is a Vite dev server under sustained browser traffic:\r\n\r\n1. Run `vite` (8.3.4) on Linux with Node 26.10.0.\r\n2. Load a page that pulls a large pre-bundled dependency chunk. In this case `node_modules/.vite/deps/lib-*.js` is 17,416,067 bytes; Vite's `send` helper appends an inline source map, producing a `String[43640789]`.\r\n3. Drive continuous Playwright traffic for roughly ten minutes (261 browser tests hitting the dev server).\r\n4. The dev-server process aborts and every later connection fails with `net::ERR_CONNECTION_REFUSED`.\r\n\r\nThe abort itself:\r\n\r\n```text\r\nabort: Lazy deopt after a fast API call with return value is unsupported\r\n\r\n==== JS stack trace =========================================\r\n\r\n    0: ExitFrame [pc: 0x7f49dce3ea76]\r\n    1: byteLength [0x3fc66a4d8b91] [node:buffer:923] [bytecode=0xe4e3e6b3dc1 offset=88](this=0x3fc66a4d72e1 \u003cJSFunction Buffer (sfi = 0x385470d41a39)>#0#,0x3ba819d309a1 \u003cString[43640789]: uc\"...\u003ctruncated>>\">#1#,0x36331f5c0011 \u003cundefined>)\r\n    2: maybePrepareFinalChunk(aka maybePrepareFinalChunk) [0x67fc7c1ba61] [node:_http_outgoing:1069] [bytecode=0x1de7ebdcd5d1 offset=58](this=0x36331f5c0011 \u003cundefined>,0x3ba819d357d9 \u003cServerResponse map = 0x25850d03f771>#2#,0x3ba819d309a1 \u003cString[43640789]: uc\"...\u003ctruncated>>\">#1#,0x36331f5c0011 \u003cundefined>)\r\n    3: end [0x67fc7c1e8b9] [node:_http_outgoing:1197] [bytecode=0x1de7ebdcd0b1 offset=117](this=0x3ba819d357d9 \u003cServerResponse map = 0x25850d03f771>#2#,0x3ba819d309a1 \u003cString[43640789]: uc\"...\u003ctruncated>>\">#1#,0x36331f5c0011 \u003cundefined>,0x36331f5c0011 \u003cundefined>)\r\n    4: send$1(aka send$1) [0x1b9f12a631e9] [file:///home/runner/work/\u003crepo>/node_modules/vite/dist/node/chunks/node.js:~17519] [pc=0x7f49bd3567a7](...)\r\n    5: viteTransformMiddleware [file:///home/runner/work/\u003crepo>/node_modules/vite/dist/node/chunks/node.js:~20159]\r\n```\r\n\r\nFrame 1 is Node's own `Buffer.byteLength` (`node:buffer:923`) and frame 2 is Node's `maybePrepareFinalChunk` (`node:_http_outgoing:1069`), whose source is captured in the report:\r\n\r\n```js\r\nfunction maybePrepareFinalChunk(msg, chunk, encoding) {\r\n  if (typeof chunk !== 'string' && !isUint8Array(chunk))\r\n    return false;\r\n\r\n  if (msg.destroyed || msg.strictContentLength)\r\n    return false;\r\n\r\n  if (!msg._header) {\r\n    msg._contentLength = typeof chunk === 'string' ?\r\n      Buffer.byteLength(chunk, encoding) : chunk.byteLength\r\n```\r\n\r\nSo the aborting path is `res.end(string)` with `msg._header` unset, which calls `Buffer.byteLength(hugeString, undefined)`.\r\n\r\n### How often does it reproduce? Is there a required condition?\r\n\r\nTwice in two CI runs on Linux x64, roughly ten minutes into sustained dev-server traffic. It did not reproduce in short bursts.\r\n\r\nI could not reproduce it locally on Windows 11 x64, with either `v26.10.0` or `v26.12.0`, using:\r\n\r\n- 300 sequential `res.end()` responses of a 43.6 MB string;\r\n- 3,000 responses of a 1 MB string alternating with a `Buffer` and with `res.end(string, 'utf8')` to vary the call site;\r\n- 2,800 requests for the real 43.8 MB Vite dev-server chunk (the same `send` path as the crash) over keep-alive sockets;\r\n- the same runs with `--deopt-every-n-times=3` to force deopts at deopt points.\r\n\r\nSo the trigger appears to need more than \"a large string through `res.end`\" - possibly the specific optimized-code state of the Vite middleware chain on the CI runner, or a longer warm-up than a few thousand requests.\r\n\r\n### What is the expected behavior? Why is that the expected behavior?\r\n\r\nServing a large string with `res.end()` should never abort the process. Payload size and repetition may cost memory and CPU, but a correct runtime either deoptimizes or keeps the optimized code; it does not terminate.\r\n\r\n### What do you see instead?\r\n\r\nThe process aborts with `Lazy deopt after a fast API call with return value is unsupported`, killing the server mid-suite.\r\n\r\n### Additional information\r\n\r\nThe fatal string is a V8 bailout reason, `v8/src/codegen/bailout-reason.h`:\r\n\r\n```text\r\n\"Lazy deopt after a fast API call with return value is unsupported\"\r\n```\r\n\r\nand `Buffer.byteLength` is exactly a fast API call with a return value, per `src/node_buffer.cc`:\r\n\r\n```cpp\r\nuint32_t FastByteLengthUtf8(...) {\r\nTRACK_V8_FAST_API_CALL(\"Buffer::FastByteLengthUtf8\");\r\nstatic CFunction fast_byte_length_utf8(CFunction::Make(FastByteLengthUtf8));\r\n```\r\n\r\nThe corresponding V8 work item is \"Add deopt support after fast api calls with return values\" (https://issues.chromium.org/issues/418936518), so this may be a V8 limitation that Node surfaces. Filing here because the aborting frame is Node's `_http_outgoing` code and the call is Node's own `Buffer.byteLength`, and because the practical fix may be on the Node side.\r\n\r\nOur workaround, in case it is useful for triage, is to make the caller hand Node bytes so the fast API is not on the path (`res.end(Buffer.from(content))` instead of `res.end(content)`); with that in place the dev server survives the same workload.\r\n\r\nIf a standalone reproduction is required before this is actionable, I am happy to run a loop on a Linux runner against a candidate commit - please say which shape you want (for example a `node:test` server plus a client loop, or a V8 `d8` snippet) and I will provide it.\r\n","author":{"url":"https://github.com/jakesalvesen","@type":"Person","name":"jakesalvesen"},"datePublished":"2026-10-20T05:31:06Z","url":"https://github.com/nodejs/node/issues/66870"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cac79db6-0fbb-f247-1d70-b83cdb58ce7b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC54C:1CF1FE:4E329:6B7E4:6AFBF536
html-safe-nonce016437e6405efd2229429d5665e3f246832bca27b91490236564db223958d511
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTRDOjFDRjFGRTo0RTMyOTo2QjdFNDo2QUZCRjUzNiIsInZpc2l0b3JfaWQiOiI2NzUzMTcwMzcyMDAzODg2MzkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac5b8e7d6aa0fc8e082ae2a84539f5507186f4b06dffe18be4a12c266280975e85
hovercard-subject-tagissue:5936486191
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66870/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0aedd69fc9effaebcd56d405bcb45fc2b656bc0b3ddd82558d140d45142a3292/nodejs/node/issues/66870
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0aedd69fc9effaebcd56d405bcb45fc2b656bc0b3ddd82558d140d45142a3292/nodejs/node/issues/66870
og:image:altVersion v26.10.0 (node-26.10.0-linux-x64 from actions/setup-node@v5). The same abort also occurred on 2026-08-28 in a second CI run on the then-current 26.x build, so it is not a one-off. Platform ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejakesalvesen
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/66870#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F66870
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%2Fissues%2F66870
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/66870
Reloadhttps://github.com/nodejs/node/issues/66870
Reloadhttps://github.com/nodejs/node/issues/66870
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues644 (644)https://github.com/nodejs/node/issues
Pull requests679 (679)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
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66870
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66870
Abort "Lazy deopt after a fast API call with return value is unsupported" in Buffer.byteLength called from maybePrepareFinalChunk / res.end(string)https://github.com/nodejs/node/issues/66870#top
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issue-5936486191
https://issues.chromium.org/issues/418936518https://issues.chromium.org/issues/418936518
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6284222716
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6284325523
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6284332887
https://github.com/lazerg
lazerghttps://github.com/lazerg
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6284734674
517cf1bhttps://github.com/v8/v8/commit/517cf1be837f699552dd495645cf02db735ddc6b
FastByteLengthUtf8https://github.com/nodejs/node/blob/531d28fc360bd40b427561b1f85fd18743138626/src/node_buffer.cc#L829-L851
V8's fast API ruleshttps://github.com/v8/v8/blob/ab724c3c6ac0e8384aa2fafabc24f7dc0ad463a8/include/v8-fast-api-calls.h#L24-L27
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6285000219
517cf1bhttps://github.com/nodejs/node/commit/517cf1bdbcaba03e71a7d586ab839f5145e739c6
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Oct 20, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6285271718
nodejs-github-bothttps://github.com/nodejs-github-bot
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
bf246cfhttps://github.com/nodejs/node/commit/bf246cf4b5b157c81a093f1feb9c9c814d030b2f
on Nov 1, 2026https://github.com/nodejs/node/issues/66870#event-34821432589
opensource-fork-synchttps://github.com/apps/opensource-fork-sync
on Nov 1, 2026https://github.com/nodejs/node/issues/66870#event-34824406524
buffer: limit UTF-8 fast calls to safe one-byte stringshttps://github.com/cla7aye15I4nd/opensource-nodejs__node/commit/bf246cf4b5b157c81a093f1feb9c9c814d030b2f
bf246cfhttps://github.com/cla7aye15I4nd/opensource-nodejs__node/commit/bf246cf4b5b157c81a093f1feb9c9c814d030b2f
https://github.com/jakesalvesen
jakesalvesenhttps://github.com/jakesalvesen
on Nov 1, 2026https://github.com/nodejs/node/issues/66870#issuecomment-6562415378
@ronaghttps://github.com/ronag
#67136https://github.com/nodejs/node/pull/67136
@lazerghttps://github.com/lazerg
aduh95https://github.com/aduh95
on Nov 11, 2026https://github.com/nodejs/node/issues/66870#event-35823368911
buffer: limit UTF-8 fast calls to safe one-byte stringshttps://github.com/nodejs/node/commit/faf48bfc07cb932fc3438f7867b5a1644e7f3aec
faf48bfhttps://github.com/nodejs/node/commit/faf48bfc07cb932fc3438f7867b5a1644e7f3aec
buffer: limit UTF-8 fast calls to safe one-byte stringshttps://github.com/nodejs/node/commit/ba50acec27f8c4f560e62a82d7569ef5e51c48ca
ba50acehttps://github.com/nodejs/node/commit/ba50acec27f8c4f560e62a82d7569ef5e51c48ca
dasunNimanthahttps://github.com/dasunNimantha
on Nov 17, 2026https://github.com/nodejs/node/issues/66870#event-36369008312
zlib: avoid flattening strings in crc32 fast pathhttps://github.com/dasunNimantha/node/commit/c3b5553e82bca3b5b666878506d70dde1dbebc33
c3b5553https://github.com/dasunNimantha/node/commit/c3b5553e82bca3b5b666878506d70dde1dbebc33
url: avoid flattening strings in canParse fast pathhttps://github.com/dasunNimantha/node/commit/84c4ae6d71798e594f7a97b62189955c8d008f72
84c4ae6https://github.com/dasunNimantha/node/commit/84c4ae6d71798e594f7a97b62189955c8d008f72
test: add test for GC in value-returning fast API callshttps://github.com/dasunNimantha/node/commit/e532d0532d9448b55287f813c76bf0bee24b77b9
e532d05https://github.com/dasunNimantha/node/commit/e532d0532d9448b55287f813c76bf0bee24b77b9
zlib: avoid flattening strings in crc32 fast pathhttps://github.com/dasunNimantha/node/commit/3f17c06e529ab9ef9f6249c6eea439b0149a7f7d
3f17c06https://github.com/dasunNimantha/node/commit/3f17c06e529ab9ef9f6249c6eea439b0149a7f7d
url: avoid flattening strings in canParse fast pathhttps://github.com/dasunNimantha/node/commit/3d4b61974582892493b1beb13e1ca176b8f5bf22
3d4b619https://github.com/dasunNimantha/node/commit/3d4b61974582892493b1beb13e1ca176b8f5bf22
test: add test for GC in value-returning fast API callshttps://github.com/dasunNimantha/node/commit/e2157b989aca3cbbcfc88f912b5270fbd30ff2cd
e2157b9https://github.com/dasunNimantha/node/commit/e2157b989aca3cbbcfc88f912b5270fbd30ff2cd
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/66870
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/66870
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.