Re:Getaddrinfo() on glibc calls getenv(), oh boy
by Retr0id on Monday October 16, 2023 @09:28PM
(#37909189)
I wonder if you could get around this by giving each thread its own environment context, and synchronizing them, asynchronously.
[ Parent
| on HN ]
Re:Getaddrinfo() on glibc calls getenv(), oh boy
by gpderetta on Tuesday October 17, 2023 @08:32AM
(#37913951)
Just independent environments would be the best, like it was done for locale with uselocale. But it is a breaking change, would have to go through posix and will take forever anyway. Also, as environ is a public symbol, it has ABI implications.
Re:Getaddrinfo() on glibc calls getenv(), oh boy
by tinus_hn on Tuesday October 17, 2023 @09:08AM
(#37914387)
Because there is no way to tell when a thread is done with the buffer, there is no moment when you can be sure you can manipulate it. The options are create a new copy and leak the old one or accept the chance of a segfault.