Bug 2059646

Summary: compilation of prusa-slicer hangs
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amodra, aoliva, dmalcolm, dvlasenk, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---Keywords: Bugfix, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: binutils-2.38-6.fc37 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-17 11:05:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2046850    
Attachments:
Description Flags
preprocessed source (gzipped)
none
compiled, not assembled source (xz compressed) none

Description Mamoru TASAKA 2022-03-01 16:00:25 UTC
Created attachment 1863725 [details]
preprocessed source (gzipped)

Description of problem:

Looks like compilation of test_voronoi.cpp in prusa-slicer hangs at least on x86_64, ppc64le
s390x okay


Version-Release number of selected component (if applicable):
gcc-12.0.1-0.9.fc37.x86_64

How reproducible:
Looks 100%

Steps to Reproduce:

/usr/bin/g++ -DBOOST_LOG_DYN_LINK -DCATCH_CONFIG_FAST_COMPILE -DCGAL_USE_GMPXX=1 -DLIBNEST2D_GEOMETRIES_libslic3r -DLIBNEST2D_OPTIMIZER_nlopt -DLIBNEST2D_STATIC -DLIBNEST2D_THREADING_tbb -DSLIC3R_GUI -DTBB_USE_CAPTURED_EXCEPTION=0 -DTEST_DATA_DIR="R\"(/builddir/build/BUILD/PrusaSlicer-version_2.4.0/tests/data)\"" -DUNICODE -DUSE_TBB -DWXINTL_NO_GETTEXT_MACRO -D_UNICODE -DwxNO_UNSAFE_WXSTRING_CONV -DwxUSE_UNICODE -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/src -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/redhat-linux-build/src/platform -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/tests -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/redhat-linux-build/src/libslic3r -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/libnest2d/include -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/miniz -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/glu-libtess/include -I/builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/qhull/src -isystem /usr/include/eigen3 -isystem /builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/libigl -isystem /usr/include/Imath -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fext-numeric-literals -Wall -Wno-reorder -DNDEBUG -fPIE -fsigned-char -Werror=return-type -Wno-ignored-attributes -Wno-unknown-pragmas -pthread -DOPENVDB_ABI_VERSION_NUMBER=9 -std=gnu++17 -MD -MT tests/libslic3r/CMakeFiles/libslic3r_tests.dir/test_voronoi.cpp.o -MF CMakeFiles/libslic3r_tests.dir/test_voronoi.cpp.o.d -o CMakeFiles/libslic3r_tests.dir/test_voronoi.cpp.o -c /builddir/build/BUILD/PrusaSlicer-version_2.4.0/tests/libslic3r/test_voronoi.cpp


Actual results:
Hangs

Expected results:
-O0, -O1 seems okay??

Additional info:

Comment 1 Mamoru TASAKA 2022-03-01 23:40:07 UTC
Created attachment 1863764 [details]
compiled, not assembled source (xz compressed)

Once killed -pipe and added -v
Looks like "compiling" is okay, "assembling" is hanging:

Hanging command is:

as -v -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/src -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/redhat-linux-build/src/platform -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/tests -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/redhat-linux-build/src/libslic3r -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/libnest2d/include -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/miniz -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/glu-libtess/include -I /builddir/build/BUILD/PrusaSlicer-version_2.4.0/src/qhull/src --gdwarf-5 --64 -o CMakeFiles/libslic3r_tests.dir/test_voronoi.cpp.o /tmp/cc9eRPOh.s

Comment 2 Mamoru TASAKA 2022-03-01 23:41:45 UTC
Once changing to binutils

Comment 3 Mamoru TASAKA 2022-03-01 23:44:34 UTC
binutils is using binutils-2.37-24.fc36.x86_64

Comment 4 Nick Clifton 2022-03-07 14:11:34 UTC
Hi Mamoru,  

  The problem appears to be an O(n2) algorithm in the assembler's handling
  of location views.  I have not fully debugged the issue, but in the meantime,
  if this is a problem for you, you may find that adding "--gno-as-locview-support"
  to the gcc command line will make the build work.

Cheers
  Nick

Comment 5 Alan Modra 2022-03-09 05:28:58 UTC
Fixed with https://sourceware.org/pipermail/binutils/2022-March/119965.html

Comment 6 Nick Clifton 2022-03-09 16:02:20 UTC
I have added Alan's patch to binutils-2.38-4.fc37

Comment 7 Mamoru TASAKA 2022-03-10 10:38:52 UTC
Umm... I tested binutils-2.38-4.fc37 but as (assembling) to test_voronoi.cpp.o hangs on x86_64 at least for 2 hours (and now going), i.e. it does not seem to be working.

Comment 8 Nick Clifton 2022-03-10 12:42:20 UTC
Oh bananas - I missed the second part of Alan's patch.  Sorry - fixing now

Comment 9 Nick Clifton 2022-03-10 15:17:53 UTC
Right - please try: binutils-2.38-6.fc37

Comment 10 Mamoru TASAKA 2022-03-11 02:58:56 UTC
Okay, binutils-2.38-6.fc37 seems good - at least on x86_64: as'ing test_voronoi.cpp.o finishes normally.

Comment 11 Mamoru TASAKA 2022-03-16 11:30:26 UTC
By the way, when will binutils-2.38-6.fc37 be available on rawhide buildroot?
There seems to be several attempt for building binutils 2.38 on koji already, however rawhide buildroot still has binutils-2.37-24.fc36 .

Comment 12 Nick Clifton 2022-03-16 11:59:34 UTC
(In reply to Mamoru TASAKA from comment #11)
> By the way, when will binutils-2.38-6.fc37 be available on rawhide buildroot?
> There seems to be several attempt for building binutils 2.38 on koji
> already, however rawhide buildroot still has binutils-2.37-24.fc36 .

The Bodhi update has been blocked because the fedora-ci.koji-build.tier0.functional
test faiiled:

  https://bodhi.fedoraproject.org/updates/FEDORA-2022-f73bbc6f40

The test is failing because the linker testsuite is reporting some
unexpected failures.  I have already looked at these and determined
that there are no problems with the binutils sources themselves, just
the test harness code, so I have gone ahead and waived the result.
(We are working on a patch which will resolve these failures, but it
is not ready yet).

Ideally this should mean that the new binutils will be pushed to the
buildroot soon.

Comment 13 Mamoru TASAKA 2022-03-17 11:05:49 UTC
Confirmed fixed. test_voronoi.cpp in prusa-slicer-2.4.0-3.fc37 compiles successfully with binutils-2.38-6.fc37.
Thank you.