Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
CURL_LOCK_DATA_CONNECT can cause concurrent access to a connection on multiple threads #4544
I did this
We've seen race conditions when using CURL_LOCK_DATA_CONNECT in libcurl where sometimes two different threads using two different easy handles ends up sharing the same connection pointer at the same time.
I added curl cpp code which stresses CURL_LOCK_DATA_CONNECT and should eventually trigger an ASAN error or crash with curl compiled using clang's address sanitizers.
Sample program which can reproduce this issue:
An example of ASAN output when this issue is hit with additional logging.
Notably three threads with different easy handles decide to reuse the 0x61b000fbd688 connection at the same time.
This issue is reproducible on libcurl master.