I did this
Hi!
We start getting sanitiser reports like this in our CI.
I assume that this code is supposed to be thread-safe, please correct me if I'm wrong.
If so, seems like the problematic code was introduced recently here:
4224d6e
so static variable ares_ver could be simultaneously read and modified by two threads.
it seems enough to replace l. 176 with
static int ares_ver = get_ares_version();
get_ares_version() will do the same call, but now compiler will guarantee single initialisation (btw, I'm not a C expert, do we have this guarantee in C?).
I expected the following
no sanitiser complains
curl/libcurl version
curl 8.6.0+
operating system
linux
I did this
Hi!
We start getting sanitiser reports like this in our CI.
I assume that this code is supposed to be thread-safe, please correct me if I'm wrong.
If so, seems like the problematic code was introduced recently here:
4224d6e
so static variable
ares_vercould be simultaneously read and modified by two threads.it seems enough to replace l. 176 with
get_ares_version()will do the same call, but now compiler will guarantee single initialisation (btw, I'm not a C expert, do we have this guarantee in C?).I expected the following
no sanitiser complains
curl/libcurl version
curl 8.6.0+
operating system
linux