Integrated: 8361363: ShenandoahAsserts::print_obj() does not work for forwarded objects and UseCompactObjectHeaders

Thomas Stuefe stuefe at openjdk.org
Wed Jul 9 05:19:49 UTC 2025


On Thu, 3 Jul 2025 14:22:32 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> `ShenandoahAsserts::print_obj()` does not work for COH if the object is forwarded, since the mark word is overwritten with a forwarding pointer.
> 
> Depending on the size of the non-null bits of the forwardee (whether it spills into the nKlass bits), nKlass is either zero or garbage. So we get either an "assert(!is_null(v)) failed: narrow klass value can never be zero", or a SIGSEGV. 
> 
> Fix is trivial: don't use obj->klass() directly but get it from ShenandoahForwarding.

This pull request has now been integrated.

Changeset: fe264676
Author:    Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/fe264676337cdef0d7477b0b57ff9d2fe8f9fc0f
Stats:     3 lines in 1 file changed: 2 ins; 0 del; 1 mod

8361363: ShenandoahAsserts::print_obj() does not work for forwarded objects and UseCompactObjectHeaders

Reviewed-by: rkennke, shade

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

PR: https://git.openjdk.org/jdk/pull/26117


More information about the shenandoah-dev mailing list