Making getenv more multi-threading--robust?
Andreas Jaeger
aj@suse.com
Thu Sep 13 10:36:00 GMT 2012
On Thursday, September 13, 2012 12:11:48 Stephan Bergmann wrote:
> I stumbled over this when running the LibreOffice test suite and
> getting sporadic crashes in getenv(3). It turns out that LibreOffice
> contains many places that call getenv (mostly to check whether to
> enable one tweak or another) at arbitrary times and from arbitrary
> threads, and apparently also contains the odd call to setenv etc. to
> modify the environment.
>
> Though getenv is generally known to not be thread-safe, glibc already
> contains measures to make concurrent calls to setenv etc. thread-safe,
> so I wonder whether something like the attached
> 0001-Prevent-races-when-getenv-walks-__environ-while-sete.patch would
> make sense. While this would not solve my problems with
> (cross-platform) LibreOffice, it would help prevent glibc getenv
> crashes as demonstrated by the little program in the patch's commit
> message.
>
> Stephan
Stephan, please send patches to the libc-alpha mailing list. A patch
would also need a proper changelog entry - for details see
http://sourceware.org/glibc/wiki/Contribution%20checklist
In general the patch looks fine, but let's discuss this on the other
list.
Thanks a lot for your contribution!
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
More information about the Libc-help
mailing list