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.
|