VirtualBox

Opened 9 years ago

Closed 9 years ago

#13801 closed defect (fixed)

Save settings deadlock

Reported by: a.urakov Owned by:
Component: other Version: VirtualBox 4.3.20
Keywords: save, settings, deadlock, media Cc:
Guest type: all Host type: Linux

Description

There is possible deadlock on medium access when different machines save their settings. Deadlock occurs when these machines are commiting medias and saving modified registries at the same time.

In our case there are two machines (1 and 2) cloned with link option from common machine. We take snapshots of machines at the same time. So machine 1 saves modified registries (VirtualBox::saveModifiedRegistries()) for machine common (because information about 1 medias is saved in common settings due to linked cloning). Eventually it calls VirtualBox::saveMediaRegistry() which holds read lock on common medium and calls Medium::saveSettings() for every children. This recurses through all children mediums of common and holds read locks on all current recursion branch. So it tries to get read lock on 2 medium.

At the same time machine 2 commits media (Machine::commitMedia()). When it converts implicit attachment to normal it holds write lock on parent medium (the same medium thread 1 waits for) and tries to unlock all locked by session mediums (here I mean IMedium API-level locking, not object locking). Unlock procedure MediumLockList::Unlock() eventually calls Medium::unlockRead() for each medium in locked list (and common medium too). Medium::unlockRead() tries to get common medium write lock so threads are deadlocked.

Thank you in advance!

Attachments (1)

backtrace.log (10.3 KB ) - added by a.urakov 9 years ago.
Here is backtrace log of deadlocked threads

Download all attachments as: .zip

Change History (2)

by a.urakov, 9 years ago

Attachment: backtrace.log added

Here is backtrace log of deadlocked threads

comment:1 by Frank Mehnert, 9 years ago

Resolution: fixed
Status: newclosed

Fix is part of VBox 4.3.22.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use