RFR: 8306580: Propagate CDS dumping errors instead of directly exiting the VM
Thomas Stuefe
stuefe at openjdk.org
Thu May 23 15:55:02 UTC 2024
On Thu, 23 May 2024 15:31:50 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
> Currently, when CDS dumping run into an unrecoverable error (e.g., file I/O error, out of memory), it calls MetaspaceShared::unrecoverable_writing_error(), which directly exits the VM. Some of these errors can be propagated to the caller for a normal exit.
>
> This change introduces `MetaspaceShared::writing_error()` to report errors without exiting the VM. The function `MetaspaceShared::unrecoverable_writing_error()` now should only be used for errors that require the VM to exit. Verifier with tier1-5 tests.
Hi Matias,
I wondered why we would need this, but the JVM crashing because we dump via jcmd is a compelling argument :)
However, I am not sure how many of these things would work. E.g. when encountering an IO error on open, do we now continue with invalid FILE now? Same for memory allocation.
I think there must be some way to jump out of dumping.
src/hotspot/share/cds/archiveBuilder.cpp line 332:
> 330: if (!rs.is_reserved()) {
> 331: log_error(cds)("Failed to reserve " SIZE_FORMAT " bytes of output buffer.", buffer_size);
> 332: MetaspaceShared::writing_error();
I don't understand how that could work. Would the subsequent access to rs.base not crash the VM?
-------------
PR Review: https://git.openjdk.org/jdk/pull/19370#pullrequestreview-2074383092
PR Review Comment: https://git.openjdk.org/jdk/pull/19370#discussion_r1611939236
More information about the hotspot-runtime-dev
mailing list