Bug 1028849 - ld: bogus undefined reference to `__stack_chk_fail'
ld: bogus undefined reference to `__stack_chk_fail'
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Nick Clifton
Fedora Extras Quality Assurance
Depends On:
Blocks: 587568 1106999
  Show dependency treegraph
Reported: 2013-11-10 22:43 EST by Kevin Kofler
Modified: 2016-07-19 16:27 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-19 16:27:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kevin Kofler 2013-11-10 22:43:50 EST
Description of problem:
From the build.log:
of kdebase3 in Rawhide:

/bin/sh ../libtool --silent  --tag=CXX   --mode=link g++  -DNDEBUG -DNO_DEBUG -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -D_GNU_SOURCE  -L/usr/lib/qt-3.3/lib  -Wl,--as-needed -Wl,--enable-new-dtags  -module -avoid-version -module -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined   -Wl,-z,relro  -o konq_sound.la -rpath /usr/lib/kde3 konq_sound.lo -lsoundserver_idl -lartskde 
/usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local':
(.text+0x10): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
make[3]: *** [konq_sound.la] Error 1

Yet the __stack_chk_fail symbol should be in the libraries g++ links by default. An earlier kdebase3 build:
against older Rawhide packages succeeded, and all I changed was a .desktop file.

One of the packages that changed in the buildroot was binutils, so I guess that (in particular, GNU ld) is where the fault lies.

Version-Release number of selected component (if applicable):
(The earlier successful build had binutils-

How reproducible:
Failed 2 times out of 2. (I didn't attempt to resubmit the job again after both the original and the resubmitted job failed the same way.)

Steps to Reproduce:
1. Try building kdebase3 in Rawhide.

Actual results:
The build fails with "undefined reference to `__stack_chk_fail'".

Expected results:
The build succeeds.

Additional info:
Strangely, kdebase3 appears to be the only package breaking that way in Rawhide, yet I haven't changed anything that could possibly have caused this in kdebase3 itself, so it must be one of the packages in the buildroot triggering the FTBFS.
Comment 1 Kevin Kofler 2013-11-10 22:46:59 EST
To be clear, when I say "failed 2 times out of 2", I mean both builds failed, i.e. reproducing the bug succeeded. I assume it is always reproducible.
Comment 2 Kevin Kofler 2013-11-27 18:38:27 EST
kdelibs3 fails with the same error:

Making all in bzip2
make[3]: Entering directory `/builddir/build/BUILD/kdelibs-3.5.10/kioslave/bzip2'
/bin/sh ../../libtool --silent  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../../dcop -I../../kdecore -I../../kio/kssl -I../../kjs -I../../kio -I../../dcop -I../../libltdl -I../../kdefx -I../../kdecore -I../../kdecore -I../../kdecore/network -I../../kdeui -I../../kio -I../../kio/kio -I../../kio/kfile -I../.. -I/usr/lib/qt-3.3/include -I. -I/usr/include/kde   -DQT_THREAD_SUPPORT  -D_REENTRANT  -DNDEBUG -DNO_DEBUG -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o kbzip2filter.lo kbzip2filter.cpp
/bin/sh ../../libtool --silent  --tag=CXX   --mode=link g++  -DNDEBUG -DNO_DEBUG -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -L/usr/lib/qt-3.3/lib  -Wl,--as-needed -Wl,--enable-new-dtags  -module -avoid-version -module -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined   -Wl,-z,relro  -o kbzip2filter.la -rpath /usr/lib/kde3 kbzip2filter.lo ../../kio/libkio.la -lbz2 
/usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local':
(.text+0x10): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
make[3]: Leaving directory `/builddir/build/BUILD/kdelibs-3.5.10/kioslave/bzip2'
make[3]: *** [kbzip2filter.la] Error 1
Comment 3 Kevin Kofler 2013-12-01 09:08:02 EST
Configuring with --disable-new-ldflags instead of --enable-new-ldflags works around this, so it looks like it is a bug in ld related to -Wl,--as-needed or one of the other -Wl flags.
Comment 4 Yaakov Selkowitz 2014-06-12 17:25:30 EDT
Also affects kdegames3 in bug 1106999.
Comment 5 Jaroslav Reznik 2015-03-03 10:12:01 EST
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
Comment 6 Fedora End Of Life 2016-07-19 16:27:36 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.