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

8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls #2487

Closed

Conversation

fitzsim
Copy link
Contributor

@fitzsim fitzsim commented May 21, 2024

I propose backporting the fix for 8286781 to jdk17u.

I tested the changes on jdk17u-dev master, on Fedora 38 x86-64, slowdebug and fastdebug configurations. The test was to run IdealGraphVisualizer, per jdk17u-dev/src/utils/IdealGraphVisualizer/README.md, then run, e.g.:

./build/linux-x86_64-server-fastdebug/jdk/bin/java -XX:+PrintIdealGraph -XX:PrintIdealGraphLevel=1 -classpath ~/source/hello-java Hello

I needed extra JVM arguments in jdk17u-dev/src/utils/IdealGraphVisualizer/application/target/idealgraphvisualizer/bin/idealgraphvisualizer to make the visualizer utility work on 17:

            --jdkhome '"$jdkhome"' \
            -J--add-opens=java.base/java.net=ALL-UNNAMED \
            -J--add-opens=java.base/java.security=ALL-UNNAMED \
            -J--add-opens=java.base/java.lang=ALL-UNNAMED \
            -J--add-opens=java.desktop/sun.awt=ALL-UNNAMED \
            -J--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED \
            -J--add-opens=java.desktop/javax.swing=ALL-UNNAMED \
            -J--add-exports=java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED \
            --clusters '"$clusters"' \

Networking between the test and the utility worked fine with the backport applied.


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
  • JDK-8286781 needs maintainer approval

Issue

  • JDK-8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls (Enhancement - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/2487/head:pull/2487
$ git checkout pull/2487

Update a local copy of the PR:
$ git checkout pull/2487
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/2487/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2487

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/2487.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 21, 2024

👋 Welcome back fitzsim! 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 May 21, 2024

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

8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls

Reviewed-by: andrew

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

  • a640001: 8312194: test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java cannot handle empty modules
  • a632247: 8319338: tools/jpackage/share/RuntimeImageTest.java fails with -XX:+UseZGC
  • e00211b: 8321107: Add more test cases for JDK-8319372
  • 6264c70: 8273153: Consolidate file_exists into os:file_exists

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@gnu-andrew) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label May 21, 2024
@fitzsim fitzsim changed the title 8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls Backport d7298245d6759f62e253b5cf0df975db17fdbf82 May 21, 2024
@openjdk openjdk bot changed the title Backport d7298245d6759f62e253b5cf0df975db17fdbf82 8286781: Replace the deprecated/obsolete gethostbyname and inet_addr calls May 21, 2024
@openjdk
Copy link

openjdk bot commented May 21, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label May 21, 2024
@mlbridge
Copy link

mlbridge bot commented May 21, 2024

Webrevs

@fitzsim
Copy link
Contributor Author

fitzsim commented May 21, 2024

I have not tested this on Windows yet. I did not realize testing is not configured on jdk17u-dev. I will try to at least get the pre-submit tests run on my private repo (or some other way).

@gnu-andrew
Copy link
Member

I have not tested this on Windows yet. I did not realize testing is not configured on jdk17u-dev. I will try to at least get the pre-submit tests run on my private repo (or some other way).

You need to manually enable tests on every new repository you fork. It's a pain and easily forgotten.

Copy link
Member

@gnu-andrew gnu-andrew left a comment

Choose a reason for hiding this comment

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

Backport is mostly clean. The changes to remove -D_WINSOCK_DEPRECATED_NO_WARNINGS from make/autoconf/flags-cflags.m4 is absent, as JDK-8286262 is not present in 17u and it doesn't make sense to backport this kind of change. The only other difference is the nullptr vs NULL in some of the removed code, which again it doesn't make sense to backport to LTS releases.

@openjdk
Copy link

openjdk bot commented May 22, 2024

⚠️ @fitzsim This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@fitzsim
Copy link
Contributor Author

fitzsim commented May 22, 2024

Thank you for reviewing @gnu-andrew. I enabled Actions on my fork of the jdk17u-dev repository and they are running now.

@gnu-andrew
Copy link
Member

As regards running the tool, you may want to look at backporting JDK-8279068. Despite the title "IGV: Update to work with JDK 16 and 17", it was only added to 19 and later. I can't comment on the other Maven changes in there, but I do see the add-opens changes being added.

@fitzsim
Copy link
Contributor Author

fitzsim commented May 22, 2024

As regards running the tool, you may want to look at backporting JDK-8279068.

Good idea; I opened #2488.

@fitzsim
Copy link
Contributor Author

fitzsim commented May 22, 2024

All the automated builds passed. I do not currently have access to Windows or macOS environments to test IdealGraphVisualizer on those operating systems though, however, since it is the same network connection code and it built on both those operating systems, I expect connecting to the visualizer will work.

@fitzsim
Copy link
Contributor Author

fitzsim commented May 22, 2024

/approval request This is ready, unless the maintainer considers it necessary to test IdealGraphViewer on Windows and macOS.

@openjdk
Copy link

openjdk bot commented May 22, 2024

@fitzsim
8286781: The approval request has been created successfully.

@openjdk openjdk bot added the approval label May 22, 2024
@gnu-andrew
Copy link
Member

I don't think it's reasonable to expect every patch submission to be tested on every possible platform. Those who want to produce builds on that platform and have the resources to do so should be regularly testing and maintaining it. Full testing this patch on every platform would also mean running the visualiser on AIX and Solaris, which aren't even tested by GHA. Where those platforms have been broken by changes in the past, those who build on them have submitted patches to fix them.

I see it as a bigger issue that the visualiser doesn't even work out of the box on 17 at present and no-one has moved to fix this so far.

/approve yes

@openjdk
Copy link

openjdk bot commented May 22, 2024

@gnu-andrew
8286781: The approval request has been approved.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval labels May 22, 2024
@fitzsim
Copy link
Contributor Author

fitzsim commented May 23, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label May 23, 2024
@openjdk
Copy link

openjdk bot commented May 23, 2024

@fitzsim
Your change (at version 95615d6) is now ready to be sponsored by a Committer.

@gnu-andrew
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented May 23, 2024

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

  • a640001: 8312194: test/hotspot/jtreg/applications/ctw/modules/jdk_crypto_ec.java cannot handle empty modules
  • a632247: 8319338: tools/jpackage/share/RuntimeImageTest.java fails with -XX:+UseZGC
  • e00211b: 8321107: Add more test cases for JDK-8319372
  • 6264c70: 8273153: Consolidate file_exists into os:file_exists

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 23, 2024
@openjdk openjdk bot closed this May 23, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels May 23, 2024
@openjdk
Copy link

openjdk bot commented May 23, 2024

@gnu-andrew @fitzsim Pushed as commit 4071b8c.

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

@fitzsim
Copy link
Contributor Author

fitzsim commented May 23, 2024

Thank you, @gnu-andrew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants