Skip to content

deps: support madvise(3C) across ALL illumos revisions #58237

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danmcd
Copy link
Contributor

@danmcd danmcd commented May 8, 2025

In illumos, madvise(3C) now takes void * for its first argument post-illumos#14418, but uses caddr_t pre-illumos#14418. This fix will detect if the illumos is pre-or-post-illumos#14418 so builds can work either way.

Cf. https://illumos.org/issues/14418

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels May 8, 2025
@danmcd
Copy link
Contributor Author

danmcd commented May 8, 2025

Currently testing on a post-illumos#14418 environment. The Jenkins agents for smartos actually use pre-illumos#14418 environments. This fix plans on working in both (which cannot happen today), which will allow me to revisit, perhaps, what a smartos or even an illumos of some other flavor (e.g. OmniOS or OpenIndiana) build agent might look like. Today's smartos agents are a bit convoluted, thanks in no small part to fallout from illumos#14418.

@danmcd
Copy link
Contributor Author

danmcd commented May 8, 2025

This change should be a literal NOP for ANY OTHER BUILD PLATFORM, even Oracle Solaris, since the __illumos__ symbol is in use for cpp directives.

@danmcd
Copy link
Contributor Author

danmcd commented May 8, 2025

Do I have to promote this to a non-draft PR to get Jenkins to run a build?

@cjihrig cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. label May 8, 2025
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels May 8, 2025
Copy link
Contributor

github-actions bot commented May 8, 2025

Failed to start CI
   ⚠  No approving reviews found
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/14914717962

@nodejs-github-bot
Copy link
Collaborator

@danmcd
Copy link
Contributor Author

danmcd commented May 8, 2025

Thank you @cjihrig !

@nodejs-github-bot
Copy link
Collaborator

@danmcd danmcd marked this pull request as ready for review May 9, 2025 04:52
@danmcd
Copy link
Contributor Author

danmcd commented May 9, 2025

This is good news and I've updated this PR to ready-for-review. The Node CI for SmartOS uses a pre-illumos#14418 illumos revision, and my local build uses a post-illumos#14418 revision. The same code now works before-and-after the illumos change in question. As mentioned earlier, this may allow less byzantine build agents for the Node CI.

The Node CI results are above, and my local build's test results were all successfull but one failure:

=== release test-child-process-stdio-reuse-readable-stdio ===                 
Path: parallel/test-child-process-stdio-reuse-readable-stdio
Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /home/danmcd/node/test/parallel/test-child-process-stdio-reuse-readable-stdio.js
--- TIMEOUT ---

Which was the same one when I updated the V8 pointer-updates for illumos.

@richardlau richardlau added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels May 9, 2025
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@danmcd
Copy link
Contributor Author

danmcd commented May 12, 2025

Thank you all for the feedback and confirmation on this. I hope to use the experience here as a way to get V8 itself to accept this and the VA48 behavior in their upstream-from-here repo. (I'll have to figure out the google tooling but that's my problem not yours.)

One more thing I'd like to reiterate: "As mentioned earlier, this may allow less byzantine build agents for the Node CI."

It also means, I think, that we could introduce a non-SmartOS illumos distro build agent if we wished. OmniOS just released its new LTS release (r151054), and that would make a FINE place (3 years support, 2 years primary lifetime) to drop a build agent that'll confirm greater-illumos stability. I'm now running a node build with this fix in place on my newly-updated home server running OmniOS. I will report back here with results.

@mhdawson
Copy link
Member

@danmcd since this floats a change on V8 getting it upstreamed sooner than later would be good. Sometimes we ask that patches will land upstream before we will float them.

@targos any concerns with floating this one?

@danmcd
Copy link
Contributor Author

danmcd commented May 13, 2025

@mhdawson AFAICT it'll be ideal to have this and the VA48 one land upstream in V8 before Node next pulls in its next V8 update. This is, as you point out, a place where @targos 's opinion should reign supreme.

@targos
Copy link
Member

targos commented May 13, 2025

I think it's fine to float the patch as long as the path for upstreaming it is determined. There are two things to fix before this PR can land though:

  • The commit message title should start with an imperative verb (and maybe avoid using a syntax that GitHub converts into a dead link)
  • common.gypi should be updated by incrementing the v8_embedder_string

@danmcd
Copy link
Contributor Author

danmcd commented May 14, 2025

@targos => A better title such as deps: support madvise() across ALL illumos revisions ?

I don't wanna push an update with v8_embedder_string fixes until I got the title right as well.

In illumos, madvise(3C) now takes `void *` for its first argument
post-illumos#14418, but uses `caddr_t` pre-illumos#14418. This fix will
detect if the illumos mman.h file in use is pre-or-post-illumos#14418 so
builds can work either way.
@danmcd danmcd force-pushed the illumos-madvise branch from e1f935d to 5f5b0e3 Compare May 14, 2025 15:02
@danmcd
Copy link
Contributor Author

danmcd commented May 14, 2025

Oh shoot, forgot my branch is directly linked to this PR.

@danmcd danmcd changed the title deps: illumos madvise() pre-and-post-illumos#14418 deps: support madvise(3C) across ALL illumos revisions May 14, 2025
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label May 15, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 15, 2025
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants