Skip to content
  • Stefan Hajnoczi's avatar
    023ca420
    util/async: print leaked BH name when AioContext finalizes · 023ca420
    Stefan Hajnoczi authored
    
    
    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: default avatarEric Ernst <eric.g.ernst@gmail.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20210414200247.917496-3-stefanha@redhat.com>
    023ca420
    util/async: print leaked BH name when AioContext finalizes
    Stefan Hajnoczi authored
    
    
    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: default avatarEric Ernst <eric.g.ernst@gmail.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20210414200247.917496-3-stefanha@redhat.com>
Loading