VirtualBox

Changeset 79786 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 15, 2019 11:08:36 AM (5 years ago)
Author:
vboxsync
Message:

IPRT/lockvalidator: Must serialize for detection before calling rtLockValidatorDeadlockDetection since it's worker (rtLockValidatorDdDoDetection) accesses volatile structures like RTLOCKVALRECSHRD::Shared.papOwners that can be reallocated to make room for more entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r76553 r79786  
    33733373                 || pRecU->Excl.hClass->cMsMinDeadlock > RT_INDEFINITE_WAIT))
    33743374        rc = VINF_SUCCESS;
    3375     else if (!rtLockValidatorIsSimpleNoDeadlockCase(pRecU))
    3376         rc = rtLockValidatorDeadlockDetection(pRecU, pThreadSelf, pSrcPos);
     3375    else
     3376    {
     3377        rtLockValidatorSerializeDetectionEnter();
     3378        if (!rtLockValidatorIsSimpleNoDeadlockCase(pRecU))
     3379            rc = rtLockValidatorDeadlockDetection(pRecU, pThreadSelf, pSrcPos);
     3380        rtLockValidatorSerializeDetectionLeave();
     3381    }
    33773382
    33783383    if (RT_SUCCESS(rc))
     
    36753680                 || pRec->hClass->cMsMinDeadlock > cMillies))
    36763681        rc = VINF_SUCCESS;
    3677     else if (!rtLockValidatorIsSimpleNoDeadlockCase(pRecU))
    3678         rc = rtLockValidatorDeadlockDetection(pRecU, pThreadSelf, pSrcPos);
     3682    else
     3683    {
     3684        rtLockValidatorSerializeDetectionEnter();
     3685        if (!rtLockValidatorIsSimpleNoDeadlockCase(pRecU))
     3686            rc = rtLockValidatorDeadlockDetection(pRecU, pThreadSelf, pSrcPos);
     3687        rtLockValidatorSerializeDetectionLeave();
     3688    }
    36793689
    36803690    if (RT_SUCCESS(rc))
Note: See TracChangeset for help on using the changeset viewer.

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