Re: locale thread support

2020-05-29 Thread Marc Espie
On Tue, May 26, 2020 at 12:13:02AM +0200, Ingo Schwarze wrote: > Regarding the FreeBSD headers, i like them even less. There are both > terrible design choices and terrible implementation choices. Regarding > design, it appears that you *must* #include after other > headers - if you include it

Re: locale thread support

2020-05-29 Thread Mark Kettenis
> Date: Fri, 29 May 2020 15:48:41 +0200 > From: Ingo Schwarze Hi Ingo, > Hi Marc, I'm not Marc, but close enough ;). > do i understand correctly that you intend to say: there are > legitimate reasons to use these xlocale.h functions in portable > software, in particular in portable

Re: locale thread support

2020-05-29 Thread Marc Espie
On Fri, May 29, 2020 at 03:48:41PM +0200, Ingo Schwarze wrote: > Hi Marc, > > do i understand correctly that you intend to say: there are > legitimate reasons to use these xlocale.h functions in portable > software, in particular in portable libraries, so we should probably > have them all, or

Re: locale thread support

2020-05-29 Thread Ingo Schwarze
Hi Marc, do i understand correctly that you intend to say: there are legitimate reasons to use these xlocale.h functions in portable software, in particular in portable libraries, so we should probably have them all, or at least most of them? I see your point that using functions like

Re: locale thread support

2020-05-28 Thread Marc Espie
On Tue, May 26, 2020 at 12:13:02AM +0200, Ingo Schwarze wrote: > Hi, > > my impression is there are two totally independent topics in this > thread. > > 1. Whether and how to make things safer, ideally terminating the > program in a controlled manner, if it uses functions that are > not

Re: locale thread support

2020-05-25 Thread Ingo Schwarze
Hi, my impression is there are two totally independent topics in this thread. 1. Whether and how to make things safer, ideally terminating the program in a controlled manner, if it uses functions that are not thread-safe in an invalid manner. I'm not addressing that topic in this

Re: locale thread support

2020-05-22 Thread Marc Espie
On Fri, May 22, 2020 at 02:31:38PM +0200, Mark Kettenis wrote: > > Date: Fri, 22 May 2020 13:50:44 +0200 > > From: Marc Espie > > > > I've had to neuter some setlocale() in mlt, since our code is > > definitely NOT thread-safe. No biggie, since we do not have support > > for LC_NUMERIC right

Re: locale thread support

2020-05-22 Thread Marc Espie
On Fri, May 22, 2020 at 04:02:31PM +0200, Mark Kettenis wrote: > > From: "Todd C. Miller" > > Date: Fri, 22 May 2020 07:23:55 -0600 > > > > On Fri, 22 May 2020 14:57:11 +0200, Marc Espie wrote: > > > > > From a security standpoint, is there a "cheap" way to make setlocale > > > abort() > > >

Re: locale thread support

2020-05-22 Thread Mark Kettenis
> From: "Todd C. Miller" > Date: Fri, 22 May 2020 07:23:55 -0600 > > On Fri, 22 May 2020 14:57:11 +0200, Marc Espie wrote: > > > From a security standpoint, is there a "cheap" way to make setlocale abort() > > instead of trying to do a double free on when running in a race condition ? > > We

Re: locale thread support

2020-05-22 Thread Todd C . Miller
On Fri, 22 May 2020 14:57:11 +0200, Marc Espie wrote: > From a security standpoint, is there a "cheap" way to make setlocale abort() > instead of trying to do a double free on when running in a race condition ? We could use _THREAD_PRIVATE_MUTEX as we do in other parts of libc. - todd

Re: locale thread support

2020-05-22 Thread Marc Espie
On Fri, May 22, 2020 at 02:31:38PM +0200, Mark Kettenis wrote: > > Date: Fri, 22 May 2020 13:50:44 +0200 > > From: Marc Espie > > > > I've had to neuter some setlocale() in mlt, since our code is > > definitely NOT thread-safe. No biggie, since we do not have support > > for LC_NUMERIC right

Re: locale thread support

2020-05-22 Thread Mark Kettenis
> Date: Fri, 22 May 2020 13:50:44 +0200 > From: Marc Espie > > I've had to neuter some setlocale() in mlt, since our code is > definitely NOT thread-safe. No biggie, since we do not have support > for LC_NUMERIC right now. Hmm, setlocale() is explicitly mentionded as not thread-safe in POSIX.

Re: locale thread support

2020-05-22 Thread Joerg Sonnenberger
On Fri, May 22, 2020 at 01:50:44PM +0200, Marc Espie wrote: > uselocale is fine, but it is not on windows, so highly portable code tends to > prefer strtod_l... The problem with uselocale is two fold and why I explicitly decided to not implement it in NetBSD: (1) It can come at a significant

locale thread support

2020-05-22 Thread Marc Espie
I've had to neuter some setlocale() in mlt, since our code is definitely NOT thread-safe. No biggie, since we do not have support for LC_NUMERIC right now. I think we might want the thread-specific functions, namely stuff like strtod_l, or sprintf_l and friends. Even if they do not do anything