Skip to content

8326433: Make file-local functions static in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c #18013

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

Closed
wants to merge 3 commits into from

Conversation

jianglizhou
Copy link
Contributor

@jianglizhou jianglizhou commented Feb 26, 2024

Please help review this trivial fix for resolving ld: error: duplicate symbol: closeDescriptors when static linking with both libjdwp and libjava, thanks.


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-8326433: Make file-local functions static in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18013

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

Using diff file

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

Webrev

Link to Webrev Comment

Sorry, something went wrong.

…ve/libjava/childproc.c and src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c.
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 26, 2024

👋 Welcome back jiangli! 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 Feb 26, 2024
@openjdk
Copy link

openjdk bot commented Feb 26, 2024

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

  • core-libs
  • serviceability

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 serviceability serviceability-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Feb 26, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 26, 2024

Webrevs

@@ -62,7 +62,7 @@ static char *skipNonWhitespace(char *p) {
// input/output/error file descriptors will not be closed
// by this function. This function returns 0 on failure
// and 1 on success.
int
static int
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should also make forkedChildProcess static. It was added at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -131,7 +131,6 @@ ssize_t writeFully(int fd, const void *buf, size_t count);
int restartableDup2(int fd_from, int fd_to);
int closeSafely(int fd);
int isAsciiDigit(char c);
int closeDescriptors(void);
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that most of the APIs in this file should be static. I don't think you should selectively deal with just one of them because of the conflict. Since this ends up being a more involved change, and is in a different component than the jdwp change, it should probably have a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@plummercj thanks for looking into this! Sounds good to make the additional local functions static in these files. Perhaps we can use two different FRs. I'll make the current one to handle the ones in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jianglizhou jianglizhou changed the title 8326433: Make libjdwp and libjava closeDescriptors() as static function 8326433: Make file-local functions static in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c Feb 26, 2024
Copy link
Contributor

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

@openjdk
Copy link

openjdk bot commented Feb 26, 2024

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

8326433: Make file-local functions static in src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c

Reviewed-by: cjplummer, sspitsyn

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

  • d22d890: 8325898: ChoiceFormat returns erroneous result when formatting bad pattern
  • 93feda3: 8322962: Upcall stub might go undetected when freezing frames
  • fc67c2b: 8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library
  • b87d9cf: 8325506: Ensure randomness is only read from provided SecureRandom object
  • 0963a4e: 8326699: Problemlist CertMsgCheck.java
  • bf13a4e: 8322881: java/nio/file/Files/CopyMoveVariations.java fails with AccessDeniedException due to permissions of files in /tmp

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.

➡️ 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 Feb 26, 2024
@jianglizhou
Copy link
Contributor Author

Looks good.

Thanks for the quick review, @plummercj.

@jianglizhou
Copy link
Contributor Author

Thanks for the review, @sspitsyn.

@jianglizhou
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 27, 2024

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

  • d22d890: 8325898: ChoiceFormat returns erroneous result when formatting bad pattern
  • 93feda3: 8322962: Upcall stub might go undetected when freezing frames
  • fc67c2b: 8325530: Vague error message when com.sun.tools.attach.VirtualMachine fails to load agent library
  • b87d9cf: 8325506: Ensure randomness is only read from provided SecureRandom object
  • 0963a4e: 8326699: Problemlist CertMsgCheck.java
  • bf13a4e: 8322881: java/nio/file/Files/CopyMoveVariations.java fails with AccessDeniedException due to permissions of files in /tmp

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 27, 2024

@jianglizhou Pushed as commit 0901ded.

💡 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
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

None yet

3 participants