Skip to content

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented Nov 14, 2025

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

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

Warning

 ⚠️ Found leading lowercase letter in issue title for 8333871: check sysinfo return values

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28317

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 14, 2025

👋 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
Copy link

openjdk bot commented Nov 14, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title JDK-8333871: check sysinfo return values 8333871: check sysinfo return values Nov 14, 2025
@openjdk openjdk bot added hotspot-runtime hotspot-runtime-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Nov 14, 2025
@openjdk
Copy link

openjdk bot commented Nov 14, 2025

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

  • core-libs
  • hotspot-runtime

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 pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 14, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 14, 2025

Webrevs

if (ret == 0) {
sprops.cpu_isalist = strdup(list);
} else {
sprops.cpu_isalist = NULL;
Copy link
Contributor

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.

Copy link
Member Author

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) \

@AlanBateman
Copy link
Contributor

/reviewers 2

@openjdk
Copy link

openjdk bot commented Nov 16, 2025

@AlanBateman
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

Copy link
Contributor

@AlanBateman AlanBateman 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 checking that cpu_isalist == NULL is okay, the update to java_props_md.c looks okay to me.

@dholmes-ora
Copy link
Member

I think this is completely unnecessary - sysinfo on Linux can't really fail, the only error possible is EFAULT if you pass a bad pointer for the struct - so don't do that.

Replacing numbers with words in the logging could break external parsing scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

4 participants