Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

src: fix pointer alignment #61336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jhofstee wants to merge 1 commit into nodejs:main
base: main
Choose a base branch
Loading
from jhofstee:fix-node-http-crash

Conversation

@jhofstee
Copy link
Contributor

@jhofstee jhofstee commented Jan 10, 2026

The NgLibMemoryManager::ReallocImpl method prefixes the allocated memory with its size, and returns a pointer to the region after it. This pointer can however no longer be suitably aligned.

On Arm 32bits this resulted in unaligned accesses, since the NEON vst1.64 instruction was used with a not properly aligned addresses. A reproducer is available at victronenergy/venus#1559.

Correct this by allocating the maximum of the the size of the size_t and the max alignment.

Copy link
Collaborator

Review requested:

  • @nodejs/http2

@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 Jan 10, 2026
The NgLibMemoryManager::ReallocImpl method prefixes the allocated
memory with its size, and returns a pointer to the region after it.
This pointer can however no longer be suitably aligned.
On Arm 32bits this resulted in unaligned accesses, since the NEON
vst1.64 instruction was used with a not properly aligned addresses.
A reproducer is available at [1].
Correct this by allocating the maximum of the the size of the size_t
and the max alignment.
[1] victronenergy/venus#1559.
Copy link

codecov bot commented Jan 10, 2026
edited
Loading

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.52%. Comparing base (842448b) to head (ad2a739).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/node_mem-inl.h 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## main #61336 +/- ##
==========================================
+ Coverage 88.00% 88.52% +0.51% 
==========================================
 Files 704 704 
 Lines 208739 208738 -1 
 Branches 40196 40272 +76 
==========================================
+ Hits 183706 184782 +1076 
+ Misses 16992 15967 -1025 
+ Partials 8041 7989 -52 
Files with missing lines Coverage Δ
src/node_mem-inl.h 91.66% <83.33%> (+1.87%) ⬆️

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

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Reviewers

@mcollina mcollina mcollina approved these changes

@addaleax addaleax addaleax approved these changes

@RafaelGSS RafaelGSS RafaelGSS approved these changes

Assignees

No one assigned

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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /