Bug 1518823

Summary: gcc: -fstack-clash-protection failure with calls with many arguments on aarch64
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: gccAssignee: Jeff Law <law>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: aoliva, davejohansen, fweimer, jakub, jwakely, law, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-7.2.1-4.fc27, gcc-7.2.1-4.fc28 gcc-7.3.1-2.fc26 gcc-7.3.1-2.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-06 10:50:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1519165    
Bug Blocks: 1512531    
Attachments:
Description Flags
tst-printf-bz18872.c
none
tst-printf-bz18872.c none

Description Florian Weimer 2017-11-29 15:44:48 UTC
Created attachment 1360420 [details]
tst-printf-bz18872.c

This is a special printf function test which uses many, many arguments to exercise the vararg processing in printf.

I'm attaching the generated output from stdio-common/tst-printf-bz18872.sh, slightly edited to compile outside of the glibc test environment (hopefully this does not invalidate the test itself).  I will submit preprocessed sources once I gained access to a suitable aarch64 machine (which could take a while).

gcc /builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common/tst-printf-bz18872.c -c -std=gnu11 -fgnu89-inline  -O2 -Wall -Werror -Wundef -Wwrite-strings -fmerge-all-constants -fno-asynchronous-unwind-tables -frounding-math -fstack-clash-protection -fstack-protector-strong -g -Wstrict-prototypes -Wold-style-definition           -I../include -I/builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common  -I/builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux  -I../sysdeps/unix/sysv/linux/aarch64  -I../sysdeps/aarch64/nptl  -I../sysdeps/unix/sysv/linux/generic  -I../sysdeps/unix/sysv/linux/wordsize-64  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/aarch64/fpu  -I../sysdeps/aarch64/multiarch  -I../sysdeps/aarch64  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754/ldbl-128  -I../sysdeps/ieee754/dbl-64/wordsize-64  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/aarch64/soft-fp  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/aarch64-redhat-linux/7/include -isystem /usr/include  -D_LIBC_REENTRANT -include /builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/libc-modules.h -DMODULE_NAME=testsuite -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -D_IO_MTSAFE_IO -o /builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common/tst-printf-bz18872.o -MD -MP -MF /builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common/tst-printf-bz18872.o.dt -MT /builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common/tst-printf-bz18872.o
/builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common/tst-printf-bz18872.c: In function 'do_test':
/builddir/build/BUILD/glibc-2.26.9000-853-ga55430cb0e/build-aarch64-redhat-linux/stdio-common/tst-printf-bz18872.c:2016:1: internal compiler error: in dwarf2out_frame_debug_adjust_cfa, at dwarf2cfi.c:1137
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccdfohxH.out file, please attach this to your bugreport.

Comment 2 Florian Weimer 2017-11-29 17:16:34 UTC
Created attachment 1360475 [details]
tst-printf-bz18872.c

Reproducer without #includes

Compile with: gcc -fstack-clash-protection -c tst-printf-bz18872.c

Comment 5 Jeff Law 2017-11-29 19:01:56 UTC
Thanks.  Builds spinning for F27 and F28 with the fix.

Comment 6 Florian Weimer 2017-11-30 10:53:45 UTC
gcc build currently fails due to bug 1519165.

Comment 7 Fedora Update System 2018-01-31 07:49:00 UTC
gcc-7.3.1-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-75d88970d0

Comment 8 Fedora Update System 2018-01-31 07:55:45 UTC
gcc-7.3.1-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-aa879be08e

Comment 9 Fedora Update System 2018-01-31 18:42:59 UTC
gcc-7.3.1-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-aa879be08e

Comment 10 Fedora Update System 2018-01-31 22:45:56 UTC
gcc-7.3.1-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-75d88970d0

Comment 11 Fedora Update System 2018-02-06 10:50:09 UTC
gcc-7.3.1-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2018-02-06 15:32:01 UTC
gcc-7.3.1-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.