build hangs for 2 hours with -03, yet succeeds with -O2 very quickly

Bug #1883531 reported by Dimitri John Ledkov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Invalid
Low
bugproxy
gcc-10 (Ubuntu)
Fix Released
Undecided
Unassigned
gcc-9 (Ubuntu)
Incomplete
Low
Unassigned

Bug Description

blobandconquer package fails to build from source, when building with -O3 on ppc64el.

It succeeds, if built with -O2.

mastermind.o is the offending object.

Get the source:

   pull-lp-source blobandconquer
   cd blobandconquer-*
   sudo apt build-dep ./

If you don't have pull-lp-source, you can download the tarball directly and install build-depends elsehow:

   wget 'https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/blobandconquer/1.11-dfsg+20-1.1ubuntu1/blobandconquer_1.11-dfsg+20.orig.tar.gz'
   tar xvf blobandconquer*.tar.gz
   cd blobandconquer-*
   sudo apt build-dep blobandconquer

inside there:

$ CXXFLAGS=-O3 make mastermind.o
g++ -O3 -Wformat=2 -Wformat-security -Wstrict-aliasing=2 -Wmissing-format-attribute -Wmissing-noreturn -Wdisabled-optimization `sdl-config --cflags` -DVERSION=1.11 -DRELEASE=0 -DUSEPAK=0 -DDEV=0 -DPAKNAME=\"blobAndConquer.pak\" -DPAKLOCATION=\"/usr/share/games/blobAndConquer/\" -DGAMEPLAYMANUAL=\"/usr/share/doc/blobAndConquer//index.html\" -Wall -DLOCALEDIR=\"/usr/share/locale/\" -g -c src/puzzles/mastermind.cpp
^Cmake: *** [makefile:100: mastermind.o] Interrupt

hangs.

Where as with -O2 it builds very quickly:

$ CXXFLAGS=-O2 make mastermind.o
g++ -O2 -Wformat=2 -Wformat-security -Wstrict-aliasing=2 -Wmissing-format-attribute -Wmissing-noreturn -Wdisabled-optimization `sdl-config --cflags` -DVERSION=1.11 -DRELEASE=0 -DUSEPAK=0 -DDEV=0 -DPAKNAME=\"blobAndConquer.pak\" -DPAKLOCATION=\"/usr/share/games/blobAndConquer/\" -DGAMEPLAYMANUAL=\"/usr/share/doc/blobAndConquer//index.html\" -Wall -DLOCALEDIR=\"/usr/share/locale/\" -g -c src/puzzles/mastermind.cpp

On our builders it hangs for 150 minutes without producing any output, which is our current timeout for builders.

The code in blobandconquer might be buggy, improvements to make it build with -O3 are welcome. But also, toolchain should not hang indefinitely.

Ubuntu defaults to -O3 for ppc64el port otherwise.

Frank Heimes (fheimes)
tags: added: ppc64el reverse-proxy-bugzilla
Changed in ubuntu-power-systems:
assignee: nobody → bugproxy (bugproxy)
description: updated
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I've run build with -O3 and -save-temps, for a bit. Killed it, and attaching .ii preprocessed file.

No idea if it's complete or not.

Revision history for this message
Frank Heimes (fheimes) wrote :

This is reproducible on focal and on groovy.
Both use gcc-9 (as default) with the same settings.
(It was identified on P8, but it's probably the same on P9.)

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-186241 severity-medium targetmilestone-inin---
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
William Seurer (seurer) wrote :

I tried compiling the .ii file on a power 8 LE Ubuntu system using the current gcc-9.3.0 release as downloaded from gnu.org and it worked fine. The system gcc on that machine also says it is gcc-9.3.0 but it hangs. I used the same configuration options so there must be something different about the system gcc and I assume the one used above.

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2020-06-16 08:59 EDT-------
So, sounds like Ubuntu's gcc is missing some important patch. I don't think we can diagnose this from our end.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Works:
gcc-9 -c ./mastermind.ii
gcc-10 -c ./mastermind.ii
gcc-10 -O3 -c ./mastermind.ii

Hangs:
gcc-9 -O3 -c ./mastermind.ii

20.10 will be switching to gcc-10 by default soon, so I guess it's not that critical and indeed there are fixes in the 10 branch in Ubuntu already.

Changed in gcc-10 (Ubuntu):
status: New → Fix Released
Changed in gcc-9 (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Changed in ubuntu-power-systems:
importance: Medium → Low
status: Triaged → Incomplete
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

20200629 from git also works for me. Currently ubuntu is at 20200518. I'll recheck next time gcc-9 is updated in Ubuntu.

Changed in gcc-9 (Ubuntu):
status: Confirmed → Incomplete
Changed in ubuntu-power-systems:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.