Title: ffi: getFunctions() can return a wrapper with the wrong signature if a signature getter requests an earlier symbol · Issue #67192 · nodejs/node · GitHub
Open Graph Title: ffi: getFunctions() can return a wrapper with the wrong signature if a signature getter requests an earlier symbol · Issue #67192 · nodejs/node
X Title: ffi: getFunctions() can return a wrapper with the wrong signature if a signature getter requests an earlier symbol · Issue #67192 · nodejs/node
Description: Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; import { strictEqual } from 'node:assert'; const lib = new DynamicLibrary(null); // Symbols already loaded in the pro...
Open Graph Description: Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; import { strictEqual } from 'node:assert'; const lib = new DynamicLibrary(nul...
X Description: Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; import { strictEqual } from 'node:assert'; const lib = new Dy...
Opengraph URL: https://github.com/nodejs/node/issues/67192
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ffi: getFunctions() can return a wrapper with the wrong signature if a signature getter requests an earlier symbol","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS\n```\n\n### Subsystem\n\nffi\n\n### What steps will reproduce the bug?\n\n```js\nimport { DynamicLibrary } from 'node:ffi';\nimport { strictEqual } from 'node:assert';\n\nconst lib = new DynamicLibrary(null); // Symbols already loaded in the process.\nlet conflicting;\nconst { abs } = lib.getFunctions({\n abs: { arguments: ['i32'], return: 'i32' },\n get labs() {\n conflicting = lib.getFunction('abs', { arguments: ['f64'], return: 'f64' });\n return { arguments: ['i64'], return: 'i64' };\n },\n});\n\nconsole.log('same wrapper:', abs === conflicting);\nconsole.log('abs(-5):', abs(-5));\nstrictEqual(abs(-5), 5);\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\n`getFunctions()` should throw `ERR_INVALID_ARG_VALUE` (\"Function abs was already requested with a different signature\"), so neither `console.log` nor the assert should run. The assert is only reached because of the bug.\n\n### What do you see instead?\n\n```console\nsame wrapper: true\nabs(-5): -5\nAssertionError [ERR_ASSERTION]: Expected values to be strictly equal:\n\n-5 !== 5\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-11-01T19:42:55Z","url":"https://github.com/nodejs/node/issues/67192"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c4a2bd65-eeee-f089-e56e-c32a65a3e5e6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87B4:31222B:DA2E74:12F0C38:6AFBF25F |
| html-safe-nonce | 9042a17d286295d0a6e8f5e78a99f8ddc6073ad23e858e814821b1c02ab75da2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0I0OjMxMjIyQjpEQTJFNzQ6MTJGMEMzODo2QUZCRjI1RiIsInZpc2l0b3JfaWQiOiI3MTMzNjk5MzIwNDY4NzMwNDYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e3d78bd2d0b50f28c1ddf2c87da8097bb1c530fe2baed39b61813cc9dc28c072 |
| hovercard-subject-tag | issue:6151232055 |
| 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/67192/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c015f8fa141ee2c32800942017b835c41ae5b0a5f66cc7273a125164bb3ffa52/nodejs/node/issues/67192 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c015f8fa141ee2c32800942017b835c41ae5b0a5f66cc7273a125164bb3ffa52/nodejs/node/issues/67192 |
| og:image:alt | Version main Platform macOS Subsystem ffi What steps will reproduce the bug? import { DynamicLibrary } from 'node:ffi'; import { strictEqual } from 'node:assert'; const lib = new DynamicLibrary(nul... |
| 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 | fa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f |
| 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 | b3b5633a74535d9c23385512d534c66c8fde1907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width