We encounter failures in binaries using program_invocation_short_name, which seems to be NULL now for some reason. Here is a test log of the recent and the older gcc: # cat argv.c #define _GNU_SOURCE #include <errno.h> #include <stdio.h> int main(int argc, char *argv[]) { printf("%s\n", argv[0]); printf("%s\n", program_invocation_name); printf("%s\n", program_invocation_short_name); return 0; } # gcc --version gcc (GCC) 4.7.0 20120206 (Red Hat 4.7.0-0.11) Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@mop stuff]# gcc -Wall -Wl,--gc-sections -O2 -o argv argv.c [root@mop stuff]# ./argv ./argv Segmentation fault (core dumped) # gcc --version gcc (GCC) 4.7.0 20120123 (Red Hat 4.7.0-0.9) Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@mop stuff]# gcc -Wall -Wl,--gc-sections -O2 -o argv argv.c [root@mop stuff]# ./argv ./argv ./argv argv
Is that with the same version of glibc? I certainly don't see any differences in compiled code.
Created attachment 559966 [details] old The new gcc compile fails running on the new glibc. The new gcc compile fails running on the old glibc. The old gcc compile is fine running on the new glibc. The old gcc compile is fine running on the old glibc. Attaching the two binaries. Also note: The new gcc is on a system, where /lib, /bin, ... are symlinks to /usr. Maybe that causes some trouble ...
Created attachment 559967 [details] new
That doesn't look like a gcc bug, the generated code is still the same, just the linker behaved differently (didn't apparently create copy relocs). You can link with -Wl,-M to see what exactly has been linked into it in each case. The UsrMove is a huge mess and mistake IMHO.
The testcase works fine when built with binutils-2.22-4.fc17. It is broken when built with binutils-2.22.52.0.1-2.fc17. I'm changing nothing else in the system.
This is a test on the same file system, just with the old and the new binutils installed. The generated binary works only with the old version of binutils. I can reliably reproduce the behaviour just by switching between the two binutil versions. [root@mop stuff]# ld --version GNU ld version 2.22 Copyright 2011 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. [root@mop stuff]# [root@mop stuff]# [root@mop stuff]# gcc -Wall -Wl,--gc-sections -O2 -o argv argv.c [root@mop stuff]# ./argv ./argv ./argv argv [root@mop stuff]# ld --version GNU ld version 2.22.52.0.1-2.fc17 20120131 Copyright 2012 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. [root@mop stuff]# [root@mop stuff]# gcc -Wall -Wl,--gc-sections -O2 -o argv argv.c [root@mop stuff]# ./argv ./argv Segmentation fault (core dumped)
systemd is affected and we don't know what else is miscompiled. Proposing as F17 Alpha blocker.
The specific Alpha release criterion that this breaks is this one: 21. It must be possible to trigger a system shutdown using standard console commands, [...] 'reboot', 'poweroff' do not work because they are symlinks to systemctl, which relies on program_invocation_short_name to know what to do. 'init 0' causes a segfault.
Andre, this is not specific to x86_64, it affects i686 too. [Platform: x86_64 -> All]
*** Bug 788300 has been marked as a duplicate of this bug. ***
*** Bug 788304 has been marked as a duplicate of this bug. ***
This looks related: "Fix -gc-sections related abort": http://cygwin.com/ml/binutils/2012-02/msg00056.html
(In reply to comment #12) > This looks related: "Fix -gc-sections related abort": > http://cygwin.com/ml/binutils/2012-02/msg00056.html I made local mockbuild of binutils with the patch. It fixes the bug for me.
The patch is applied upstream: http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=f5edd1ac0e79c0356c6a1e2beffcadc0c532be98
Adam Williamson applied the fix to binutils already and rebuilt systemd with it: $ koji latest-pkg f17 binutils systemd Build Tag Built by ---------------------------------------- -------------------- ---------------- binutils-2.22.52.0.1-4.fc17 f17 adamwill systemd-41-2.fc17 f17 adamwill
*** Bug 789137 has been marked as a duplicate of this bug. ***
updating to latest systemd / binutils seems to have fixed that problem. Now if I can just figure out why my reboot drops to a dracut prompt every time instead of getting all the way to a grub menu....
(In reply to comment #17) Your initramfs image may still contain the broken version of systemctl. Regenerate the image with 'dracut -f'.
(In reply to comment #18) > (In reply to comment #17) >> I can just figure out why my reboot drops to a dracut prompt every time instead >> of getting all the way to a grub menu.... > Your initramfs image may still contain the broken version of systemctl. Or you bumped into bug 789119. There is a patch in comments there if this is the case.