Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unprotected multithreaded access to a variable #4414

Closed
wixbot opened this issue May 5, 2014 · 0 comments · Fixed by wixtoolset/wix#3
Closed

Unprotected multithreaded access to a variable #4414

wixbot opened this issue May 5, 2014 · 0 comments · Fixed by wixtoolset/wix#3
Assignees
Milestone

Comments

@wixbot
Copy link

wixbot commented May 5, 2014

In core.cpp, CoreApply gives the address of the cOverallProgressTicks variable to the cache thread and then uses itself when it goes to execute. The cache and execute methods go on to use it as if they weren't sharing it with each other. This could result in reporting the wrong progress.

if (pEngineState->plan.cCacheActions)
{
    // Launch the cache thread.
    cacheThreadContext.pEngineState = pEngineState;
    cacheThreadContext.pcOverallProgressTicks = &cOverallProgressTicks;
    cacheThreadContext.pfRollback = &fRollback;

    hCacheThread = ::CreateThread(NULL, 0, CacheThreadProc, &cacheThreadContext, 0, NULL);

    ...
}

// Execute.
if (pEngineState->plan.cExecuteActions)
{
    hr = ApplyExecute(pEngineState, hCacheThread, &cOverallProgressTicks, &fKeepRegistration, &fRollback, &fSuspend, &restart);
    UserExperienceExecutePhaseComplete(&pEngineState->userExperience, hr); // signal that execute completed.
}

Originally opened by rseanhall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants