-
Bug
-
Resolution: Fixed
-
P2
-
11, 12, 13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8227189 | 14 | Markus Grönlund | P2 | Resolved | Fixed | b05 |
JDK-8228278 | 13.0.2 | Markus Grönlund | P2 | Resolved | Fixed | b01 |
JDK-8228062 | 13.0.1 | Markus Grönlund | P2 | Resolved | Fixed | master |
JDK-8235440 | 11.0.7-oracle | Markus Grönlund | P2 | Resolved | Fixed | b01 |
JDK-8228873 | 11.0.5 | Markus Grönlund | P2 | Resolved | Fixed | b02 |
JDK-8240409 | openjdk8u262 | Markus Grönlund | P2 | Resolved | Fixed | team |
JDK-8227114 | na | Jaroslav Bachorík | P2 | Closed | Duplicate |
[4.642s][warning][jfr,system] Unable to commit. Requested size 24 too large
[4.642s][warning][jfr,system] Unable to commit. Requested size 27 too large
[4.642s][warning][jfr,system] Unable to commit. Requested size 27 too large
[4.643s][warning][jfr,system] Unable to commit. Requested size 27 too large
[4.643s][warning][jfr,system] Unable to commit. Requested size 24 too large
[4.643s][warning][jfr,system] Unable to commit. Requested size 27 too large
.,,
...
<non-deterministic crash point>
Reason:
Threads::create_vm() {
...
// Notify JVMTI agents that VM initialization is complete - nop if no agents.
JvmtiExport::post_vm_initialized();
JFR_ONLY(Jfr::on_vm_start();)
...
}
The valid offsets for the JfrJavaEventWriter are currently determined and setup during Jfr::on_vm_start().
When JFR initializes, there will be a lot of events of type jdk.ActiveSettingEvent generated. In fact, there will be enough of these events written to induce a flush of the thread local buffer. At the point of flush, because the correct offsets for the JfrJavaEventWriter are not yet properly setup, the JfrJavaEventWriter instance is not updated with new positions. This leads to the warning messages about "Unable to commit".
Unfortunately it gets worse: the offsets are statically initialized to "invalid_offset" (-1). But there are no assertions to validate that offsets have been properly initialized (i.e non "invalid_offset").
Because the oopDesc::long_field_put(int offset, jlong value) takes an int as the offset, a value of -1 is perfectly acceptable. So the value is written to oop - (1 * HeapWord), corrupting the memory address just prior to the oop.
Fix:
JfrJavaEventWriter::initialize() should move to JfrRecorder::create() to cover early initialization as well. Asserts should be added to the flush mechanism to verify correct offsets.
Longer term, maybe setting a field in an oop using a relative offset should not accept signed values, but only unsigned.
- backported by
-
JDK-8227189 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Resolved
-
-
JDK-8228062 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Resolved
-
-
JDK-8228278 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Resolved
-
-
JDK-8228873 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Resolved
-
-
JDK-8235440 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Resolved
-
-
JDK-8240409 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Resolved
-
-
JDK-8227114 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Closed
-
-
JDK-8243911 Starting a JFR recording in response to JVMTI VMInit and / or Java agent premain corrupts memory
-
- Closed
-
- relates to
-
JDK-8226779 [TESTBUG] Test JFR API from Java agent
-
- Resolved
-
-
JDK-8239140 Backport JFR to OpenJDK 8
-
- Resolved
-