Summary: | >=sys-libs/glibc-2.24: building w/-fstack-check: localedef segfaults when running locale-gen | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Graham Murray <graham> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexander, anarchy, hardened, kumba, steffen, toralf |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/bugzilla/show_bug.cgi?id=21253 | ||
See Also: | https://sourceware.org/bugzilla/show_bug.cgi?id=21253 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Graham Murray
2017-02-09 20:03:19 UTC
Confirm, same issue here as well not only systemd related, happened here at the tinderbox too it started here at a hardened image where 2.24-r1 was installed, non-hardened images with sys-libs/glibc-2.24 are fine till now I'm hitting this with glibc-2.25 as well. Using hardened gcc-6.3.0, it doesn't seem to matter if glibc-2.25 has hardened enabled or not; locale-gen still crashes. Running localedef in gdb results in a useless message: (gdb) run -i en_US -f UTF-8 en_US.UTF8 Starting program: /usr/bin/localedef -i en_US -f UTF-8 en_US.UTF8 Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. With a core dump, also seemingly useless: Core was generated by `localedef -i en_US -f UTF-8 en_US.UTF8'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fc1b3254204 in __spawni_child (arguments=0x7ffc03a7abe0) at ../sysdeps/unix/sysv/linux/spawni.c:122 122 ../sysdeps/unix/sysv/linux/spawni.c: No such file or directory. [Current thread is 1 (LWP 9366)] (gdb) bt #0 0x00007fc1b3254204 in __spawni_child (arguments=0x7ffc03a7abe0) at ../sysdeps/unix/sysv/linux/spawni.c:122 #1 0x00007fc1b32636af in clone () from /lib64/libc.so.6 (In reply to Toralf Förster from comment #2) which patchset was working ? you can modify the 2.24 ebuild and change PATCH_VER to 1, 2, 3, 4, or 5. we used to carry a localedef patch related to PaX, but we dropped it starting with 2.23. so if 2.23 is working, i don't think that's related. if you put -fstack-check=no in CFLAGS and recompile glibc do it fix it? -fstack-check=no fixed it for me. (glibc-2.25, gcc-6.3.0, +hardened) (In reply to Magnus Granberg from comment #5) > if you put -fstack-check=no in CFLAGS and recompile glibc do it fix it? confirmed Confirmed with Hardened, gcc 5.3.0 *** Bug 604198 has been marked as a duplicate of this bug. *** this is due to a rewrite in upstream of the posix spawn API. https://sourceware.org/git/?p=glibc.git;a=commit;h=9ff72da471a509a8c19791efe469f47fa6977410 when the child is created, a stack of just one page is allocated. the stack checking blows that limit pretty easily and we segfault. i'll discuss upstream the best route to take. *** Bug 613848 has been marked as a duplicate of this bug. *** Looks like your patch landed upstream. Can we get that applied in Gentoo's ebuilds? Applied to 2.24 and 2.25 commit dc2c28a7d39a02e89a438815b5fbad0261c6a901 Author: Matthias Maier <tamiko@gentoo.org> Date: Wed Jun 14 17:35:21 2017 -0500 sys-libs/glibc: version 2.25, update to patchset 4 Package-Manager: Portage-2.3.6, Repoman-2.3.2 commit 2187adcceef17b0df8b35f31f1a9841ccf59de30 Author: Matthias Maier <tamiko@gentoo.org> Date: Wed Jun 14 17:21:46 2017 -0500 sys-libs/glibc: version 2.24, update to patchset 7 Package-Manager: Portage-2.3.6, Repoman-2.3.2 |