Title: ffi: segfault when a signature getter closes the library in getFunction() · Issue #66367 · nodejs/node · GitHub
Open Graph Title: ffi: segfault when a signature getter closes the library in getFunction() · Issue #66367 · nodejs/node
X Title: ffi: segfault when a signature getter closes the library in getFunction() · Issue #66367 · nodejs/node
Description: Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; const lib = new DynamicLibrary(process.argv[2]); lib.getFunction('add_i32', { arguments: ['i32', 'i32'], retur...
Open Graph Description: Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; const lib = new DynamicLibrary(process.argv[2]); lib.getFunction('add_...
X Description: Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; const lib = new DynamicLibrary(process.argv[2]); lib.getFuncti...
Opengraph URL: https://github.com/nodejs/node/issues/66367
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ffi: segfault when a signature getter closes the library in getFunction()","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 { DynamicLibrary } from 'node:ffi';\nconst lib = new DynamicLibrary(process.argv[2]);\n\nlib.getFunction('add_i32', { arguments: ['i32', 'i32'], return: 'i32' });\nlib.getFunction('add_i32', {\n arguments: ['i32', 'i32'],\n get return() { lib.close(); return 'i32'; },\n});\n```\n\nRun with `node repro.js`, using any shared library that exports `add_i32` (for example, `test/ffi/fixture_library`)\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\nThe second call should throw `ERR_FFI_LIBRARY_CLOSED`, the same error `getFunction()` throws on a closed library.\n\n### What do you see instead?\n\nThe process crashes with a segmentation fault (exit code 139).\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-09-28T03:21:15Z","url":"https://github.com/nodejs/node/issues/66367"}
| 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:81b24f91-cc00-95b8-c876-d6f8c591055e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C79C:2BD59E:4C1C7E:67A5AE:6AED1C57 |
| html-safe-nonce | f2af9f4bb3dd9e9189de00e67dde984540338232d0d37b17df35456564253085 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzlDOjJCRDU5RTo0QzFDN0U6NjdBNUFFOjZBRUQxQzU3IiwidmlzaXRvcl9pZCI6IjU5MzA2MTI0OTQ3NjQ0MTYwODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6bba338768fd04a38f95d5c4fe7a5ae5a2125660ce3a0103df3e1dcd84380c59 |
| hovercard-subject-tag | issue:5608829998 |
| 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/66367/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a362a19b24e25065585550970d0c2c8dad7e0c336ff93d0d7e7bdb91e50ad5d2/nodejs/node/issues/66367 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a362a19b24e25065585550970d0c2c8dad7e0c336ff93d0d7e7bdb91e50ad5d2/nodejs/node/issues/66367 |
| og:image:alt | Version main Platform macOS 26.7.0 Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; const lib = new DynamicLibrary(process.argv[2]); lib.getFunction('add_... |
| 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 | 120085d0bcec1f427e3ab45302c8b95f873d26ad21984dc86d62ab2c10158f41 |
| 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 | e12fd03aa775dceadc5a793c3a0791e43ca256bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width