JDK-8227435 : Perf::attach() should not throw a java.lang.Exception
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 11,13,14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-07-09
  • Updated: 2020-06-08
  • Resolved: 2019-07-18
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 11 JDK 13 JDK 14
11.0.6Fixed 13.0.2Fixed 14 b07Fixed
Description
The Perf::attach() implementation on all operating systems checks, if the perf file has a sensible size (not 0 and a multiple of the page size). If this is not the case, it throws a java.lang.Exception.

This seems to be the wrong type of exception, especially because the Java method jdk.internal.perf.Perf.attach() does not declare it.

Instead a java.io.IOException message should be thrown, since it is declared to be thrown by the Java attach() method already and it makes sense semantically.

Note that this is usually only a temporary situation, after the JVM created the perf file. Barring an unfortunate crash, it will get the correct size shortly afterwards. But it might be one cause for the sporadic hangs of the MonitorVmStartTerminate jtreg test.

Comments
Fix request (13u, 11u) This patch fixes an issue seen in MonitorVmStartTerminate test. The patch applies cleanly.
03-09-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/9cfb9387a9e8 User: rschmelter Date: 2019-07-18 08:27:06 +0000
18-07-2019