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-8316595: Alpine build fails after JDK-8314021 #15843

Closed
wants to merge 2 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Sep 20, 2023

JDK-8314021 causes build errors on Linux Alpine/musl (Linux ALPINE 3.17.4 gcc12.2.1)

/linuxmuslx86_64/jdk/src/hotspot/os/linux/os_linux.cpp: In static member function 'static jlong os::Linux::sendfile(int, int, jlong*, jlong)':
/linuxmuslx86_64/jdk/src/hotspot/os/linux/os_linux.cpp:4375:7: error: infinite recursion detected [-Werror=infinite-recursion]
4375 | jlong os::Linux::sendfile(int out_fd, int in_fd, jlong* offset, jlong count) {
| ^~
/linuxmuslx86_64/jdk/src/hotspot/os/linux/os_linux.cpp:4376:20: note: recursive call
4376 | return sendfile64(out_fd, in_fd, (off64_t*)offset, (size_t)count);

On Alpine Linux 3.17.4 we have just this definition for sendfile64 :
sys/sendfile.h:11:ssize_t sendfile(int, int, off_t *, size_t);
sys/sendfile.h:14:#define sendfile64 sendfile

So it would be better to use ::sendfile directly.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8316595: Alpine build fails after JDK-8314021 (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15843

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 20, 2023

👋 Welcome back mbaesken! 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 20, 2023
@openjdk
Copy link

openjdk bot commented Sep 20, 2023

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

  • hotspot-runtime

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.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Sep 20, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 20, 2023

Webrevs

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.

I would suggest simply using ::sendfile64 to ensure it uses the global namespace and avoids the recursion.

Copy link
Member

@y1yang0 y1yang0 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

@MBaesken
Copy link
Member Author

I would suggest simply using ::sendfile64 to ensure it uses the global namespace and avoids the recursion.

Hi David , I am a bit surprised that this works, because on my Alpine 3.17 machine , I only found this define
sys/sendfile.h:14:#define sendfile64 sendfile

but it seems to build for some reason.

@dholmes-ora
Copy link
Member

By using :: you tell the compiler that this is not os::sendfile so it doesn't appear to be a recursive call.

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.

Looks good. Thanks.

@openjdk
Copy link

openjdk bot commented Sep 21, 2023

@MBaesken 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:

8316595: Alpine build fails after JDK-8314021

Reviewed-by: dholmes, yyang

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 16 new commits pushed to the master branch:

  • 1749ba2: 8311084: Add typeSymbol() API for applicable constant pool entries
  • 9f5d2b9: 8316285: Opensource JButton manual tests
  • a35e96a: 8313612: Use JUnit in lib-test/jdk tests
  • bee7524: 8315786: [AIX] Build Disk Local Detection Issue with GNU-utils df on AIX
  • ceff47b: 8315082: [REDO] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index))
  • df4a25b: 8308762: Metaspace leak with Instrumentation.retransform
  • 8412479: 8316229: Enhance class initialization logging
  • c04c9ea: 8316627: JViewport Test headless failure
  • 5cacf21: 8316156: ByteArrayInputStream.transferTo causes MaxDirectMemorySize overflow
  • 3461c7b: 8316532: Native library copying in BuildMicrobenchmark.gmk cause dups on macOS
  • ... and 6 more: https://git.openjdk.org/jdk/compare/c43ebd34afeab9ece9dee05f0da184a20e487a12...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 21, 2023
@MBaesken
Copy link
Member Author

By using :: you tell the compiler that this is not os::sendfile so it doesn't appear to be a recursive call.

Yes I am aware of this; but I was unsure how this works with the define/macro on Alpine.

@dholmes-ora
Copy link
Member

Yes I am aware of this; but I was unsure how this works with the define/macro on Alpine.

Ah you mean you weren't sure if given this:

return ::sendfile64(out_fd, in_fd, (off64_t*)offset, (size_t)count);

the preprocessor would convert it to:

return ::sendfile(out_fd, in_fd, (off64_t*)offset, (size_t)count);

?

@MBaesken
Copy link
Member Author

Yes I am aware of this; but I was unsure how this works with the define/macro on Alpine.

Ah you mean you weren't sure if given this:

return ::sendfile64(out_fd, in_fd, (off64_t*)offset, (size_t)count);

the preprocessor would convert it to:

return ::sendfile(out_fd, in_fd, (off64_t*)offset, (size_t)count);

?

Yes exactly.

@MBaesken
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 21, 2023

Going to push as commit 378bcd5.
Since your change was applied there have been 21 commits pushed to the master branch:

  • b3d75fe: 8310874: Runthese30m crashes with klass should be in the placeholders during verification
  • 6a4b665: 8316659: assert(LockingMode != LM_LIGHTWEIGHT || flag == CCR0) failed: bad condition register
  • 913e43f: 8316582: Minor startup regression in 22-b15 due JDK-8310929
  • 23ed890: 6415065: Submenu is shown on wrong screen in multiple monitor environment
  • ca47f5f: 8316105: C2: Back to back Parse Predicates from different loops but with same deopt reason are wrongly grouped together
  • 1749ba2: 8311084: Add typeSymbol() API for applicable constant pool entries
  • 9f5d2b9: 8316285: Opensource JButton manual tests
  • a35e96a: 8313612: Use JUnit in lib-test/jdk tests
  • bee7524: 8315786: [AIX] Build Disk Local Detection Issue with GNU-utils df on AIX
  • ceff47b: 8315082: [REDO] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index))
  • ... and 11 more: https://git.openjdk.org/jdk/compare/c43ebd34afeab9ece9dee05f0da184a20e487a12...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 21, 2023
@openjdk openjdk bot closed this Sep 21, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 21, 2023
@openjdk
Copy link

openjdk bot commented Sep 21, 2023

@MBaesken Pushed as commit 378bcd5.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants