I had the simple suggestion of instead using this:
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -310,8 +310,8 @@ void virChrdevFree(virChrdevsPtr devs)
     if (!devs || !devs->hash)
         return;
 
-    virMutexLock(&devs->lock);
     virHashForEach(devs->hash, virChrdevFreeClearCallbacks, NULL);
+    virMutexLock(&devs->lock);
     virHashFree(devs->hash);
     virMutexUnlock(&devs->lock);
     virMutexDestroy(&devs->lock);


But then this breaks as well:
 src/util/virfdstream.c
 if (fdst->icbFreeOpaque)
 (Segfaults as fdst became 0 which was formerly indirectly blocked by the 
devs->lock being held.

Actually if there is no FDST anymore after the lock is acquired we can
just do an early exit.

--- a/src/util/virfdstream.c
+++ b/src/util/virfdstream.c
@@ -1435,6 +1435,8 @@ int virFDStreamSetInternalCloseCb(virStr
                                   virFDStreamInternalCloseCbFreeOpaque fcb)
 {
     virFDStreamDataPtr fdst = st->privateData;
+    if (!fdst)
+        return -1;
 
     virObjectLock(fdst);

Lets try to add a check to that, I don't think this is the right
solution yet, but maybe with all that insight added later on others on
upstream can help again to straighten the fix.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1822096

Title:
  libvirt hangs after utah workload is aborted

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1822096/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to