Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 905634 - sys-devel/gcc-10.4.1_p20230426-r1 regression: fails to compile qtwebengine's SkOpAngle.cpp with OOM
Summary: sys-devel/gcc-10.4.1_p20230426-r1 regression: fails to compile qtwebengine's ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-03 06:48 UTC by Matthew Ogilvie
Modified: 2024-01-25 05:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Standalone pre-processed file that triggers this g++ bug. (SkOpAngle.ii.bz2,146.09 KB, application/x-bzip2)
2023-05-04 00:44 UTC, Matthew Ogilvie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Ogilvie 2023-05-03 06:48:44 UTC
Procedure:

1. Use sys-devel/gcc-10.4.1_p20230426-r1.
2. As part of a larger system, my nightly build scripts configure and build a couple of versions of Qt (including qtwebengine) normally (not using portage).
3. BUG: That recently started failing as described below when compiling SkOpAngle.cpp.
4. Then I cd into the appropriate directory and repeat the failed g++ invocation manually (cut/paste from log; see below).
5. BUG: When I monitor the one manual g++ invocation in "top", the main process takes a couple of minutes and gradually uses all my RAM and swap (over 80 GB), and then it dies with the message:

---- Qt 5.9.9 error:
{standard input}: Assembler messages:
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
----

======

Variations:

I suspect ebuilds for dev-qt/qtwebengine would probably also fail (especially considering Qt 6.3.2 below), although I haven't confirmed it.

Works:
A. I do NOT get the error when using any other compiler (by modifying the "g++" in the copy/pasted command), such as g++-11, g++-12, or old mostly-unused installs of g++-9.3.0 or g++-9.4.0 I still happen to have.
B. It also doesn't fail if I resurrect the previous sys-devel/gcc-10.4.1_p20230119-r1 using my personal overlay and (re-)try that.
C. With all of these alternatives, manually compiling the file takes less than 1 second.  I haven't tried to confirm how much RAM it uses, but probably far less than 1 GB, let alone 80.

Broken: I get a similar error (not identical) with Qt 6.3.2, also failing on SkOpAngle.cpp with this compiler (although I didn't bother to try to manually invoke / confirm behavior of the one command):

---- Qt 6.3.2 error:
{standard input}: Assembler messages:
{standard input}:2381: Warning: end of file not at end of a line; newline inserted
{standard input}:2382: Error: number of operands mismatch for `movq'
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
----


=====

Command: The Qt 5.9.9 compiler invocation command that gives the above message is shown below, although I suspect it could be slightly different depending on exactly how Qt is configured:

Manual directory: cd qt-everywhere-opensource-src-5.9.9/qtwebengine/src/core/Release

/usr/bin/g++ -MMD -MF obj/skia/skia/SkOpAngle.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DDISABLE_NACL -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_IGNORE_DW_GRAY_FIX -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_SUPPORT_GPU=1 -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/skia/config -I../../3rdparty/chromium/skia/ext -I../../3rdparty/chromium/third_party/skia/include/c -I../../3rdparty/chromium/third_party/skia/include/config -I../../3rdparty/chromium/third_party/skia/include/core -I../../3rdparty/chromium/third_party/skia/include/effects -I../../3rdparty/chromium/third_party/skia/include/images -I../../3rdparty/chromium/third_party/skia/include/lazy -I../../3rdparty/chromium/third_party/skia/include/pathops -I../../3rdparty/chromium/third_party/skia/include/pdf -I../../3rdparty/chromium/third_party/skia/include/pipe -I../../3rdparty/chromium/third_party/skia/include/ports -I../../3rdparty/chromium/third_party/skia/include/utils -I../../3rdparty/chromium/third_party/skia/include/gpu -I../../3rdparty/chromium/third_party/skia/src/gpu -I../../3rdparty/chromium/third_party/skia/src/sksl -I../../3rdparty/chromium/third_party/skia/include/private -I../../3rdparty/chromium/third_party/skia/include/client/android -I../../3rdparty/chromium/third_party/skia/src/core -I../../3rdparty/chromium/third_party/skia/src/image -I../../3rdparty/chromium/third_party/skia/src/opts -I../../3rdparty/chromium/third_party/skia/src/pdf -I../../3rdparty/chromium/third_party/skia/src/ports -I../../3rdparty/chromium/third_party/skia/src/sfnt -I../../3rdparty/chromium/third_party/skia/src/utils -I../../3rdparty/chromium/third_party/skia/src/lazy -Igen -I../../3rdparty/chromium/third_party/icu/source/common -I../../3rdparty/chromium/third_party/icu/source/i18n -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -m64 -g0 -fvisibility=hidden -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-delete-null-pointer-checks -fno-rtti -fno-exceptions -Wno-deprecated -Wno-narrowing -c ../../3rdparty/chromium/third_party/skia/src/pathops/SkOpAngle.cpp -o obj/skia/skia/SkOpAngle.o

---

Command: For Qt 6.3.2, I forgot to note the directory, but the failing command is:

/usr/bin/g++ -MMD -MF obj/skia/skia_core_and_effects/SkOpAngle.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_UNTIL_CRBUG_1187654_IS_FIXED -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_ENABLE_SKSL -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_HAS_WUFFS_LIBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DSKIA_IMPLEMENTATION=1 -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -Igen -I../../../3rdparty/chromium -I../../../3rdparty/chromium/third_party/skia -I../../../3rdparty/chromium/third_party/wuffs/src/release/c -I../../../3rdparty/chromium/third_party/vulkan/include -I../../../3rdparty/chromium/third_party/vulkan-deps/vulkan-headers/src/include -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-unknown-pragmas -Wno-parentheses -Wno-sign-compare -Wno-stringop-overflow -Wno-stringop-overread -Wno-psabi -Wno-multichar -Wno-format-zero-length -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -m64 -fno-omit-frame-pointer -g0 -fvisibility=hidden -O2 -fdata-sections -ffunction-sections -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -std=c++17 -std=gnu++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -std=c++17 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -c ../../../3rdparty/chromium/third_party/skia/src/pathops/SkOpAngle.cpp -o obj/skia/skia_core_and_effects/SkOpAngle.o

=====

Personal plan: I had already been thinking it is about time to update to gcc 11, so this regression kind of accelerates that idea.  But in the mean time (until I test and work out unrelated kinks for the upgrade), I'm reverting back to gcc-10.4.1_p20230119-r1.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-03 06:50:00 UTC
Interesting. FWIW, 10 is indeed about to be EOL (it'll get a 10.5 release shortly and then that's it).
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-03 06:54:17 UTC
My guess would've been https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107163 but it landed in 0426.

If you're willing to try identify the commit, I'm happy to take it forward upstream (and/or ship a revert in gentoo if it's trivial), but I don't have a lot of time to otherwise investigate 10. Ideally, if we are going to do that, we'll do that very soon so we can get a fix into 10.5.

It should be doable to bisect with `timeout` w/ git bisect run (see e.g. https://wiki.gentoo.org/wiki/Bisecting_with_live_ebuilds or can just do it manually with a gcc checkout).
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-03 06:55:10 UTC
(In reply to Sam James from comment #2)
> My guess would've been https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107163
> but it landed in 0426.
> 
> If you're willing to try identify the commit, I'm happy to take it forward
> upstream (and/or ship a revert in gentoo if it's trivial), but I don't have
> a lot of time to otherwise investigate 10. Ideally, if we are going to do
> that, we'll do that very soon so we can get a fix into 10.5.
> 

... I'd probably be able to try if you could upload a preprocessed version of the bad file & a command which reproduces with it.

e.g. add -save-temps to the bad SkOpAngle command, then upload SkOpAngle.ii (likely needs to be compressed), verify the standalone command works with it.
Comment 4 Matthew Ogilvie 2023-05-04 00:44:13 UTC
Created attachment 861110 [details]
Standalone pre-processed file that triggers this g++ bug.

Here is the already-pre-processed file.

I can reproduce the memory usage with p20230426-r1 in any directory with SkOpAngle.ii using the command below (although I've terminated it early at just a few GB), while p20230119-r1 works fine with the same command.

/usr/bin/g++-10 -MMD -MF SkOpAngle.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DDISABLE_NACL -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_IGNORE_DW_GRAY_FIX -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_SUPPORT_GPU=1 -DSK_GAMMA_EXPONENT=1.2 -DSK_GAMMA_CONTRAST=0.2 -DSK_DEFAULT_FONT_CACHE_LIMIT=20971520 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/skia/config -I../../3rdparty/chromium/skia/ext -I../../3rdparty/chromium/third_party/skia/include/c -I../../3rdparty/chromium/third_party/skia/include/config -I../../3rdparty/chromium/third_party/skia/include/core -I../../3rdparty/chromium/third_party/skia/include/effects -I../../3rdparty/chromium/third_party/skia/include/images -I../../3rdparty/chromium/third_party/skia/include/lazy -I../../3rdparty/chromium/third_party/skia/include/pathops -I../../3rdparty/chromium/third_party/skia/include/pdf -I../../3rdparty/chromium/third_party/skia/include/pipe -I../../3rdparty/chromium/third_party/skia/include/ports -I../../3rdparty/chromium/third_party/skia/include/utils -I../../3rdparty/chromium/third_party/skia/include/gpu -I../../3rdparty/chromium/third_party/skia/src/gpu -I../../3rdparty/chromium/third_party/skia/src/sksl -I../../3rdparty/chromium/third_party/skia/include/private -I../../3rdparty/chromium/third_party/skia/include/client/android -I../../3rdparty/chromium/third_party/skia/src/core -I../../3rdparty/chromium/third_party/skia/src/image -I../../3rdparty/chromium/third_party/skia/src/opts -I../../3rdparty/chromium/third_party/skia/src/pdf -I../../3rdparty/chromium/third_party/skia/src/ports -I../../3rdparty/chromium/third_party/skia/src/sfnt -I../../3rdparty/chromium/third_party/skia/src/utils -I../../3rdparty/chromium/third_party/skia/src/lazy -Igen -I../../3rdparty/chromium/third_party/icu/source/common -I../../3rdparty/chromium/third_party/icu/source/i18n -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -m64 -g0 -fvisibility=hidden -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-delete-null-pointer-checks -fno-rtti -fno-exceptions -Wno-deprecated -Wno-narrowing -c SkOpAngle.ii -o SkOpAngle.o
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-04 00:53:10 UTC
Many thanks. Reproduced and trying a bisect (using timeout as a proxy, because it completes very quickly w/ >= 11).
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-04 01:48:10 UTC
(In reply to Sam James from comment #5)
> Many thanks. Reproduced and trying a bisect (using timeout as a proxy,
> because it completes very quickly w/ >= 11).

$ git bisect good 18bc39a4c83f8d59175061a58637de9f4b2a54d4
$ git bisect bad db0b8927d663cf54ad13dc2629ec195e3883d0d0
Bisecting: 73 revisions left to test after this (roughly 6 steps)
[9db1287c8ced5425f6ef9d26b05a3eb9cbcc4b8d] Fortran: improve checking of character length specification [PR96025]

----

051f78a5c1d6994c10ee7c35453ff0ccee94e5c6 is the first bad commit
commit 051f78a5c1d6994c10ee7c35453ff0ccee94e5c6
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Sep 2 13:36:13 2022 +0200

    tree-optimization/106809 - compile time hog in VN

    The dominated_by_p_w_unex function is prone to high compile time.
    With GCC 12 we introduced a VN run for uninit diagnostics which now
    runs into a degenerate case with bison generated code.  Fortunately
    this case is easy to fix with a simple extra check - a more
    general fix needs more work.

            PR tree-optimization/106809
            * tree-ssa-sccvn.c (dominaged_by_p_w_unex): Check we have
            more than one successor before doing extra work.

            * gcc.dg/torture/pr106809.c: New testcase.

    (cherry picked from commit be1b42de9c151d46c89f9a8f82d4c5839a19ea94)

 gcc/testsuite/gcc.dg/torture/pr106809.c | 28 ++++++++++++++++
 gcc/tree-ssa-sccvn.c                    | 57 +++++++++++++++++----------------
 2 files changed, 58 insertions(+), 27 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/torture/pr106809.c
bisect found first bad commit
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-04 01:56:07 UTC
Thanks, reported upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109724.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-04 07:58:57 UTC
Thank you. This is fixed on releases/gcc-10, but for now, you can use https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=4ee3d035a9beddab30515d906dde5186e844d4a2 as a patch.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-10 23:27:46 UTC
commit 17d5b43d3df7cdf740340cf216eba63a311d778a
Author: Sam James <sam@gentoo.org>
Date:   Wed May 10 23:51:22 2023 +0100

    sys-devel/gcc: add 10.4.1_p20230510

    Signed-off-by: Sam James <sam@gentoo.org>
Comment 10 Larry the Git Cow gentoo-dev 2023-05-21 01:05:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9aefd331b57e9e2e67e906936a8ef737b1953721

commit 9aefd331b57e9e2e67e906936a8ef737b1953721
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-05-21 00:58:42 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-21 00:58:42 +0000

    sys-devel/gcc: keyword 10.4.1_p20230517
    
    Closes: https://bugs.gentoo.org/905634
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/gcc-10.4.1_p20230517.ebuild | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)