error()/error_at_line() and threads

Collin Funk collin.funk1@gmail.com
Fri Jun 12 00:51:37 GMT 2026


Florian Weimer <fw@deneb.enyo.de> writes:

> Indeed.  Removing the output redirection, we can see there is plenty
> of interleaving:
>
> ./a.out: test 15
> ./a.out: ./a.out: test 0
> ./a.out: ./a.out: ./a.out: test 1
> ./a.out: 
> ./a.out: test 0./a.out: ./a.out: test 0
> ./a.out: test 1./a.out: 
> test 0
> ./a.out: test 6test 1test 1test 0
> ./a.out: test 1
> ./a.out: test 2
> ./a.out: test 0
> ./a.out: ./a.out: test 0
> ./a.out: test 1test 16
> ./a.out: ./a.out: ./a.out: test 2./a.out: test 0
> ./a.out: test 1
> ./a.out: test 2
> ./a.out: test 3
>
> This is definitely something we should fix as a QoI matter.
>
> This is probably related to the long-standing bug that we do not
> define _IO_MTSAFE_IO consistently across the codebase.

It would be nice not to go *too* far out of sync with Gnulib in the
process.

I am sure Paul is looking forward to the prospect of having more locking
stuff in Gnulib that he has to avoid when packaging gzip, etc. :)

Collin


More information about the Libc-alpha mailing list