-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8339331: GCC fortify error in vm_version_linux_aarch64.cpp #22655
Conversation
… warning by gcc14
👋 Welcome back syan! A progress list of the required criteria for merging this PR into |
@sendaoYan 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:
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 140 new commits pushed to the
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 |
@sendaoYan The following label will be automatically applied to this pull request:
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. |
Webrevs
|
/issue JDK-8339331 |
@sendaoYan |
GHA report test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It annoys me that we have to add runtime overhead to release builds to suppress this kind of warning. This code only has internal callers, all of which should be known to not pass a null buf, so the assert should suffice here.
But given the very limited use of the affected function I will approve it.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've never been able to reproduce this at Oracle. We're using vanilla builds
of gcc. It might be that Fedora is applying a patch that leads to this. In
JDK-8316234 it was suggested there might be a gcc bug involved:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87489
Having read through that bug, I'm inclined to agree that's probably involved.
Much as I hate warning suppresions, I think a better solution here is to use
PRAGMA_NONNULL_IGNORED, along with a comment referring to that gcc bug, and
also mentioning that it might require some distro-specific gcc patch, since
not seen with vanilla gcc release.
…omments about the gcc bug
Thanks, PR has been change to use |
Mmm, I see. Agreed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks
GHA report 1 failure:
|
Thanks all for the reviews and advices. /integrate |
Going to push as commit 842f801.
Your commit was automatically rebased without conflicts. |
@sendaoYan Pushed as commit 842f801. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi all,
The file src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp reported nullptr compile warning by gcc14 with fastdebug configure. I think it's false positive, since the statement 'assert(buf != nullptr, "invalid argument");' has make sure the
buf
should not be nullptr before execute '::read(int, void*, int)'. The call chain isvoid VM_Version::initialize_cpu_information(void)
->void VM_Version::get_compatible_board(char *buf, int buflen)
->static bool read_fully(const char *fname, char *buf, size_t buflen)
,*buf
is defined aschar Abstract_VM_Version::_cpu_desc[4096] = {0};
and then right shift 8 bytes, so*buf
should not be nullptr.This PR use
PRAGMA_NONNULL_IGNORED
suppress false positive gcc compile warning to make fastdebug configure make success on linux-aarch64 by gcc14.2.0.Risk is low.
Additional testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22655/head:pull/22655
$ git checkout pull/22655
Update a local copy of the PR:
$ git checkout pull/22655
$ git pull https://git.openjdk.org/jdk.git pull/22655/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22655
View PR using the GUI difftool:
$ git pr show -t 22655
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22655.diff
Using Webrev
Link to Webrev Comment