[PATCH] remote_daemon: Don't run virStateCleanup() if virStateReload() is still running

Michal Prívozník mprivozn at redhat.com
Wed May 18 12:51:48 UTC 2022


On 5/5/22 13:10, Michal Prívozník wrote:
> On 4/25/22 11:06, Michal Privoznik wrote:
>> When a SIGHUP is received a thread is spawned that runs
>> virStateReload(). However, if SIGINT is received while the former
>> thread is still running then we may get into problematic
>> situation: the cleanup code in main() sees drivers initialized
>> and thus calls virStateCleanup(). So now we have two threads, one
>> running virStateReload() the other virStateCleanup(). In this
>> situation it's very likely that a race condition occurs and
>> either of threads causes SIGSEGV.
>>
>> To fix this, unmark drivers as initialized in the
>> virStateReload() thread for the time the function runs.
>>
>> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075837
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>>  src/remote/remote_daemon.c | 17 +++++++++++------
>>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> Polite ping.

Less polite ping.

Michal



More information about the libvir-list mailing list