Red Hat Bugzilla – Bug 1346397
glibc: debug/tst-longjump_chk2 calls printf from a signal handler
Last modified: 2017-10-30 11:25:35 EDT
Quoting the upstream bug I filed: stackoverflow_handler contains this: /* Using printf is not really kosher in signal handlers but we know it will work. */ printf ("%*sin signal handler\n", pass, ""); The comment is incorrect. printf calls vfprintf (~1760 bytes of stack space), vfprintf calls buffered_vfprintf (~8592 bytes of stack space), and this calls vfprintf again (~1760 bytes of stack space). Total space requirement is around 12 KiB, and the kernel places siginfo_t and ucontext_t on the stack (which can be as large 5 KiB). As a result, a SIGSTKSZ value of 16 KiB is just not large enough. This causes the test case to fail on aarch64 since the value of SIGSTKSZ has been increased. Before that, the test passed, presumably because the 8 KiB stack allocation in buffered_vfprintf conveniently jumped over the stack frame created by do_test. (Currently, the return address saved by do_test is clobbered by vfprintf.) Fixing this is preferred to ignore scary-looking error messages such as: *** longjmp causes uninitialized stack frame ***: /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/debug/tst-longjmp_chk2 terminated ======= Backtrace: ========= /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/libc.so.6(__fortify_fail+0x48)[0x3ffb7f61c24] /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/libc.so.6(+0xf1b48)[0x3ffb7f61b48] /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/libc.so.6(__longjmp_chk+0x30)[0x3ffb7f61ad8] /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/debug/tst-longjmp_chk2[0x40187c] [0x3ffb8000510] ======= Memory map: ======== 00400000-00410000 r-xp 00000000 08:05 3042772 /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/debug/tst-longjmp_chk2 …
Upstream commit: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2c41b52901331f5c761015af786a3976e225d779
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. https://rhn.redhat.com/errata/RHSA-2016-2573.html