]> git.proxmox.com Git - mirror_qemu.git/commit
util/async: print leaked BH name when AioContext finalizes
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 14 Apr 2021 20:02:47 +0000 (21:02 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 5 Jul 2021 10:40:32 +0000 (11:40 +0100)
commit023ca420ee3d4de76518d690afa98dcac33998ce
tree1ca73ab638e5bc249d9b678043fb2a54b08baa7d
parent0f08586c7171757d77c27ee6c606e8a1c44ac6e3
util/async: print leaked BH name when AioContext finalizes

BHs must be deleted before the AioContext is finalized. If not, it's a
bug and probably indicates that some part of the program still expects
the BH to run in the future. That can lead to memory leaks, inconsistent
state, or just hangs.

Unfortunately the assert(flags & BH_DELETED) call in aio_ctx_finalize()
is difficult to debug because the assertion failure contains no
information about the BH!

Use the QEMUBH name field added in the previous patch to show a useful
error when a leaked BH is detected.

Suggested-by: Eric Ernst <eric.g.ernst@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210414200247.917496-3-stefanha@redhat.com>
util/async.c