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

8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array' #19349

Closed
wants to merge 2 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented May 22, 2024

When running hs :tier1 tests, with ubsan enabled (configure flag --enable-ubsan), in test runtime/CommandLine/PrintClasses_id0.jtr
this error is reported ; seems we miss a nullptr check that is in place at similar coding in instanceKlass.cpp .

/jdk/src/hotspot/share/oops/instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array'
#0 0x7fed098d2362 in InstanceKlass::print_on(outputStream*) const /jdk/src/hotspot/share/oops/instanceKlass.cpp:3550
#1 0x7fed09897cdc in PrintClassClosure::do_klass(Klass*) /jdk/src/hotspot/share/oops/instanceKlass.cpp:2228
#2 0x7fed08bed334 in ClassLoaderData::classes_do(KlassClosure*) /jdk/src/hotspot/share/classfile/classLoaderData.cpp:387
#3 0x7fed08c06403 in ClassLoaderDataGraph::classes_do(KlassClosure*) /jdk/src/hotspot/share/classfile/classLoaderDataGraph.cpp:303
#4 0x7fed09108768 in VM_PrintClasses::doit() /jdk/src/hotspot/share/services/diagnosticCommand.cpp:989
#5 0x7fed0b776c38 in VM_Operation::evaluate() /jdk/src/hotspot/share/runtime/vmOperations.cpp:75
#6 0x7fed0b7af23e in VMThread::evaluate_operation(VM_Operation*) /jdk/src/hotspot/share/runtime/vmThread.cpp:283
#7 0x7fed0b7b0a67 in VMThread::inner_execute(VM_Operation*) /jdk/src/hotspot/share/runtime/vmThread.cpp:427
#8 0x7fed0b7b1681 in VMThread::loop() /jdk/src/hotspot/share/runtime/vmThread.cpp:493
#9 0x7fed0b7b1681 in VMThread::loop() /jdk/src/hotspot/share/runtime/vmThread.cpp:478
#10 0x7fed0b7b182d in VMThread::run() /jdk/src/hotspot/share/runtime/vmThread.cpp:177
#11 0x7fed0b4e8b0f in Thread::call_run() /jdk/src/hotspot/share/runtime/thread.cpp:225
#12 0x7fed0a9dae75 in thread_native_entry /jdk/src/hotspot/os/linux/os_linux.cpp:846
#13 0x7fed10fed6e9 in start_thread (/lib64/libpthread.so.0+0xa6e9) (BuildId: 2f8d3c2d0f4d7888c2598d2ff6356537f5708a73)
#14 0x7fed1051550e in clone (/lib64/libc.so.6+0x11850e) (BuildId: f732026552f6adff988b338e92d466bc81a01c37)


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

Warning

 ⚠️ Found leading lowercase letter in issue title for 8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array'

Issue

  • JDK-8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array' (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19349

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 22, 2024

👋 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 May 22, 2024

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

8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array'

Reviewed-by: stefank, mdoerr

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

  • 2581935: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations
  • b890336: 8328083: degrade virtual thread support for GetObjectMonitorUsage
  • 4e6d851: 8325324: Implement JEP 477: Implicitly Declared Classes and Instance Main Methods (Third Preview)
  • 612ae92: 8332735: [JVMCI] Add extra JVMCI events for exception translation
  • 1ea76d3: 8332675: test/hotspot/jtreg/gc/testlibrary/Helpers.java compileClass javadoc does not match after 8321812
  • 94af3c2: 8329203: Parallel: Investigate Mark-Compact for Full GC to decrease memory usage
  • 1e5a278: 8332676: Remove unused BarrierSetAssembler::incr_allocated_bytes
  • c2180d1: 8315767: InetAddress: constructing objects from BSD literal addresses
  • 2a11e0d: 8332743: Update comment related to JDK-8320522
  • 6829d9a: 8332122: [nmt] Totals for malloc should show total peak
  • ... and 10 more: https://git.openjdk.org/jdk/compare/9ca90ccd6bfec76e54e2e870bd706fad5abf233c...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 changed the title JDK-8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array' 8332720: ubsan: instanceKlass.cpp:3550:76: runtime error: member call on null pointer of type 'struct Array' May 22, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label May 22, 2024
@openjdk
Copy link

openjdk bot commented May 22, 2024

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

  • hotspot

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 hotspot-dev@openjdk.org label May 22, 2024
@mlbridge
Copy link

mlbridge bot commented May 22, 2024

Webrevs

Comment on lines 3550 to 3552
st->print(BULLET"default_methods: ");
if (default_methods() != nullptr) { default_methods()->print_value_on(st); }
st->cr();
Copy link
Member

Choose a reason for hiding this comment

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

The `default_vtable_indicies() printing looks like this:

  if (default_vtable_indices() != nullptr) {
    st->print(BULLET"default vtable indices:   "); default_vtable_indices()->print_value_on(st);       st->cr();
  }

Should this change make the code follow the same pattern?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, can you put the BULLET"default methods inside the condition to test if default methods are non-null? You could fold it into the below conditional, and have the Verbose test to print each method.

Aside, I thought there was supposed to be a blank in between concatenated strings because some compiler complained.

@MBaesken
Copy link
Member Author

Should this change make the code follow the same pattern?

Good question, I considered this too.
Should I change it what do you think?

@stefank
Copy link
Member

stefank commented May 22, 2024

Should this change make the code follow the same pattern?

Good question, I considered this too. Should I change it what do you think?

I usually don't look at these fields, so maybe someone from the Runtime team can help decide?

@MBaesken
Copy link
Member Author

Hi Coleen and Stefan, I adjusted/moved the if check .

Aside, I thought there was supposed to be a blank in between concatenated strings because some compiler complained.

It is the same at a lot of places in the file so I did not change it here .

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

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM.

@MBaesken
Copy link
Member Author

Thanks for the reviews !

/integrate

@openjdk
Copy link

openjdk bot commented May 23, 2024

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

  • 2581935: 8332528: Generate code in SwitchBootstraps.generateTypeSwitch that require fewer adaptations
  • b890336: 8328083: degrade virtual thread support for GetObjectMonitorUsage
  • 4e6d851: 8325324: Implement JEP 477: Implicitly Declared Classes and Instance Main Methods (Third Preview)
  • 612ae92: 8332735: [JVMCI] Add extra JVMCI events for exception translation
  • 1ea76d3: 8332675: test/hotspot/jtreg/gc/testlibrary/Helpers.java compileClass javadoc does not match after 8321812
  • 94af3c2: 8329203: Parallel: Investigate Mark-Compact for Full GC to decrease memory usage
  • 1e5a278: 8332676: Remove unused BarrierSetAssembler::incr_allocated_bytes
  • c2180d1: 8315767: InetAddress: constructing objects from BSD literal addresses
  • 2a11e0d: 8332743: Update comment related to JDK-8320522
  • 6829d9a: 8332122: [nmt] Totals for malloc should show total peak
  • ... and 10 more: https://git.openjdk.org/jdk/compare/9ca90ccd6bfec76e54e2e870bd706fad5abf233c...master

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 labels May 23, 2024
@openjdk
Copy link

openjdk bot commented May 23, 2024

@MBaesken Pushed as commit e19a421.

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

@kimbarrett
Copy link

Aside, I thought there was supposed to be a blank in between concatenated strings because some compiler complained.

It is the same at a lot of places in the file so I did not change it here .

A drive-by followup:
"..."identifier is syntactically a user-defined literal, so we need a space
to dodge that syntax. For simplicity, the "rule" that has been adopted is to
always separate string literals from adjacent code. But apparently not here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants