Skip to content

8357089: Remove VFORK launch mechanism from Process implementation (linux) #25768

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 2 commits into
base: master
Choose a base branch
from

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented Jun 12, 2025

(for JDK 26)

Note: This PR is a continuation of the old PR here: #25260; had to close the old one since I had Skara problems after the JDK25 split-off.

See the companion CSR (https://bugs.openjdk.org/browse/JDK-8357090) for the ratio behind this removal.

Patch

  • removes all code handling the VFORK mode.
  • removes or clarifies comments explaining use of vfork by the JVM.
  • we now print out an error message to stderr if the user still specifies -Djdk.lang.Process.launchMechanism=vfork.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 2 Reviewers)
  • Change requires CSR request JDK-8357090 to be approved

Issues

  • JDK-8357089: Remove VFORK launch mechanism from Process implementation (linux) (Enhancement - P4)
  • JDK-8357090: Remove VFORK launch mechanism from Process implementation (linux) (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25768/head:pull/25768
$ git checkout pull/25768

Update a local copy of the PR:
$ git checkout pull/25768
$ git pull https://git.openjdk.org/jdk.git pull/25768/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25768

View PR using the GUI difftool:
$ git pr show -t 25768

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25768.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 12, 2025

👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 12, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8357089: Remove VFORK launch mechanism from Process implementation (linux) 8357089: Remove VFORK launch mechanism from Process implementation (linux) Jun 12, 2025
@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 12, 2025
@openjdk
Copy link

openjdk bot commented Jun 12, 2025

@tstuefe The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@tstuefe tstuefe force-pushed the JDK-8357089-Remove-VFORK-launch-mechanism-from-Process-implementation-linux- branch from fc35c34 to f94fd12 Compare June 12, 2025 04:18
@tstuefe tstuefe marked this pull request as ready for review June 12, 2025 05:25
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 12, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 12, 2025

Webrevs

@RogerRiggs
Copy link
Contributor

/reviewers 2 reviewers

* the libc in terms of one of (fork|vfork|clone)+exec - so whether or not it
* has advantages over calling the naked (fork|vfork|clone) functions depends
* on how posix_spawn(3) is implemented.
* D) posix_spawn(3): Where fork/vfork/clone all fork off the process and leave
Copy link
Contributor

Choose a reason for hiding this comment

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

I would downplay the OS launch options we don't use, only saying that vfork is dangerous (and a bit as to why) but there's no need to mention clone. And there's no need to mention the the deprecation or removal, when this is integrated its gone.

@@ -57,7 +57,7 @@
* changing paths...
* - then exec(2) the target binary
*
* There are three ways to fork off:
* On the OS-side are four ways to fork off:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would mention the two ways that are implemented, only mentioning vfork after the supported mechanisms to inhibit someone wanting to go backwards.

@@ -205,31 +205,6 @@ initVectorFromBlock(const char**vector, const char* block, int count)
vector[count] = NULL;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

This mode should be mentioned in the CSR, even if no-one knew it was there.

@openjdk
Copy link

openjdk bot commented Jun 16, 2025

@RogerRiggs
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 2 Reviewers).

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 14, 2025

@tstuefe This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] csr Pull request needs approved CSR before integration rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants