2016-03-09 Aurelien Jarno [BZ #19792] * sysdeps/unix/sysv/linux/mips/makecontext.S (__makecontext): Terminate FDE before return label. Index: glibc-2.23/NEWS =================================================================== --- glibc-2.23.orig/NEWS +++ glibc-2.23/NEWS @@ -14,6 +14,7 @@ Security related changes: The following bugs are resolved with this release: [19679] gcc-4.9.3 C++ exception handling broken due to unaligned stack + [19792] MIPS: backtrace yields infinite backtrace with makecontext Version 2.23 Index: glibc-2.23/sysdeps/unix/sysv/linux/mips/makecontext.S =================================================================== --- glibc-2.23.orig/sysdeps/unix/sysv/linux/mips/makecontext.S +++ glibc-2.23/sysdeps/unix/sysv/linux/mips/makecontext.S @@ -153,6 +153,11 @@ NESTED (__makecontext, FRAMESZ, ra) #endif jr ra + /* We need to terminate the FDE to stop unwinding if backtrace was + called within a context created by makecontext. */ + cfi_endproc + nop + 99: #ifdef __PIC__ move gp, s1 @@ -186,6 +191,8 @@ NESTED (__makecontext, FRAMESZ, ra) 1: lb zero, (zero) b 1b + + cfi_startproc PSEUDO_END (__makecontext) weak_alias (__makecontext, makecontext)