If this bug requires documentation, please select an appropriate Doc Type value.
Description of problem:
binutils build with gcc 7 segfaults on pcc64le
Version-Release number of selected component (if applicable):
binutils-2.27-13.fc26 (and later, but release number does not really matter)
Steps to Reproduce:
1.build binutils rpm on ppc64le
2.check build log (test section) for core dumps
ppc64le-redhat-linux-gcc -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mcpu=power8 -mtune=power8 -Wno-error -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -I.. -I./../../include -o test-demangle \
./test-demangle < ./demangle-expected
/bin/sh: line 1: 4008 Segmentation fault (core dumped) ./test-demangle < ./demangle-expected
make: *** [Makefile:53: check-cplus-dem] Error 139
./test-demangle < ./d-demangle-expected
/bin/sh: line 1: 4012 Segmentation fault (core dumped) ./test-demangle < ./d-demangle-expected
make: *** [Makefile:56: check-d-demangle] Error 139
this happens on ppc64le only
another issue here is that this crash is silently ignored and build succeeds
Also this happens only when optimization (-O1 or higher) is enabled.
Trying some gcc tests for bad code ( https://gcc.gnu.org/wiki/FAQ#misoptimization ) did not help
This sounds like a bug in the libiberty library. That library is officially
under the control of the GCC project, but the binutils does include its own
copy of the library sources.
Since the FSF Binutils v2.28 has just been released, containing a newer copy
of the libiberty sources, I am hoping that this will resolve the problem.
Therefore please could you test:
This rpm does include one small extra patch on top of the FSF 2.28 sources
to fix another bug in the libiberty demangler. With this patch applies the
rawhide binutils version of libiberty now matches the very latest FSF GCC
development version of libiberty.
I've checked the build.log of the 2.28 build
and there is no crash reported, so this issue seems to be fixed in 2.28 release
Are we sure it's a bug in libiberty and not a ppc64le gcc7 code-gen bug?
(In reply to Dan Horák from comment #4)
> Are we sure it's a bug in libiberty and not a ppc64le gcc7 code-gen bug?
Not 100% sure, no. But libiberty's demangler is notorious for encountering bugs like the one reported here, and upgrading the sources did fix the problem.
I think that if there is a ppc64 code-gen bug then it is going to show up in more places than just the libiberty testsuite...
If somebody could bisect which demangler change fixed the test failure, then we could answer that question more easily. Any volunteers?
Hm, testing in libiberty dir from the binutils-2_27 tag, using Fedora compiler flags, and no segfault. Will try harder ...
So the issue is reproduceable with upstream binutils 2.27 with gcc-7.0.1-0.8.fc26.ppc64le but not with gcc-7.0.1-0.10.fc26.ppc64le. I would say NOTABUG anymore :-)
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30 Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '27'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 27 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 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.