JDK-8074860 : Structured Exception Catcher missing around CreateJavaVM on Windows
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2015-03-10
  • Updated: 2025-06-26
  • Resolved: 2015-04-03
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 9 Other Other
9 b64Fixed openjdk8u412Fixed openjdk8u412,shenandoah8u412Fixed
Related Reports
Relates :  
Relates :  
Description
When creating a VM on Windows, there is no __try/__except handler around CreateJavaVM. 

As a result, crashes in the VM initialization may not be caught and just terminate the VM without error log. A second effect is that SafeFetch32() does not work on 32bit Windows during initialization. 

Note that there still are protected areas of code, which explains why this error is seldom noticable: 

- test functions which may crash are called with "os::win32::call_test_func_with_wrapper()", which catches structured exceptions 

- on 64bit, dynamically generated code runs with SEH protection because we register SEH handlers for code areas: os::register_code_area(). This explains why SafeFetch32 on 64bit windows works and on 32bit windows crashes.

Note that once this is fixed, some places which now use CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED or os::win32::call_test_func_with_wrapper() can probably be simplified.


Comments
[jdk8u-fix-request] Approval Request from Frederic Thevenet The motivation for this backport is to help reduce the number of occurrences where a VM might terminate immediately without writing an error log Windows, making root cause analysis very difficult in such cases. Backport is not clean because of conflicting changes introduced subsequently to the original patch. Risk is low.
21-02-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/449 Date: 2024-02-20 18:31:41 +0000
20-02-2024

URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/883ae015914d User: lana Date: 2015-05-13 21:19:48 +0000
13-05-2015

URL: http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/883ae015914d User: dholmes Date: 2015-04-03 11:50:31 +0000
03-04-2015

A patch is done and awaiting review, see http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2015-March/014152.html
27-03-2015