Re: lintian: shlib-read-write-env
- Date: Tue, 31 Jan 2017 12:21:42 +0100
- From: Mathieu Malaterre <malat@xxxxxxxxxx>
- Subject: Re: lintian: shlib-read-write-env
On Tue, Jan 31, 2017 at 12:14 PM, Simon McVittie <smcv@xxxxxxxxxx> wrote:
> On Tue, 31 Jan 2017 at 11:15:32 +0100, Mathieu Malaterre wrote:
>> I'd like to discuss addition of a new lintian checks for
>> getenv/setenv/putenv used in shared libraries.
> A massive number of libraries call getenv(). This is not something that
> you can just ban. In many cases (any D-Bus implementation, anything
> that uses XDG_whatever_DIRS, anything that uses PATH...) it is also
> "ABI" that would lead to broken systems if removed.
> A massive number of libraries also call gettext(), which has similar
> issues with setlocale() as the setenv-equivalent. This is not something
> that you can ban either.
> The policy that the GLib/GNOME stack has chosen (and documented!) is to
> say that libraries in that stack may call getenv() and gettext() freely,
> but applications using those libraries are only allowed to call setenv()
> or setlocale() near the beginning of main(), before a second thread
> is created. This is by no means ideal, but given the constraints I
> can't see anything better.
> Functions in GLib that indirectly call setenv() or setlocale() are
> documented as having the same constraints as setenv() itself.
> Again, this is not ideal but is about as good as we're going to get.
Ok, I see your point. I'll reformulate my original bug report as a
documentation enhancement then.
Thanks for clarification, I knew this was difficult to reproduce a
crash 'in the wild'.