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

Re: Bug#759870: gcc-4.9: Compiles zsh endlessly on s390x (maybe sigjmp_buf related)



On Sun, Aug 31, 2014 at 12:39:12AM +0200, Axel Beckert wrote:
> Control: retitle -1 gcc-4.9: Compiles zsh endlessly with -fstack-protector-strong on s390x
> 
> Hi,
> 
> Matthias Klose wrote:
> > if it's just zsh, then it's not serious.
> 
> I doubt that it's only zsh.
> 
> > Apparently there are some stability issues with some s390 machines,
> 
> Looks rather like a regression than stability issues to me. It fails
> _always_ with gcc-4.9 and default buildflags on s390x. But works fine
> with gcc-4.8:
> 
> $ debuild -eCC=gcc-4.8 -eDEB_BUILD_MAINT_OPTIONS=hardening=-stackprotectorstrong -uc -us -B
> 
> (Had to remove stackprotectorstrong as it doesn't seem to be available
> with gcc-4.8.)
> 
> > CC'ing the s390 porters.
> 
> JFTR: I already X-Debbugs-Cc'ed them.
> 
> I was able to to reproduce it in a sid chroot of zelenka, too. gcc-4.9
> hangs at this position:
> 
> […].0.5-dev-2/obj/Src → gcc -c -I. -I../Src -I../../Src -I../../Src/Zle -I../../Src -D_FORTIFY_SOURCE=2 -Q -DHAVE_CONFIG_H -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -g -o builtin.o ../../Src/builtin.c
>  gnu_dev_major gnu_dev_minor gnu_dev_makedev read pread pread64 readlink readlinkat getcwd getwd confstr getgroups ttyname_r getlogin_r gethostname getdomainname getchar fgetc_unlocked getc_unlocked getchar_unlocked putchar fputc_unlocked putc_unlocked putchar_unlocked getline feof_unlocked ferror_unlocked sprintf vsprintf snprintf vsnprintf fprintf printf vprintf vfprintf dprintf vdprintf asprintf __asprintf obstack_printf vasprintf obstack_vprintf fgets fread fgets_unlocked fread_unlocked tolower toupper stat lstat fstat fstatat mknod mknodat stat64 lstat64 fstat64 fstatat64 __sigismember __sigaddset __sigdelset atoi atol atoll bsearch atof realpath ptsname_r wctomb mbstowcs wcstombs __strcspn_c1 __strcspn_c2 __strcspn_c3 __strspn_c1 __strspn_c2 __strspn_c3 __strpbrk_c2 __strpbrk_c3 __strtok_r_1c __strsep_1c __strsep_2c __strsep_3c memcpy memmove mempcpy memset bcopy bzero strcpy stpcpy strncpy stpncpy strcat strncat open open64 openat openat64 btowc wctob mbrlen wmemcpy wmemmove wmempcpy wmemset wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat swprintf vswprintf wprintf fwprintf vwprintf vfwprintf fgetws fgetws_unlocked wcrtomb mbsrtowcs wcsrtombs mbsnrtowcs wcsnrtombs createbuiltintable printbuiltinnode freebuiltinnode init_builtins new_optarg execbuiltin bin_enable bin_set bin_pwd bin_dirs set_pwd_env bin_cd cd_get_dest cd_do_chdir cd_able_vars cd_try_chdir cd_new_pwd printdirstack fixdir printqt printif bin_fc fcgetcomm fcsubs fclist fcedit getasg typeset_setbase typeset_setwidth typeset_single bin_typeset eval_autoload listusermathfunc bin_functions mkautofn bin_unset bin_whence bin_hash bin_unhash bin_alias bin_true bin_false bin_print bin_shift bin_getopts bin_break checkjobs zexit bin_dot eval bin_emulate bin_eval bin_read zread testlex bin_test bin_times bin_trap bin_ttyctl bin_let bin_umask bin_notavail
> Analyzing compilation unit
> Performing interprocedural optimizations
>  <*free_lang_data> <visibility> <early_local_cleanups> <*free_inline_summary> <whole-program> <profile_estimate> <devirt> <cp> <inline> <pure-const> <static-var>Assembling functions:
>  bin_true bin_false testlex bin_enable bin_set listusermathfunc bin_dirs bin_unhash fclist bin_unset bin_whence bin_shift bin_let bin_getopts bin_dot eval bin_emulate bin_eval bin_times bin_trap bin_umask printbuiltinnode bin_ttyctl freebuiltinnode bin_pwd typeset_setwidth.isra.4 typeset_setbase.isra.5 fcgetcomm bin_fc typeset_single.isra.7 getasg bin_hash bin_alias bin_print zread bin_read bin_test createbuiltintable init_builtins execbuiltin set_pwd_env cd_able_vars fixdir
> 
> As waldi noticed, it suffices to replace -fstack-protector-strong by
> -fstack-protector (which was necessary for compiling with gcc-4.8 anyways) and it does no more go into the endless loop:
> 
> […].0.5-dev-2/obj/Src → gcc -c -I. -I../Src -I../../Src -I../../Src/Zle -I../../Src -D_FORTIFY_SOURCE=2  -DHAVE_CONFIG_H -g -O2 -fstack-protector -Wformat -Werror=format-security -Wall -g -o builtin.o ../../Src/builtin.c
> 
> HTH
> 
> I'll likely use
> DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotectorstrong to get zsh
> building on s390x again for now, but I still think endless loops like
> this one are a bug in the compiler.
> 
> With this workaround, I'm also ok with the lowered severity as there
> is a workaround which likely also works for other affected packages.
> 

Please note that the problem is fixed in upstream trunk as well as in
the gcc-snapshot debian package. I'll try to identify the commit fixing
it.

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


Reply to: