-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8333871: Check sysinfo return values #28317
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
| if (ret == 0) { | ||
| sprops.cpu_isalist = strdup(list); | ||
| } else { | ||
| sprops.cpu_isalist = NULL; |
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.
Would you mind checking the code that puts this in a system property can tolerate NULL? I don't suppose sysinfo will fail here (unless you found a case?) but it would be good to confirm that it won't blow up somewhere else.
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 do PUTPROP here
| PUTPROP(propArray, _sun_cpu_isalist_NDX, sprops->cpu_isalist); |
with 3rd parameter == NULL in this case.
PUTPROP checks for this so I do not see issues with this
| #define PUTPROP(array, prop_index, val) \ |
|
/reviewers 2 |
|
@AlanBateman |
AlanBateman
left a comment
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.
Thanks for checking that cpu_isalist == NULL is okay, the update to java_props_md.c looks okay to me.
|
I think this is completely unnecessary - Replacing numbers with words in the logging could break external parsing scripts. |
Hi David , not sure how likely those failures are. Back then in the review of JDK-8333522 we discussed the checking might be needed and that's why the JBS issue was created. |
|
If you search github, you find also a number of places where EPERM is checked after sysinfo, not sure if this is really happening these days on our platforms ? |
seccomp comes up periodically where random syscalls fail with EPERM as they aren't permitted by the filter. I don't know if this is what you found in your search but the possibility of seccomp or interposer libraries creates the possibility of syscall failing, or failing with errors that aren't documented for the syscall. |
That certainly complicates things and could potentially invalidate any code where we check for the expected/specified set of errors. I grudgingly withdraw my objection. |
src/hotspot/os/linux/os_linux.cpp
Outdated
| } else { | ||
| st->print_cr("OS uptime could not be retrieved."); |
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.
I think an assert would be preferable here. This code can't be parsed so I think it better not to inject it.
src/hotspot/os/linux/os_linux.cpp
Outdated
| } else { | ||
| st->print(", swap could not be determined"); | ||
| } |
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.
Again probably better to assert and say nothing, or use 0 as a placeholder.
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.
Hi David, I added asserts where you suggested.
|
@MBaesken this pull request can not be integrated into git checkout JDK-8333871
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
In the review of JDK-8333522 it has been discussed that we might run into issues because of failing sysinfo.
However we miss checking the return values at some places, this might need adjustment.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28317/head:pull/28317$ git checkout pull/28317Update a local copy of the PR:
$ git checkout pull/28317$ git pull https://git.openjdk.org/jdk.git pull/28317/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28317View PR using the GUI difftool:
$ git pr show -t 28317Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28317.diff
Using Webrev
Link to Webrev Comment