Skip to content

8342868: Errors related to unused code on Windows after 8339120 in core libs #21654

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TheShermanTanker
Copy link
Contributor

@TheShermanTanker TheShermanTanker commented Oct 23, 2024

After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did


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-8342868: Errors related to unused code on Windows after 8339120 in core libs (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21654

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 23, 2024

👋 Welcome back jwaters! 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 Oct 23, 2024

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

8342868: Errors related to unused code on Windows after 8339120 in core libs

Reviewed-by: naoto, jlu

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 3566 new commits pushed to 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 changed the title 8342868 8342868: Errors related to unused code on Windows after 8339120 in core libs Oct 23, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 23, 2024
@openjdk
Copy link

openjdk bot commented Oct 23, 2024

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

  • core-libs
  • i18n
  • net

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.

@mlbridge
Copy link

mlbridge bot commented Oct 23, 2024

Webrevs

@TheShermanTanker
Copy link
Contributor Author

Bumping, please advise on whether the fixes are correct or not


/*
Copy link
Member

Choose a reason for hiding this comment

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

Don't understand this one at all - what did gcc actually complain about here? This code all seems used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The warning received is that got is set but not used - I had a look at getLocaleInfoWrapper and it seems like it has no side effects, its only purpose is to return a value, which is the variable got in this case. I'm pretty certain got not being used is a bug, and that it is needed somewhere, but someone forgot to hook it up to whatever needs it

Copy link
Member

Choose a reason for hiding this comment

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

It does seem a bug, where the return value is not handled correctly. Can you please file a separate bug?

Copy link
Member

@justin-curtis-lu justin-curtis-lu Oct 30, 2024

Choose a reason for hiding this comment

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

I had a look at getLocaleInfoWrapper and it seems like it has no side effects, its only purpose is to return a value

While got is not needed here, I am not convinced that getLocaleInfoWrapper is not used, so we shouldn't comment out all of the code, but rather just remove got. getLocaleInfoWrapper updates the outbound variable pattern (see https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex), which is used to get the right string pattern from fixes.

Usually, based on got, appropriate action is taken, but that's not needed in this case, because pattern is either updated or remains its fallback 0 value. So I presume that is why got is ignored in this case.

We could just add that got removal to this patch, what do you think @naotoj?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, Justin. That is correct. Only pattern is relevant here. No need to check got so it can safely be removed.

Copy link
Member

Choose a reason for hiding this comment

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

Not my area but this fix looks reasonable.

@@ -232,7 +232,7 @@ static int getWinTimeZone(char *winZoneName, size_t winZoneNameBufSize)
WCHAR stdNameInReg[MAX_ZONE_CHAR];
TziValue tempTzi;
WCHAR *stdNamePtr = tzi.StandardName;
int onlyMapID;
// int onlyMapID;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this became unused with JDK-8209167, so deleting it seems fine to me.

@@ -47,7 +47,7 @@ static jfieldID ntlm_ctxHandleID;
static jfieldID ntlm_crdHandleID;
static jfieldID status_seqCompleteID;

static HINSTANCE lib = NULL;
// static HINSTANCE lib = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this became unused with JDK-7030256, so removal seems fine.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 31, 2024
Copy link
Member

@justin-curtis-lu justin-curtis-lu left a comment

Choose a reason for hiding this comment

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

Locale and TimeZone files LGTM. I also think its safe to just delete the offending onlyMapID and got (as opposed to commenting), since there is no bug and they are simply unusued.

@TheShermanTanker
Copy link
Contributor Author

Thanks for the reviews! I would delete them entirely, but I don't want to invalidate the existing reviews and force you guys to re-approve again :(

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 2, 2024

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep it open Skara, I'm waiting for the other Pull Requests to be approved so I can do them all at once

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 30, 2024

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Stop asking, I still need awt and accessibility to be approved :(

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 27, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep open please

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 25, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep open please

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 25, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Keep it open please. Life is not being kind to me at the moment, I apologize for the delays

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 22, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

Stay open

@bridgekeeper
Copy link

bridgekeeper bot commented May 21, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

/touch

@openjdk
Copy link

openjdk bot commented May 21, 2025

@TheShermanTanker The pull request is being re-evaluated and the inactivity timeout has been reset.

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 18, 2025

@TheShermanTanker This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@TheShermanTanker
Copy link
Contributor Author

/touch

@openjdk
Copy link

openjdk bot commented Jun 19, 2025

@TheShermanTanker The pull request is being re-evaluated and the inactivity timeout has been reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] i18n [email protected] net [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants