Bug 1428310 - binutils does not build correctly with gcc 7 on pcc64le
Summary: binutils does not build correctly with gcc 7 on pcc64le
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 27
Hardware: ppc64le
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: PPCTracker
TreeView+ depends on / blocked
 
Reported: 2017-03-02 09:42 UTC by Michal Hlavinka
Modified: 2018-11-30 17:37 UTC (History)
5 users (show)

(edit)
If this bug requires documentation, please select an appropriate Doc Type value.
Clone Of:
(edit)
Last Closed: 2018-11-30 17:37:26 UTC
nickc: needinfo+


Attachments (Terms of Use)

Description Michal Hlavinka 2017-03-02 09:42:01 UTC
Description of problem:
binutils build with gcc 7 segfaults on pcc64le


Version-Release number of selected component (if applicable):
gcc-7.0.1
binutils-2.27-13.fc26 (and later, but release number does not really matter)

How reproducible:
always


Steps to Reproduce:
1.build binutils rpm on ppc64le
2.check build log (test section) for core dumps
3. https://kojipkgs.fedoraproject.org//packages/binutils/2.27/19.fc26/data/logs/ppc64le/build.log

Actual results:
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.c ../libiberty.a
./test-demangle < ./demangle-expected
/bin/sh: line 1:  4008 Segmentation fault      (core dumped) ./test-demangle < ./demangle-expected
make[3]: *** [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[3]: *** [Makefile:56: check-d-demangle] Error 139


Expected results:
no crash

Additional info:
this happens on ppc64le only

another issue here is that this crash is silently ignored and build succeeds

Comment 1 Michal Hlavinka 2017-03-02 09:44:29 UTC
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

Comment 2 Nick Clifton 2017-03-02 13:11:03 UTC
Hi Michal,

  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:

    binutils-2.28-1.fc27

  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.

Cheers
  Nick

Comment 3 Michal Hlavinka 2017-03-02 14:09:43 UTC
I've checked the build.log of the 2.28 build 
https://kojipkgs.fedoraproject.org//work/tasks/7657/18137657/build.log
and there is no crash reported, so this issue seems to be fixed in 2.28 release

Comment 4 Dan Horák 2017-03-02 14:31:34 UTC
Are we sure it's a bug in libiberty and not a ppc64le gcc7 code-gen bug?

Comment 5 Nick Clifton 2017-03-02 14:57:57 UTC
(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...

Comment 6 Jakub Jelinek 2017-03-02 15:39:42 UTC
If somebody could bisect which demangler change fixed the test failure, then we could answer that question more easily.  Any volunteers?

Comment 7 Dan Horák 2017-03-02 18:09:21 UTC
Hm, testing in libiberty dir from the binutils-2_27 tag, using Fedora compiler flags, and no segfault. Will try harder ...

Comment 8 Dan Horák 2017-03-02 19:09:00 UTC
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 :-)

Comment 9 Jan Kurik 2017-08-15 06:37:10 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 10 Ben Cotton 2018-11-27 18:39:29 UTC
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.

Comment 11 Ben Cotton 2018-11-30 17:37:26 UTC
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
bug.

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.