RFR: 8338007: [JVMCI] ResolvedJavaMethod.reprofile can crash ciMethodData

Doug Simon dnsimon at openjdk.org
Mon Oct 28 19:37:55 UTC 2024


On Mon, 28 Oct 2024 19:13:28 GMT, Tom Rodriguez <never at openjdk.org> wrote:

> Graal unit testing uses ResolvedJavaMethod.reprofile to reset profiles between test but the current code rewrites the layout in a non-atomic way which can break other readers.  Instead perform the reinitialization at a safepoint which should protect all readers from seeing any transient initialization states.

LGTM.

src/hotspot/share/oops/methodData.cpp line 1230:

> 1228: }
> 1229: 
> 1230: // Reinitialize the storage of an existing MDO at a safepoint.  Doing it this will ensure it's not

Doing it this *way* will

-------------

Marked as reviewed by dnsimon (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21746#pullrequestreview-2400036182
PR Review Comment: https://git.openjdk.org/jdk/pull/21746#discussion_r1819644517


More information about the graal-dev mailing list