Skip to content

ffi: validate DynamicLibrary getter receivers - #65415

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:fix-ffi-getter-crash-2
Open

ffi: validate DynamicLibrary getter receivers#65415
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:fix-ffi-getter-crash-2

Conversation

@trivikr

@trivikr trivikr commented Aug 20, 2026

Copy link
Copy Markdown
Member

Fixes: #65287

Bind the path, symbols, and functions getter templates to the DynamicLibrary constructor signature. This causes V8 to reject incompatible receivers before invoking the native callbacks, preventing them from crashing the process.


Assisted-by: codex:gpt-5.6-sol

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 20, 2026
@trivikr
trivikr force-pushed the fix-ffi-getter-crash-2 branch from 35d2307 to cf20171 Compare August 20, 2026 06:18
Bind the path, symbols, and functions getter templates to the
DynamicLibrary constructor signature. This causes V8 to reject
incompatible receivers before invoking the native callbacks,
preventing them from crashing the process.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
@trivikr
trivikr force-pushed the fix-ffi-getter-crash-2 branch from cf20171 to 8150101 Compare August 20, 2026 06:28
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 20, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 20, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (2899539) to head (8150101).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65415   +/-   ##
=======================================
  Coverage   90.12%   90.12%           
=======================================
  Files         752      752           
  Lines      252282   252286    +4     
  Branches    47442    47452   +10     
=======================================
+ Hits       227360   227381   +21     
+ Misses      16221    16214    -7     
+ Partials     8701     8691   -10     
Files with missing lines Coverage Δ
src/node_ffi.cc 71.85% <100.00%> (+0.13%) ⬆️

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ffi: DynamicLibrary getters crash on incompatible receivers

3 participants