Skip to content

8354489: Some callers of VMError::report_and_die think it can return - #32054

Open
Sorna-Sarathi wants to merge 1 commit into
openjdk:masterfrom
Sorna-Sarathi:JDK-8354489-cleanup
Open

8354489: Some callers of VMError::report_and_die think it can return#32054
Sorna-Sarathi wants to merge 1 commit into
openjdk:masterfrom
Sorna-Sarathi:JDK-8354489-cleanup

Conversation

@Sorna-Sarathi

@Sorna-Sarathi Sorna-Sarathi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

VMError::report_and_die is [[noreturn]] and cannot return, even when UseOSErrorReporting is enabled.

Remove misleading comments and dead code from report_error(os_windows.cpp) and report_vm_out_of_memory (debug.cpp).

JBS Issue: JDK-8354489



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8354489: Some callers of VMError::report_and_die think it can return (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32054

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

👋 Welcome back ssarathi! 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 commented Jul 27, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the hotspot hotspot-dev@openjdk.org label Jul 27, 2026
@openjdk

openjdk Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Sorna-Sarathi 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 commented Jul 27, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 27, 2026
@mlbridge

mlbridge Bot commented Jul 27, 2026

Copy link
Copy Markdown

Webrevs

@offamitkumar offamitkumar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

@dholmes-ora dholmes-ora left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good but one further change requested. Thanks

Comment on lines 2674 to 2675
static inline void report_error(Thread* t, DWORD exception_code,
address addr, void* siginfo, void* context) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just an observation but this helper method has served no purpose since JDK-8080775 changed the VMError code back in JDK 9.

@@ -240,10 +240,6 @@ void report_vm_out_of_memory(const char* file, int line, size_t size,

VMError::report_and_die(Thread::current_or_null(), file, line, size, vm_err_type, detail_fmt, detail_args);
va_end(detail_args);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The va_end is also unreachable and should also be deleted.

I'm a little suprised the compiler doesn't complain about code after a noreturn method call.

@dholmes-ora dholmes-ora Jul 28, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm actually this occurs in a number of places, so we should either change all or none. So I think leave this for a separate issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I've already thought about that. As you said, it occurs in other functions too. So, I didn't remove here for consistency.

@dholmes-ora

Copy link
Copy Markdown
Member

There are other places that need fixing not mentioned in the JBS issue e.g. there are PosixSignals::pd_hotspot_signal_handler definitions which follow it with a ShouldNotReachHere().

@dholmes-ora

Copy link
Copy Markdown
Member

I think this needs some discussion we have a lot of conservative use of ShouldNotReachHere() after the calls, which are semantically equivalent to the guarantee that has been flagged here. So either they all need to be removed or they all stay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants