[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1001352: libc6-dev: pthread.h, setjmp.h: Include order matters (__sigsetjmp compilation error)



On 2021-12-08 23:46, Alejandro Colomar wrote:
> Package: libc6-dev
> Version: 2.32-5
> Severity: normal
> Tags: upstream
> X-Debbugs-Cc: alx.manpages@gmail.com, libc-alpha@sourceware.org, unit@nginx.org
> 
> Dear Maintainer,
> 
> Building Nginx Unit from source results in a compilation error.
> I tried both Debian 11 and Debian Sid (12),
> and the bug is reproducible in Sid only.
> 
> To reproduce the problem, install the following packages:
> 
>   git, build-essential, libpcre2-dev
> 
> Then execute the following commands:
> 
>   git clone https://github.com/nginx/unit.git
>   cd unit/
>   ./configure
>   make
> 
> You will see the following error:
> 
> 
> ---
> 
> cc -c -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes -Werror -g -I src -I build   \
>                       \
>                      \
> -o build/src/nxt_thread.o \
> -MMD -MF build/src/nxt_thread.dep -MT build/src/nxt_thread.o \
> src/nxt_thread.c
> In file included from src/nxt_unix.h:187,
>                  from src/nxt_main.h:31,
>                  from src/nxt_thread.c:7:
> src/nxt_thread.c: In function ‘nxt_thread_trampoline’:
> src/nxt_thread.c:114:5: error: ‘__sigsetjmp’ accessing 200 bytes in a region of size 72 [-Werror=stringop-overflow=]
>   114 |     pthread_cleanup_push(nxt_thread_time_cleanup, thr);
>       |     ^~~~~~~~~~~~~~~~~~~~
> src/nxt_thread.c:114:5: note: referencing argument 1 of type ‘struct __jmp_buf_tag *’
> /usr/include/pthread.h:734:12: note: in a call to function ‘__sigsetjmp’
>   734 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
>       |            ^~~~~~~~~~~
> cc1: all warnings being treated as errors 

The problem you encounter is due to the use of GCC 11. glibc headers
need to be adapted for that. This has been done upstream in glibc 2.33,
which is already available in experimental. It should arrive soon in
sid. Using GCC 10 is another alternative.

Regards,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: