Created attachment 1374985 [details]
unwind.i cleaned up for GCC 4.8
This also seems to affect gcc-4.8.5-25.el7.x86_64. Based on the disassembly of /lib/libpthread.so.0, glibc-2.17-220.el7.i686 is miscompiled as well.
+++ This bug was initially created as a clone of Bug #1529979 +++
Description of problem:
The attached program, when compiled using
gcc -fPIC -O2 -fgnu89-inline-fstack-clash-protection -c unwind.i
produces invalid CFI instructions for __GI___pthread_unwind:
.cfi_offset 6, -8
.cfi_offset 3, -12
.cfi_offset 6, -16
addl $_GLOBAL_OFFSET_TABLE_, %ebx
subl $8, %esp
movl %eax, %esi
The problem is that the .cfi_restore for %esi does not restore the original location at offset 8, but essentially declares that the register will not be clobbered further below, while in fact it is used to store the function argument (__pthread_unwind is compiled with __attribute__ ((regparm (1)))).
As a result, the libgcc unwinder restores the wrong value for %esi, leading to bug 1529549.
Version-Release number of selected component (if applicable):
Related tests passed with gcc-4.8.5-28.el7.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.