Skip to content
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

JDK-8247589: Implementation of Alpine Linux/x64 Port #49

Closed
wants to merge 3 commits into from

Conversation

voitylov
Copy link

@voitylov voitylov commented Sep 7, 2020

continuing the review thread from here https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-September/068546.html

The download side of using JNI in these tests is that it complicates the
setup a bit for those that run jtreg directly and/or just build the JDK
and not the test libraries. You could reduce this burden a bit by
limiting the load library/isMusl check to Linux only, meaning isMusl
would not be called on other platforms.

The alternative you suggest above might indeed be better. I assume you
don't mean splitting the tests but rather just adding a second @test
description so that the vm.musl case runs the test with a system
property that allows the test know the expected load library path behavior.

I have updated the PR to split the two tests in multiple @test s.

The updated comment in java_md.c in this looks good. A minor comment on
Platform.isBusybox is Files.isSymbolicLink returning true implies that
the link exists so no need to check for exists too. Also the
if-then-else style for the new class in ProcessBuilder/Basic.java is
inconsistent with the rest of the test so it stands out.

Thank you, these changes are done in the updated PR.

Given the repo transition this weekend then I assume you'll create a PR
for the final review at least. Also I see JEP 386 hasn't been targeted
yet but I assume Boris, as owner, will propose-to-target and wait for it
to be targeted before it is integrated.

Yes. How can this be best accomplished with the new git workflow?

  • we can continue the review process till the end and I will request the integration to happen only after the JEP is targeted. I guess this step is now done by typing "slash integrate" in a comment.
  • we can pause the review process now until the JEP is targeted.

In the first case I'm kindly asking the Reviewers who already chimed in on that to re-confirm the review here.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x64 Windows x64 macOS x64
Build ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

Reviewers

Contributors

  • Mikael Vidstedt <mikael@openjdk.org>
  • Alexander Scherbatiy <alexsch@openjdk.org>
  • Axel Siebenborn <asiebenborn@openjdk.org>
  • Aleksei Voitylov <avoitylov@openjdk.org>

Download

$ git fetch https://git.openjdk.java.net/jdk pull/49/head:pull/49
$ git checkout pull/49

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 7, 2020

👋 Welcome back avoitylov! 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 openjdk bot added the rfr Pull request is ready for review label Sep 7, 2020
@openjdk
Copy link

openjdk bot commented Sep 7, 2020

@voitylov The following labels will be automatically applied to this pull request: build hotspot-runtime jdk serviceability.

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

@openjdk openjdk bot added jdk jdk-dev@openjdk.org serviceability serviceability-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org build build-dev@openjdk.org labels Sep 7, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 7, 2020

Webrevs

@voitylov
Copy link
Author

voitylov commented Sep 7, 2020

/reviewer add @erikj79

@openjdk
Copy link

openjdk bot commented Sep 7, 2020

@voitylov Could not parse AlanBateman as a valid reviewer.
Syntax: /reviewer (add|remove) [@user | openjdk-user]+. For example:

  • /reviewer add @openjdk-bot
  • /reviewer add duke
  • /reviewer add @user1 @user2

@openjdk
Copy link

openjdk bot commented Sep 7, 2020

@voitylov
Reviewer dholmes successfully added.

@openjdk
Copy link

openjdk bot commented Sep 7, 2020

@voitylov This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8247589: Implementation of Alpine Linux/x64 Port

Co-authored-by: Mikael Vidstedt <mikael@openjdk.org>
Co-authored-by: Alexander Scherbatiy <alexsch@openjdk.org>
Co-authored-by: Axel Siebenborn <asiebenborn@openjdk.org>
Co-authored-by: Aleksei Voitylov <avoitylov@openjdk.org>
Reviewed-by: alanb, erikj, dholmes

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 34 new commits pushed to the master branch:

  • d43f141: 8254351: Minimal VM build fails with undeclared identifier 'MaxVectorSize' after JDK-8252847
  • cc52358: 8254335: logging/logStream.hpp includes memory/resourceArea.hpp but doesn't need it
  • 4b5ac3a: 8252847: Optimize primitive arrayCopy stubs using AVX-512 masked instructions
  • ec41046: 8254348: Build fails when cds is disabled after JDK-8247536
  • e4469d2: 8247536: Support for pre-generated java.lang.invoke classes in CDS static archive
  • 7ec9c8e: 8233214: Remove runtime code not needed with CMS removed
  • 536b35b: 8254319: Shenandoah: Interpreter native-LRB needs to activate during HAS_FORWARDED
  • be26972: 8253379: [windows] Several jpackage tests failed with error code 1638
  • 52e45a3: 8229186: Improve error messages for TestStringIntrinsics failures
  • 6d2c1a6: 8254292: Update JMH devkit to 1.26
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/f86037207cbf8184dfcc7474ec8a8c68fabdc42f...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@AlanBateman, @erikj79, @dholmes-ora) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 7, 2020
@openjdk
Copy link

openjdk bot commented Sep 7, 2020

@voitylov
Reviewer erikj successfully added.

@AlanBateman
Copy link
Contributor

This change was in review on core-libs-dev and other mailing lists before the switch to skara/git. The issues that I brought up have been added in the PR and I don't have any further comments.

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org and removed jdk jdk-dev@openjdk.org labels Sep 8, 2020
Copy link
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

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

Build changes look ok.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Attempting to use the GitHub UI for further review. If this doesn't work out well I will revert to direct email.

@@ -493,6 +533,13 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
fi
AC_SUBST(HOTSPOT_$1_CPU_DEFINE)

if test "x$OPENJDK_$1_LIBC" = "xmusl"; then
Copy link
Member

Choose a reason for hiding this comment

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

I'm not clear why we only check for musl when setting the HOTSPOT_$1_LIBC variable

Copy link
Author

Choose a reason for hiding this comment

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

this check is removed in the updated version. As a consequence, LIBC variable is added to the release file for all platforms, which is probably a good thing.

#ifdef MUSL_LIBC
// confstr() from musl libc returns EINVAL for
// _CS_GNU_LIBC_VERSION and _CS_GNU_LIBPTHREAD_VERSION
os::Linux::set_libc_version("unknown");
Copy link
Member

Choose a reason for hiding this comment

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

This should be "musl - unknown" as we don't know an exact version but we do know that it is musl.

Copy link
Author

Choose a reason for hiding this comment

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

Right, this should be more consistent with glibc which here returns name and version. Updated as suggested.

// confstr() from musl libc returns EINVAL for
// _CS_GNU_LIBC_VERSION and _CS_GNU_LIBPTHREAD_VERSION
os::Linux::set_libc_version("unknown");
os::Linux::set_libpthread_version("unknown");
Copy link
Member

Choose a reason for hiding this comment

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

This should be "musl - unknown" as we don't know an exact version but we do know that it is musl.

Copy link
Author

Choose a reason for hiding this comment

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

The pthread version is also updated to "musl - unknown". Reason being, pthread functionality for musl is built into the library.

#ifdef MUSL_LIBC
#define LIBC_STR "-" XSTR(LIBC)
#else
#define LIBC_STR ""
Copy link
Member

Choose a reason for hiding this comment

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

Again I'm not clear why we do nothing in the non-musl case? Shouldn't we be reporting glibc or musl?

Copy link
Author

Choose a reason for hiding this comment

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

Unlike the case above, I think it's best to keep it as is. I'd expect there to be a bunch of scripts in the wild which parse it and may get broken when facing a triplet for existing platforms.

char* msg = strerror_r(errno, buf, sizeof(buf));
// To improve portability across platforms and avoid conflicts
// between GNU and XSI versions of strerror_r, plain strerror is used.
// It's safe because this code is not used in any multithreaded environment.
Copy link
Member

Choose a reason for hiding this comment

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

I still question this assertion. The issue is not that the current code path that leads to strerror use may be executed concurrently but that any other strerror use could be concurrent with this one. I would consider this a "must fix" if not for the fact we already use strerror in the code and so this doesn't really change the exposure to the problem.

Copy link
Author

Choose a reason for hiding this comment

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

You are right! The updated version #ifdefs the XSI or GNU versions of strerror_r in this place. Note to self: file a bug to address the usage of strerror in other places, at least for HotSpot.

pthread_attr_t thread_attr;

pthread_attr_init(&thread_attr);
pthread_attr_setstacksize(&thread_attr, stack_size);
Copy link
Member

Choose a reason for hiding this comment

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

Just a comment in response to the explanation as to why this change is needed. If the default thread stacksize under musl is insufficient to successfully attach such a thread to the VM then this will cause problems for applications that embed the VM directly (or which otherwise directly attach existing threads).

Copy link
Author

Choose a reason for hiding this comment

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

This fix https://git.musl-libc.org/cgit/musl/commit/src/aio/aio.c?id=1a6d6f131bd60ec2a858b34100049f0c042089f2 addresses the problem for recent versions of musl. The test passes on a recent Alpine Linux 3.11.6 (musl 1.1.24) and fails on Alpine Linux 3.8.2 (musl 1.1.19) without this test fix.

There are still older versions of the library in the wild, hence the test fix. The mitigation for such users would be a distro upgrade.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the additional info on this.

@@ -54,6 +57,7 @@ JNIEnv* create_vm(JavaVM **jvm, char* argTLS) {
return env;
}

#if defined(__GLIBC)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we use this form here but at line 30 we have:
#ifdef GLIBC
?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed to be consistent.

@dholmes-ora
Copy link
Member

Updates look good. Nothing further from me.

@voitylov
Copy link
Author

thank you Alan, Erik, and David! When the JEP becomes Targeted, I'll use this PR to integrate the changes.

@voitylov
Copy link
Author

/contributor add @vidmik
/contributor add @AlexanderScherbatiy
/contributor add asiebenborn

@openjdk
Copy link

openjdk bot commented Sep 18, 2020

@voitylov
Contributor Mikael Vidstedt <mikael@openjdk.org> successfully added.

@openjdk
Copy link

openjdk bot commented Sep 18, 2020

@voitylov
Contributor Alexander Scherbatiy <alexsch@openjdk.org> successfully added.

@openjdk
Copy link

openjdk bot commented Sep 18, 2020

@voitylov
Contributor Axel Siebenborn <asiebenborn@openjdk.org> successfully added.

@openjdk openjdk bot added the test-request label Oct 2, 2020
@openjdk
Copy link

openjdk bot commented Oct 2, 2020

⚠️ @voitylov This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@dholmes-ora
Copy link
Member

@voitylov For future reference please don't force-push commits on open PRs as it breaks the commit history. I can no longer just look at the two most recent commits and see what they added relative to what I had previously reviewed. Thanks.

@openjdk
Copy link

openjdk bot commented Oct 7, 2020

@voitylov this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8247589
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed ready Pull request is ready to be integrated labels Oct 7, 2020
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Oct 8, 2020
@voitylov
Copy link
Author

voitylov commented Oct 8, 2020

@dholmes-ora yes, sorry about that. I updated the branch to pull the recent changes to enable pre-submit tests and ensure everything is well before integration and though the branch looked good it confused the pull request. So I had to force push it back to the original state.

@voitylov
Copy link
Author

voitylov commented Oct 8, 2020

@iignatev I resolved the conflict in whitebox.cpp and fixed a minor style nit on the way. Could you take a look?

@iignatev
Copy link
Member

iignatev commented Oct 8, 2020

@iignatev I resolved the conflict in whitebox.cpp and fixed a minor style nit on the way. Could you take a look?

LGTM

@voitylov
Copy link
Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 11, 2020
@openjdk
Copy link

openjdk bot commented Oct 11, 2020

@voitylov
Your change (at version 9bee41e) is now ready to be sponsored by a Committer.

@AlexanderScherbatiy
Copy link

/sponsor

@openjdk openjdk bot closed this Oct 13, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 13, 2020
@openjdk
Copy link

openjdk bot commented Oct 13, 2020

@AlexanderScherbatiy @voitylov Since your change was applied there have been 64 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 63009f9.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@voitylov
Copy link
Author

Thanks everyone!

caojoshua added a commit to caojoshua/jdk that referenced this pull request Jul 13, 2023
* [PEA] Clear allocation state before late inlines
robehn pushed a commit to robehn/jdk that referenced this pull request Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org test-request
6 participants