Skip to content

ffi: reject direct SharedArrayBuffer pointers - #65233

Draft
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-sab-pointer-arg
Draft

ffi: reject direct SharedArrayBuffer pointers#65233
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-sab-pointer-arg

Conversation

@trivikr

@trivikr trivikr commented Aug 12, 2026

Copy link
Copy Markdown
Member

Fixes: #65232

Reject direct SharedArrayBuffer pointer arguments in the JavaScript wrapper and native fast-buffer helper. This keeps validation behavior consistent before and after optimization.


Assisted-by: codex:gpt-5.6-sol

Reject direct SharedArrayBuffer pointer arguments in the JavaScript
wrapper and native fast-buffer helper. This keeps validation behavior
consistent before and after optimization.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
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++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run. labels Aug 12, 2026
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.31%. Comparing base (2fbd056) to head (fd31a82).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
src/ffi/fast.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65233      +/-   ##
==========================================
- Coverage   90.32%   90.31%   -0.01%     
==========================================
  Files         760      760              
  Lines      248629   248629              
  Branches    46936    46933       -3     
==========================================
- Hits       224578   224561      -17     
+ Misses      15475    15471       -4     
- Partials     8576     8597      +21     
Files with missing lines Coverage Δ
lib/internal/ffi/fast-api.js 94.93% <100.00%> (ø)
src/ffi/fast.cc 69.75% <0.00%> (ø)

... and 33 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.

@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr
trivikr marked this pull request as draft August 12, 2026 17:19
@trivikr

trivikr commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Converted to draft since test-ffi-fast-buffer is failing in https://ci.nodejs.org/job/node-test-commit-aix/64358/

not ok 3 ffi/test-ffi-fast-buffer
  ---
  duration_ms: 745.01400
  severity: crashed
  exitcode: -5
  stack: |-
    (node:39387614) internal/test/binding: These APIs are for internal testing only. Do not use them.
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:39387614) ExperimentalWarning: FFI is an experimental feature and might change at any time
    
    
    #
    # Fatal error in , line 0
    # Check failed: EnsureCompiledAndFeedbackVector(isolate, function, &is_compiled_scope).
    #
    #
    #
    #FailureMessage Object: fffffffffffc608
    ----- Native stack trace -----
    
  ...

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++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ffi: SharedArrayBuffer pointer argument changes from rejected to accepted after optimization

3 participants