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

[Backport release/3.8] /vsicurl/: fix potential multithreaded crash when downloading the same region in parallel and that the download fails #9208

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Feb 7, 2024

Backport #9201
Authored by: @rouault

…e region in parallel and that the download fails

If 2 threads tried to download the same region at the same time, one of
them would wait for the first one to have finished. But if that download
failed, the waiting thread would then wrongly try to unregister the
region in m_oMapRegionInDownload (the first thread has already done
that), resulting in either an assertion in debug mode on
```CPLAssert(oIter != m_oMapRegionInDownload.end())``` in
NotifyStopDownloadRegion() or a crash later when trying to lock
region.oMutex which would be random data.
@rouault rouault added this to the 3.8.4 milestone Feb 7, 2024
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 67.945% (+0.005%) from 67.94%
when pulling d1b5cb4 on backport-9201-to-release/3.8
into f78757c on release/3.8.

@rouault rouault merged commit a1d8d1f into release/3.8 Feb 7, 2024
28 of 30 checks passed
@rouault rouault deleted the backport-9201-to-release/3.8 branch February 7, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants