主权项 |
1. A method of identifying potential deadlock conditions in a target multithreaded software application running within a virtual machine in a virtualized computer system, the method comprising:
recording an execution of the software application in the virtual machine, wherein the software application includes a code block that is skipped during the recording; identifying all thread creation and thread termination events that occur in the executed software application and a first order in which the identified events occur during the execution of the software application; identifying all resource locking and resource releasing events in the executed software application; generating a second order of events of the software application that is different from the first order of events and potentially triggers a deadlock condition due to timing of the resource locking and resource releasing events; initiating, by a hypervisor, a replay of the software application in the virtual machine based on the recording of the execution of the software application determining, by the hypervisor, the code block that was skipped during the recording in the virtual machine and executing the code block during the replay; monitoring, by the hypervisor, execution of the replay of the software application by the virtual machine to determine when execution of the replay in the virtual machine reaches a point in the replay of the software application within the code block where the second order of events differs from the first order of events; in response to determining the point, introducing, by the hypervisor, a scheduling change to execute the software application in the virtual machine with the generated second order of events; and in response to determining the point, automatically switching from replaying of the software application using the recording from within the code block to executing the software application in the virtual machine with the generated second order of events to determine whether the potential deadlock condition is triggered. |