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-8289799: Build warning in methodData.cpp memset zero-length parameter #9390

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented Jul 6, 2022

Trivial fix for a compiler warning we see in our CI on Fedora 12 with GCC 8.3:

void Copy::pd_zero_to_bytes(void*, size_t)' at /home/ubuntu/client_home/workspace/build-user-branch-linux_x86_64/SapMachine/src/hotspot/cpu/x86/copy_x86.hpp:59:15,
    inlined from 'static void Copy::zero_to_bytes(void*, size_t)' at /home/ubuntu/client_home/workspace/build-user-branch-linux_x86_64/SapMachine/src/hotspot/share/utilities/copy.hpp:298:21,
    inlined from 'void MethodData::initialize()' at 

/home/ubuntu/client_home/workspace/build-user-branch-linux_x86_64/SapMachine/src/hotspot/share/oops/methodData.cpp:1248:22:
/opt/devkits/devkit-fedora-gcc-12-8.3.0/x86_64-linux-gnu/sysroot/usr/include/bits/string3.h:82:30: error: call to '__warn_memset_zero_len' declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror]
       __warn_memset_zero_len ();
       ~~~~~~~~~~~~~~~~~~~~~~~^~

The "size" argument for memset (which Copy::zero_to_bytes() ultimately expands on x64) is compile-time evaluated here to be 0 and GCC does not like this.


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-8289799: Build warning in methodData.cpp memset zero-length parameter

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9390

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 6, 2022

👋 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 openjdk bot added the rfr Pull request is ready for review label Jul 6, 2022
@openjdk
Copy link

openjdk bot commented Jul 6, 2022

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

  • hotspot

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 hotspot-dev@openjdk.org label Jul 6, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 6, 2022

Webrevs

Copy link
Member

@DamonFool DamonFool 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 to me.

@openjdk
Copy link

openjdk bot commented Jul 6, 2022

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

8289799: Build warning in methodData.cpp memset zero-length parameter

Reviewed-by: jiefu, lucy

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

  • d1249aa: 8198668: MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001/TestDescription.java still failing
  • a79ce4e: 8286941: Add mask IR for partial vector operations for ARM SVE
  • 569de45: 8289620: gtest/MetaspaceUtilsGtests.java failed with unexpected stats values
  • 403a9bc: 8289436: Make the redefine timer statistics more accurate
  • a40c17b: 8289775: Update java.lang.invoke.MethodHandle[s] to use snippets
  • 2a6ec88: Merge
  • 0526402: 8289477: Memory corruption with CPU_ALLOC, CPU_FREE on muslc
  • b3a0e48: 8289439: Clarify relationship between ThreadStart/ThreadEnd and can_support_virtual_threads capability
  • 0b6fd48: 8288128: S390X: Fix crashes after JDK-8284161 (Virtual Threads)
  • 30e134e: 8289091: move oop safety check from SharedRuntime::get_java_tid() to JavaThread::threadObj()
  • ... and 19 more: https://git.openjdk.org/jdk/compare/f783244caf041b6f79036dfcf29ff857d9c1c78f...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 Jul 6, 2022
Copy link
Contributor

@RealLucy RealLucy 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.

@tstuefe
Copy link
Member Author

tstuefe commented Jul 7, 2022

Thanks @DamonFool and @RealLucy !
/integrate

@openjdk
Copy link

openjdk bot commented Jul 7, 2022

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

  • d1249aa: 8198668: MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001/TestDescription.java still failing
  • a79ce4e: 8286941: Add mask IR for partial vector operations for ARM SVE
  • 569de45: 8289620: gtest/MetaspaceUtilsGtests.java failed with unexpected stats values
  • 403a9bc: 8289436: Make the redefine timer statistics more accurate
  • a40c17b: 8289775: Update java.lang.invoke.MethodHandle[s] to use snippets
  • 2a6ec88: Merge
  • 0526402: 8289477: Memory corruption with CPU_ALLOC, CPU_FREE on muslc
  • b3a0e48: 8289439: Clarify relationship between ThreadStart/ThreadEnd and can_support_virtual_threads capability
  • 0b6fd48: 8288128: S390X: Fix crashes after JDK-8284161 (Virtual Threads)
  • 30e134e: 8289091: move oop safety check from SharedRuntime::get_java_tid() to JavaThread::threadObj()
  • ... and 19 more: https://git.openjdk.org/jdk/compare/f783244caf041b6f79036dfcf29ff857d9c1c78f...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 7, 2022

@tstuefe Pushed as commit cce77a7.

💡 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 hotspot-dev@openjdk.org integrated Pull request has been integrated
3 participants