Subject: Re: [PATCH v2] async_die_is_recursing: work around GCC v11.x issue on Fedora

From: Junio C Hamano <[email-masked]>
Date: Wed, 03 Nov 2021 23:35:54 -0700

"Victoria Dye via GitGitGadget" <[email-masked]> writes:

> From: Victoria Dye <[email-masked]>
>
> This fix corrects an issue found in the `dockerized(pedantic, fedora)` CI
> build, first appearing after the introduction of a new version of the Fedora
> docker image version. This image includes a version of `glibc` with the
> attribute `__attr_access_none` added to `pthread_setspecific` [1], the
> implementation of which only exists for GCC 11.X - the version included in
> the Fedora image. The attribute requires that the pointer provided in the
> second argument of `pthread_getspecific` must, if not NULL, be a pointer to
> a valid object. In the usage in `async_die_is_recursing`, `(void *)1` is not
> valid, causing the error.
>
> This fix imitates a workaround added in SELinux [2] by using the pointer to
> the static `async_die_counter` itself as the second argument to
> `pthread_setspecific`. This guaranteed non-NULL, valid pointer matches the
> intent of the current usage while not triggering the build error.
>
> [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a1561c3bbe8
> [2] https://lore.kernel.org/all/[email-masked]/
>
> Co-authored-by: Johannes Schindelin <[email-masked]>
> Signed-off-by: Victoria Dye <[email-masked]>
> ---

Looks like they timed their update to disrupt us most effectively,
but we are gifted with watchful eyes and competent hands ;-).

Thanks for coming up with a clearly written description and a clean
fix so quickly.

Will apply.