On Wed, 20 Aug 2025 at 08:19, Luc Michel <[email protected]> wrote:
> > It would be helpful if you could run "make check" under
> > the clang leak sanitizer with your patches added, to see
> > if it complains about anything. (Unfortunately it will
> > definitely complain about at least some pre-existing
> > leaks, I suspect.)
> Yes I did that before sending my series and fixed all my leaks. As you
> say there are some existing ones, mainly in the register API (IIRC it
> does create an object that is not correctly parented).
Yeah, register_init_block() seems to be broken in two ways:
(1) it calls object_initialize() rather than
object_initialize_child(), so the objects won't
be automatically unreffed; but it doesn't manually
unref them in register_finalize_block() either
(2) the TYPE_REGISTER objects are a subclass of TYPE_DEVICE,
but the code never calls realize on them. This means that
if you fix point (1) then you trip the assert in
qdev_assert_realized_properly_cb() which checks that
every TYPE_DEVICE in the QOM tree was realized...
-- PMM