Re: Thread safety of getaddrinfo()/getnameinfo()

From: Felix Palmen <>
Date: Thu, 27 Apr 2023 16:05:13 UTC
* Paul Floyd <> [20230426 22:28]:
> On 26-04-23 19:57, Felix Palmen wrote:
> > So, is there a thread-safety issue with these functions, or a bug in
> > valgrind, or maybe just some false positive?
> A false positive is a bug.

Well, depends on the definition. It's at least a different class than
e.g. misdetecting what it *should* know about ;)

> I believe that getaddrinfo should be MT safe.
> [...]
> These lock macros use spinlocks. The problem is that Valgrind (both Helgrind
> and DRD) doesn't recognize any locking mechanisms other than pthreads and Qt
> threads.

Thanks a lot for that clarification! So, won't worry about using these
functions on threads any more :)

Cheers, Felix

 Felix Palmen <>     {private}
 -- ports committer (mentee) --            {web}
 {pgp public key}
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231