VirtualBox

10 年 前 建立

10 年 前 結束

#13789 closed defect (fixed)

Unregistering VM deadlock

回報者: a.urakov 負責人:
元件: other 版本: VirtualBox 4.3.20
關鍵字: unregister, deadlock 副本:
Guest type: all Host type: Linux

描述

There is possible deadlock situation when unregistering VMs. It occurs when different VMs are detaching mediums and removing mediums registry at the same time.

In our case we have two machines, cloned from common VM with link option (but, theoretically, situation may occur in case when there is two different and not linked VMs due to global medium iterating when removing medium registry). Let's common medium will be named common.vdi and its linked clones will be named as 1.vdi and 2.vdi.

So, when we unregister VMs 1 and 2 at the same time and VM 1 is detaching mediums it holds read lock on 1.vdi (at Machine::detachAllMedia) and tries to get read lock on medium parent (common.vdi) at the same function below.

At the same time VM 2 is removing medium registry and it holds write lock on common.vdi (at VirtualBox::unregisterMachine) and tries to get write lock on its every children (including 1.vdi) in recursive call of Medium::removeRegistry (called at VirtualBox::unregisterMachine below).

Functions Medium::removeRegistry and Medium::addRegistry themselves take write locks on mediums, may be getting read lock only for Medium::getAnyMachineBackref call in VirtualBox::unregisterMachine function will be a good idea? Also may be release read lock on medium after we got its parent and before we are going to iterate through parents in Machine::detachAllMedia function?

Thank you in advance!

附加檔案 (1)

backtrace.log (8.2 KB ) - 10 年 前, 由 a.urakov 新增
Also attached gdb backtrace of deadlocked threads

下載所有附檔: .zip

更動歷史 (2)

10 年 前a.urakov 編輯

附檔: 新增 backtrace.log

Also attached gdb backtrace of deadlocked threads

comment:1 10 年 前Frank Mehnert 編輯

狀態: newclosed
處理結果: fixed

Fix is part of VBox 4.3.22.

注意: 瀏覽 TracTickets 來幫助您使用待辦事項功能

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette