Re: [libvirt PATCH] tests: fix double-lock of monitor in hotplug test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 12, 2020 at 18:36:38 +0000, Daniel Berrange wrote:
> The qemuMonitorTestNew() function returns with the monitor object
> locked, and expects it to still be locked when qemuMonitorTestFree
> is called.  The qemuhotplug test, however, explicitly unlocks the
> monitor, but then forgets to lock it again. As a result the
> qemuMonitorTestFree function is unlocking a mutex it doesn't own.
> 
> This bug has existed forever, but since we use normal POSIX mutexes
> and don't check the return value of pthread_mutex_lock/unlock we
> didn't see the error. It was harmless until the switch to the per
> monitor event loop which requires the thread synchronization to
> work reliably, whereupon it started crashing.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> ---
>  tests/qemuhotplugtest.c | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux