• E
    event: fix event-handling data race · a11bd2e6
    Eric Blake 提交于
    This bug has been present since before the time that commit
    f8a519 (Dec 2008) tried to make the dispatch loop re-entrant.
    
    Dereferencing eventLoop.handles outside the lock risks crashing, since
    any other thread could have reallocated the array in the meantime.
    It's a narrow race window, however, and one that would have most
    likely resulted in passing bogus data to the callback rather than
    actually causing a segv, which is probably why it has gone undetected
    this long.
    
    * daemon/event.c (virEventDispatchHandles): Cache data while
    inside the lock, as the array might be reallocated once outside.
    a11bd2e6
event.c 20.9 KB