Skip to content

JDK-8301477: Replace NULL with nullptr in os/aix #12313

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 2 commits into from

Conversation

jdksjolen
Copy link
Contributor

@jdksjolen jdksjolen commented Jan 31, 2023

Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory os/aix. Unfortunately the script that does the change isn't perfect, and so we
need to comb through these manually to make sure nothing has gone wrong. I also review these changes but things slip past my eyes sometimes.

Here are some typical things to look out for:

  1. No changes but copyright header changed (probably because I reverted some changes but forgot the copyright).
  2. Macros having their NULL changed to nullptr, these are added to the script when I find them. They should be NULL.
  3. nullptr in comments and logs. We try to use lower case "null" in these cases as it reads better. An exception is made when code expressions are in a comment.

An example of this:

// This function returns null
void* ret_null();
// This function returns true if *x == nullptr
bool is_nullptr(void** x);

Note how nullptr participates in a code expression here, we really are talking about the specific value nullptr.

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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12313

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2023

👋 Welcome back jsjolen! 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 Jan 31, 2023

@jdksjolen The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jan 31, 2023
@jdksjolen jdksjolen marked this pull request as ready for review January 31, 2023 10:27
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 31, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 31, 2023

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

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

LGTM.

My eyes still twitch a bit each time I read "null" in comments, though ;-)

@openjdk
Copy link

openjdk bot commented Jan 31, 2023

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

8301477: Replace NULL with nullptr in os/aix

Reviewed-by: stuefe, coleenp, tsteele

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

  • 55e6bb6: 8302685: Some javac unit tests aren't reliably closing open files
  • f5a1276: 8262895: [macos_aarch64] runtime/CompressedOops/CompressedClassPointers.java fails with 'Narrow klass base: 0x0000000000000000' missing from stdout/stderr
  • 2fe4e5f: 8303169: Remove Windows specific workaround from libdt
  • f2b03f9: 8303051: Stop saving 5 chunks in each ChunkPool
  • fbc036e: 8303135: JFR: Log periodic events using periodic tag
  • dbb5581: 8081474: SwingWorker calls 'done' before the 'doInBackground' is finished
  • 306134d: 8300792: Refactor examples in java.net.http to use @snippet
  • a2c5a4a: 8302732: sun/net/www/http/HttpClient/MultiThreadTest.java still failing intermittently
  • db217c9: 8292583: Comment for ciArrayKlass::make is wrong
  • 2613b94: 8302149: Speed up compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
  • ... and 449 more: https://git.openjdk.org/jdk/compare/107e184d59c0bbed6441a3c1a9bfd4527da3bce5...master

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 Jan 31, 2023
@jdksjolen
Copy link
Contributor Author

Hi @backwaterred, would you mind testing this patch to confirm that it works? Thanks!

@backwaterred
Copy link
Contributor

Hi @backwaterred, would you mind testing this patch to confirm that it works? Thanks!

Hi @jdksjolen, compiling on AIX took a little bit of work. I can build with these changes. Let me know if there is a more convenient way to get them to you.

Testing is underway. I will post when it completes.

@backwaterred
Copy link
Contributor

backwaterred commented Feb 15, 2023

With the patch I added above, testing on AIX looks good. Thanks for your work on these changes, and for pinging me to test them out.

@jdksjolen
Copy link
Contributor Author

jdksjolen commented Feb 17, 2023

With the patch I added above, testing on AIX looks good. Thanks for your work on these changes, and for pinging me to test them out.

Hi, thanks for providing the patch. I applied it with two changes of my own:

-  size_t stack_size = (size_t)nullptr;
+  size_t stack_size = 0;

The line above is: stackptr_t stack_base = nullptr;, so it's likely that assigning both to NULL was a mistake that wasn't caught by the compiler (as NULL == 0).

And

-  while ((*pc2 != (size_t)nullptr) && (searchcount++ < MAX_FUNC_SEARCH_LEN)) {
+ while ((*pc2 != 0) && (searchcount++ < MAX_FUNC_SEARCH_LEN)) {

Here I thought maybe we dereference the pointer by accident, and we really meant while ((pc2 != nullptr)), but just below that we have:

  if (*pc2 != 0) {
    trcVerbose("no traceback table found");
    return false;
  }

It's unlikely you make the same mistake twice, and this time referring to the value as 0 instead of NULL.

@jdksjolen jdksjolen closed this Feb 17, 2023
@jdksjolen jdksjolen reopened this Feb 17, 2023
@jdksjolen
Copy link
Contributor Author

Thanks for the re-approval.

/integrate

@openjdk
Copy link

openjdk bot commented Mar 7, 2023

Going to push as commit 43288bb.
Since your change was applied there have been 568 commits pushed to the master branch:

  • 008c5eb: 8303621: BitMap::iterate should support lambdas and other function objects
  • 52d3008: 8303497: [s390x] ProblemList TestUnreachableInnerLoop.java
  • 3f2d929: 8303511: C2: assert(get_ctrl(n) == cle_out) during unrolling
  • 7fbfc88: 8303534: Merge CompactibleSpace into ContiguousSpace
  • 97c25df: 8204550: NMT: RegionIterator does not need to keep _current_size
  • 94eda53: 8201516: DebugNonSafepoints generates incorrect information
  • c51d40c: 8303607: SunMSCAPI provider leaks memory and keys
  • f64ed09: 8303540: Eliminate unnecessary reference to javac internal class
  • ccfe167: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test
  • cfb0a25: 8303440: The "ZonedDateTime.parse" may not accept the "UTC+XX" zone id
  • ... and 558 more: https://git.openjdk.org/jdk/compare/107e184d59c0bbed6441a3c1a9bfd4527da3bce5...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 7, 2023

@jdksjolen Pushed as commit 43288bb.

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

Successfully merging this pull request may close these issues.

4 participants