Title: ffi: toArrayBuffer() aborts on allocation failure instead of throwing · Issue #66405 · nodejs/node · GitHub
Open Graph Title: ffi: toArrayBuffer() aborts on allocation failure instead of throwing · Issue #66405 · nodejs/node
X Title: ffi: toArrayBuffer() aborts on allocation failure instead of throwing · Issue #66405 · nodejs/node
Description: Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { toBuffer, toArrayBuffer } from 'node:ffi'; try { toBuffer(1n, 2 ** 50); } catch (e) { console.log(e.code); } try { toArrayBuffer(1n, 2 ** 50); }...
Open Graph Description: Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { toBuffer, toArrayBuffer } from 'node:ffi'; try { toBuffer(1n, 2 ** 50); } catch (e) { console.log(e.code...
X Description: Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { toBuffer, toArrayBuffer } from 'node:ffi'; try { toBuffer(1n, 2 ** 50); } catch (e) { console.lo...
Opengraph URL: https://github.com/nodejs/node/issues/66405
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ffi: toArrayBuffer() aborts on allocation failure instead of throwing","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS 26.7.0\n```\n\n### Subsystem\n\nffi\n\n### What steps will reproduce the bug?\n\n```js\nimport { toBuffer, toArrayBuffer } from 'node:ffi';\n\ntry { toBuffer(1n, 2 ** 50); } catch (e) { console.log(e.code); }\ntry { toArrayBuffer(1n, 2 ** 50); } catch (e) { console.log(e.code); }\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nBoth calls throw a catchable `ERR_MEMORY_ALLOCATION_FAILED`, as `ffi.toBuffer()` already does:\n\n```text\nERR_MEMORY_ALLOCATION_FAILED\nERR_MEMORY_ALLOCATION_FAILED\n```\n\n\n### What do you see instead?\n\n`ffi.toBuffer()` throws, but `ffi.toArrayBuffer()` aborts the process (exit code 134):\n\n```text\nERR_MEMORY_ALLOCATION_FAILED\nFATAL ERROR: v8::ArrayBuffer::NewBackingStore Allocation failed - process out of memory\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-09-30T06:32:03Z","url":"https://github.com/nodejs/node/issues/66405"}
| react-profiling | 0 |
| react-import-map | react,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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb6a9f70-76cc-1176-ad9e-67c42550c8c0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C02E:37E5F9:7B79E:A2218:6AED046D |
| html-safe-nonce | 7b6a567a7246be84bb0036b02f87a506d0e7721724bc75a47ebd8645d82b4030 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDJFOjM3RTVGOTo3Qjc5RTpBMjIxODo2QUVEMDQ2RCIsInZpc2l0b3JfaWQiOiIxNjk3MjI0MTgwNzAxNjYwMjY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 75a4fbc702731f427459656738bfef8a256f22ff8ec7410b4e85ee7e09157663 |
| hovercard-subject-tag | issue:5642090867 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66405/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fbccc3f9760abdca5ef3993bb1bc5952f7f2fa129c5f631049b07e6082ff646b/nodejs/node/issues/66405 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fbccc3f9760abdca5ef3993bb1bc5952f7f2fa129c5f631049b07e6082ff646b/nodejs/node/issues/66405 |
| og:image:alt | Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { toBuffer, toArrayBuffer } from 'node:ffi'; try { toBuffer(1n, 2 ** 50); } catch (e) { console.log(e.code... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 21e10c535436b2122cfb44c76dfb4af296e371850fb60de16776f8a64e5c3ed8 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 302a6d707c3288a5f951258a2fa3e926b8c8f8cf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width