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

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


On Tue, 8 Jul 2025 13:25:40 GMT, Aleksey Shipilev <shade 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.
>
> You know what, this is fine as it is.
> 
> The whole business with `ShenandoahForwarding::klass` is super-duper-awkward, and verifier already touches the forwardees using that method in places where it really should not. It needs a more comprehensive fix for `+UCOH`.
> 
> It is a mess, but not your mess. So integrate this one, we will figure out `ShenandoahForwarding::klass` after this.

Thanks @shipilev and @rkennke !

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

PR Comment: https://git.openjdk.org/jdk/pull/26117#issuecomment-3051146037


More information about the shenandoah-dev mailing list