JDK-8252148 : vmError::controlled_crash should be #ifdef ASSERT and move tests to gtest
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-08-21
  • Updated: 2022-09-26
  • Resolved: 2020-12-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b02Fixed
Related Reports
Relates :  
Description
vmError::controlled_crash and the supporting infrastructure is defined within an #ifndef PRODUCT block.  But much of what it does involves stuff that is #ifdef ASSERT.  And the tests that use this mechanism, such as ErrorHandler.java, all @requires vm.debug == true.

Instead of being #ifndef PRODUCT, controlled_crash should be #ifdef ASSERT.

Also controlled_crash() has a set of specific asserts that it tests and these asserts should be in a gtest instead.  This change should fix the string output with ExecuteUnitTests to match what is in the hs_err_pid file. eg:

#  assert(how == 0) failed: test assert

rather than just "assert failed: test assert".

Comments
Changeset: c37eabe7 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2020-12-15 20:48:18 +0000 URL: https://git.openjdk.java.net/jdk/commit/c37eabe7
15-12-2020

I'd like to keep the ErrorHandlerTest switch inside the hotspot, independently from gtests. Its value goes way beyond specific signal handler tests, as a general way to induce an almost real fault into the VM for test purposes. I use it a lot, for many purposes. If we remove it, can we revive the controlled-crash capability in some other form as hotspot switch?
16-11-2020

This should be a gtest. Pointer to test (additional new test). https://cr.openjdk.java.net/~kbarrett/8251850/open.03/src/hotspot/share/utilities/vmError.cpp.udiff.html https://cr.openjdk.java.net/~kbarrett/8251850/open.03/test/hotspot/jtreg/runtime/ErrorHandling/ErrorHandler.java.udiff.html
31-08-2020