Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 856424 - sys-devel/gcc-11.3.0 fail to build sys-devel/gcc-12.1_p20220625: internal compiler error: Segmentation fault
Summary: sys-devel/gcc-11.3.0 fail to build sys-devel/gcc-12.1_p20220625: internal com...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-04 17:41 UTC by Dominique Michel
Modified: 2022-07-13 17:19 UTC (History)
0 users

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


Attachments
build logs (gcc-build-logs.tar.bz2,207.86 KB, application/x-bzip2)
2022-07-04 17:44 UTC, Dominique Michel
Details
emerge --info '=sys-devel/gcc-12.1.1_p20220625::gentoo' (emerge.log,19.17 KB, text/plain)
2022-07-04 17:56 UTC, Dominique Michel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Michel 2022-07-04 17:41:21 UTC
libtool: compile:  /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc -nostdinc++ -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -fno-checking -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/../libgcc -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/libsupc++ -std=gnu++17 -nostdinc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=fs_ops.lo -fimplicit-templates -g -march=native -pipe -O2 -D_GNU_SOURCE -c /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/src/c++17/fs_ops.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o fs_ops.o
during RTL pass: ree
In file included from /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/deque:67,
                 from /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/stack:60,
                 from /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/src/c++17/fs_ops.cc:39:
/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/deque.tcc: In member function ‘void std::deque<_Tp, _Alloc>::_M_insert_aux(iterator, _ForwardIterator, _ForwardIterator, size_type) [with _ForwardIterator = std::filesystem::__cxx11::path::iterator; _Tp = std::filesystem::__cxx11::path; _Alloc = std::allocator<std::filesystem::__cxx11::path>]’:
/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/deque.tcc:855:7: internal compiler error: Segmentation fault
  855 |       }
      |       ^
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://bugs.gentoo.org/> for instructions.
make[6]: *** [Makefile:585: fs_ops.lo] Error 1


Reproducible: Always

Steps to Reproduce:
1. emerge
2.
3.



Not sure if it is or not a duplicate of #835069. Here, gcc fail during the first compilation stage.
Comment 1 Dominique Michel 2022-07-04 17:44:27 UTC
Created attachment 790067 [details]
build logs
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-04 17:45:23 UTC
It's probably not a duplicate of bug 835069 unless you're on prefix (you'd know if you were).

Can you follow https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide?
Comment 3 Dominique Michel 2022-07-04 17:50:13 UTC
(In reply to Sam James from comment #2)
> It's probably not a duplicate of bug 835069 unless you're on prefix (you'd
> know if you were).
> 
> Can you follow https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide?

Yes, I will try.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-04 17:50:28 UTC
Thanks! Could you also include emerge --info?
Comment 5 Dominique Michel 2022-07-04 17:56:56 UTC
Created attachment 790070 [details]
emerge --info '=sys-devel/gcc-12.1.1_p20220625::gentoo'
Comment 6 Dominique Michel 2022-07-04 22:49:55 UTC
dmesg say nothing wrong.
memtest86 do nothing, it just hang at startup from grub.

When running the emerge compile command into the build directory, I get the same issue but at another place of the code:

make --output-sync=line -j3 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' STAGE1_CFLAGS=-freport-bug LIBPATH=/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1 'BOOT_CFLAGS=-m64 -march=native -pipe -O2' bootstrap-lean
...
snip
...
make[10]: Entering directory '/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src/c++98'
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc -nostdinc++ -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -fno-checking  -m32 -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/../libgcc -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/x86_64-pc-linux-gnu -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/include -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/libsupc++   -std=gnu++98 -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates  -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2  -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -frandom-seed=monetary_members.lo  -g -march=native -pipe -O2 -D_GNU_SOURCE  -m32  -c -o monetary_members.lo monetary_members.cc
libtool: compile:  /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc -nostdinc++ -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/src/.libs -L/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -fno-checking -m32 -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/../libgcc -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/include/x86_64-pc-linux-gnu -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/x86_64-pc-linux-gnu/32/libstdc++-v3/include -I/var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/gcc-12-20220625/libstdc++-v3/libsupc++ -std=gnu++98 -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=monetary_members.lo -g -march=native -pipe -O2 -D_GNU_SOURCE -m32 -c monetary_members.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o monetary_members.o
during RTL pass: sched2
monetary_members.cc: In member function ‘void std::__cxx11::moneypunct<_CharT, _Intl>::_M_initialize_moneypunct(std::__c_locale, const char*) [with _CharT = char; bool _Intl = false]’:
monetary_members.cc:517:5: internal compiler error: Segmentation fault
  517 |     }
      |     ^
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://bugs.gentoo.org/> for instructions.
make[10]: *** [Makefile:657: monetary_members.lo] Error 1


If I go into that dir and run the /bin/sh command, it succeed.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-05 02:12:33 UTC
(In reply to Dominique Michel from comment #6)
> dmesg say nothing wrong.
> memtest86 do nothing, it just hang at startup from grub.
> 

Try sys-apps/memtest86+?
Comment 8 Dominique Michel 2022-07-05 20:27:51 UTC
(In reply to Sam James from comment #7)

> 
> Try sys-apps/memtest86+?

All is fine with it. I ran several passes of all tests on all the RAM, that for each 3 CPU modes and with a result of 0 error.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-06 06:40:21 UTC
Working when you run the command again is pretty suspicious. What if you try running the /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc/xgcc [...] part (full command) when it fails? (Go into the dir first)
Comment 10 Dominique Michel 2022-07-07 13:39:08 UTC
(In reply to Sam James from comment #9)
> Working when you run the command again is pretty suspicious. What if you try
> running the
> /var/tmp/notmpfs/portage/sys-devel/gcc-12.1.1_p20220625/work/build/./gcc/
> xgcc [...] part (full command) when it fails? (Go into the dir first)

It work fine, and if I run the general make command, it continue until another similar failure. If I run the specific g(x)cc command on that new failure. it work.

Also, if I run emerge or 'ebuild gcc-...ebuild compile', the first failure is reproducible, it fail each time on the same file.

Maybe I must try to cross-compile gcc-11.3 into another machine, install it over the installed one and see if that solve that bug.
Comment 11 Dominique Michel 2022-07-13 17:04:05 UTC
If I boot into that installation, make a chroot into /mnt/gentoo with a stage 3 and some bind mounted directories, and run 'FEATURES="buildpkg" emerge --deep --update --newuse @system', gcc-12.1.1_p20220625 compile fine with the stage3 gcc-11.3.0. Which imply it must not be the running kernel that trigger that bug.

That also imply I am stuck with that bug. I have not installed the packages done inside the chroot at that time, but I still have no clue how to reproduce that bug when I follow https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide, that in order to get the needed preprocessed file.
Comment 12 Dominique Michel 2022-07-13 17:19:48 UTC
That installation is a 10 years old install. So maybe some obscure bug or some mistake of me triggered that bug with time and multiple updates.