VirtualBox

Ignore:
Timestamp:
Feb 9, 2010 12:54:20 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57426
Message:

AsyncCompletion: Introduce range locks to prevent concurrent access to the same file range. Fixes inconsistent data for tasks with unaligned tasks where we have to use bounce buffers (i.e block table updates when a VDI file grows)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp

    r26240 r26338  
    4949#include <iprt/thread.h>
    5050#include <iprt/param.h>
     51#include <iprt/message.h>
    5152
    5253#define TESTCASE "tstPDMAsyncCompletionStress"
     
    179180
    180181        if (memcmp(pbBuf, pbTestPattern, cbCompare))
    181             AssertMsgFailed(("Unexpected data for off=%RTfoff size=%u\n", pTestTask->off, pTestTask->DataSeg.cbSeg));
     182        {
     183            unsigned idx = 0;
     184
     185            while (   (pbBuf[idx] == pbTestPattern[idx])
     186                   && (idx < cbCompare))
     187                idx++;
     188
     189            RTMsgError("Unexpected data for off=%RTfoff size=%u\n"
     190                       "Expected %c got %c\n",
     191                       pTestTask->off + idx, pTestTask->DataSeg.cbSeg,
     192                       pbTestPattern[idx], pbBuf[idx]);
     193            RTAssertDebugBreak();
     194        }
    182195
    183196        pbBuf  += cbCompare;
     
    315328    int uRnd = RTRandU32Ex(0, 100);
    316329
    317     return (uRnd < iPercentage); /* This should be enough for our purpose */
     330    return (uRnd <= iPercentage); /* This should be enough for our purpose */
    318331}
    319332
Note: See TracChangeset for help on using the changeset viewer.

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