Title: ffi: DynamicLibrary getters crash on incompatible receivers · Issue #65287 · nodejs/node · GitHub
Open Graph Title: ffi: DynamicLibrary getters crash on incompatible receivers · Issue #65287 · nodejs/node
X Title: ffi: DynamicLibrary getters crash on incompatible receivers · Issue #65287 · nodejs/node
Description: Version main Platform macOS 26.6.1 Subsystem ffi What steps will reproduce the bug? repro.c #include
Open Graph Description: Version main Platform macOS 26.6.1 Subsystem ffi What steps will reproduce the bug? repro.c #include
X Description: Version main Platform macOS 26.6.1 Subsystem ffi What steps will reproduce the bug? repro.c #include <stdint.h> int add(int a, int b) { return a + b; } repro.js import { DynamicLibrary, suffi...
Opengraph URL: https://github.com/nodejs/node/issues/65287
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ffi: DynamicLibrary getters crash on incompatible receivers","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS 26.6.1\n```\n\n### Subsystem\n\nffi\n\n### What steps will reproduce the bug?\n\n`repro.c`\n```c\n#include \u003cstdint.h>\n\nint add(int a, int b) {\n return a + b;\n}\n```\n\n`repro.js`\n```js\nimport { DynamicLibrary, suffix } from 'node:ffi';\n\nconst name = process.argv[2] || 'path';\nconst lib = new DynamicLibrary(`./repro.${suffix}`);\n\nconst owner = name === 'functions' ? DynamicLibrary.prototype : lib;\nconst getter = Object.getOwnPropertyDescriptor(owner, name).get;\n\ngetter.call({});\n```\n\nCommands to run:\n```console\ncc -dynamiclib repro.c -o repro.dylib\n\nnode --experimental-ffi repro.js path\nnode --experimental-ffi repro.js symbols\nnode --experimental-ffi repro.js functions\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\nIt should instead throw a JavaScript `TypeError`, such as “Illegal invocation” or “Invalid receiver,” without terminating the process.\n\n### What do you see instead?\n\nEach extracted getter crashes the Node.js process when called with an incompatible receiver, with either `segmentation fault` or `bus error`\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-08-14T15:00:56Z","url":"https://github.com/nodejs/node/issues/65287"}
| 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:e8648eea-9aa1-46b1-2400-ce2e00ece6e9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE82:A3A4:6E640B:97B2C7:6AED474D |
| html-safe-nonce | 6fd24d709b33d24d2a1b14f751410a025accc9b6f1b827315c9702e80552227b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTgyOkEzQTQ6NkU2NDBCOjk3QjJDNzo2QUVENDc0RCIsInZpc2l0b3JfaWQiOiI2OTQ2NTU3MDAzOTkxNjk3MjI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8913fa4d23e01f4f96181c623376c646715e339699845e64d76277c89b35a042 |
| hovercard-subject-tag | issue:5152971845 |
| 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/65287/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e21386822047fcc55fe96d631b253eff9f9c98e8c08a15ca1865e6f60727ca5d/nodejs/node/issues/65287 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e21386822047fcc55fe96d631b253eff9f9c98e8c08a15ca1865e6f60727ca5d/nodejs/node/issues/65287 |
| og:image:alt | Version main Platform macOS 26.6.1 Subsystem ffi What steps will reproduce the bug? repro.c #include |
| 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 | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| 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 | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width