Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Re: valgrind drd shows potential data race in curl_easy_init
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Aman Grewal via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 21 Nov 2025 15:03:04 -0500
On Thu, Nov 20, 2025 at 11:16 AM Daniel Stenberg <daniel_at_haxx.se> wrote:
> > I'm running my library under valgrind to try to find any bugs. I'm seeing
> > this warning stemming from `curl_easy_init` when running drd.
>
> I don't understand what that output means.
drd was complaining about a data race between threads.
This is curl_easy_init code and as you can see, there is a lock for the
> part
> that is not thread-safe:
>
>
> https://github.com/curl/curl/blob/7e8f36bf8e56e632e4f8be54b584f758e3aaa086/lib/easy.c#L349-L376
>
> This lock has existed like this for a while.
I built curl with debug symbols and noticed it was actually
complaining about a data race on the lock itself.
==8== Location 0x4a12278 is 0 bytes inside global var "s_lock"
It appears that drd doesn't understand that the atomic is being used as a
locking mechanism, so I can just add it to my suppressions file.
Thanks,
Aman
Date: Fri, 21 Nov 2025 15:03:04 -0500
On Thu, Nov 20, 2025 at 11:16 AM Daniel Stenberg <daniel_at_haxx.se> wrote:
> > I'm running my library under valgrind to try to find any bugs. I'm seeing
> > this warning stemming from `curl_easy_init` when running drd.
>
> I don't understand what that output means.
drd was complaining about a data race between threads.
This is curl_easy_init code and as you can see, there is a lock for the
> part
> that is not thread-safe:
>
>
> https://github.com/curl/curl/blob/7e8f36bf8e56e632e4f8be54b584f758e3aaa086/lib/easy.c#L349-L376
>
> This lock has existed like this for a while.
I built curl with debug symbols and noticed it was actually
complaining about a data race on the lock itself.
==8== Location 0x4a12278 is 0 bytes inside global var "s_lock"
It appears that drd doesn't understand that the atomic is being used as a
locking mechanism, so I can just add it to my suppressions file.
Thanks,
Aman
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2025-11-21