JDK 11 | JDK 17 | JDK 20 | JDK 21 |
---|---|---|---|
11.0.20Fixed | 17.0.8Fixed | 20.0.2Fixed | 21 b14Fixed |
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
After JDK-8237354, we noticed heap dumps could become corrupted. The root cause is in FileWriter::write_buf() in heapDumperCompression.cpp, for n = os::write(_fd, buf, (uint) size); n could be > 0 but smaller than size. In this case, there should be a loop to retry os::write() for the remaining bytes in buf. There was such a loop in DumpWriter::write_internal() before JDK-8237354. This problem is well documented in the man page for write(): https://man7.org/linux/man-pages/man2/write.2.html#RETURN_VALUE. In our case, we see the corruption frequently because we support dumping heap to a socket or pipe.
|