RFR: Check for NULL in is-alive-closures

Roman Kennke rkennke at redhat.com
Fri Feb 2 00:06:16 UTC 2018


I've run into a SEGV in referenceProcessor, because a referent was
NULL. This sequence:

verify_referent(obj);
if (is_alive_non_header()->do_object_b(java_lang_ref_Reference::referent(obj)))
{

means that if the referent is NULL, it is passed to do_object_b(),
which assumes it to be not NULL. I have no idea how this hasn't blown
up before?

I was a bit unsure if we should return true (is-alive) or false
(is-not-alive) when observing NULL referent. I think it is better to
say it's alive, because then the Reference object is not put into
discovered list, but treated as regular oop.

http://cr.openjdk.java.net/~rkennke/fixisalivecl/webrev.00/

Good?

Roman


More information about the shenandoah-dev mailing list