JDK-8186349 : [windows] Centralize dbghelp handling code
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9,10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2017-08-17
  • Updated: 2019-05-22
  • Resolved: 2017-08-29
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 10
10 b23Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
This is a spinoff from [1]. The original issue and the patch originally proposed (see [2]) were too unwieldy, so I decided to split it up in multiple patches. This is the first patch.

Functions from dbghelp.dll are not threadsafe; calls to them must be synchronized. But dbghelp.dll can be used by the two live WindowsDecoder objects in parallel from different threads. In addition to that, dbghelp.dll functions are used from other places within os_windows.cpp, when writing minidumps. 

So, dbghelp.dll may get loaded and used from different independent places in the VM, which do not synchronize access. Apart from that, it is a lot of code redundancy. 

Proposed fix: Centralize dbghelp handling into a singleton.





[1] https://bugs.openjdk.java.net/browse/JDK-8185712
[2] http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2017-August/024286.html
Comments
I've tested the final reviewed changes with hotspot tier1 ~ tier5 tests on windows-x64 and windows-x86 using RBT and found no new failures.
28-08-2017