public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory
@ 2022-11-01  1:41 seehearfeel at 126 dot com
  2022-11-01  1:45 ` [Bug c++/107483] " seehearfeel at 126 dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: seehearfeel at 126 dot com @ 2022-11-01  1:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483

            Bug ID: 107483
           Summary: c++: fatal error: Killed signal terminated program
                    cc1plus due to out of memory
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seehearfeel at 126 dot com
  Target Milestone: ---

When build llvm used with c++ 13, c++: fatal error: Killed signal terminated
program cc1plus due to out of memory.

https://reviews.llvm.org/D136362#3895385

I can reproduce this issue on x86_64 used with the latest gcc.

(1) Install Fedora36
https://download.fedoraproject.org/pub/fedora/linux/releases/36/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-36-1.5.iso

$ uname -a
Linux fedora 5.17.5-300.fc36.x86_64 #1 SMP PREEMPT Thu Apr 28 15:51:30 UTC 2022
x86_64 x86_64 x86_64 GNU/Linux

(2) Install some packages
sudo yum -y install llvm clang g++ cmake ninja-build bison flex texinfo

$ gcc --version
gcc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2)
$ c++ --version
c++ (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2)
$ clang --version
clang version 14.0.5 (Fedora 14.0.5-1.fc36)
$ clang++ --version
clang version 14.0.5 (Fedora 14.0.5-1.fc36)

(3) Build llvm

git clone https://github.com/llvm/llvm-project.git
mkdir -p llvm-project/llvm/build
cd llvm-project/llvm/build
cmake .. -G "Ninja" -DLLVM_TARGETS_TO_BUILD="X86" \
         -DLLVM_ENABLE_PROJECTS="clang;lldb" \
         -DCMAKE_BUILD_TYPE=Release \
         -DLLVM_BUILD_RUNTIME=OFF
ninja
ninja check-lldb
This is OK used with gcc/c++ 12.

(4) Update gcc to the latest version
git clone git://gcc.gnu.org/git/gcc.git
cd gcc
./contrib/download_prerequisites
mkdir -p build
cd build
../configure --prefix=/usr/local/gcc --enable-checking=release
--enable-languages=c,c++ --disable-multilib
make
sudo make install
export PATH=/usr/local/gcc/bin/:$PATH
export LD_LIBRARY_PATH=/usr/local/gcc/lib64:$LD_LIBRARY_PATH

$ gcc --version
gcc (GCC) 13.0.0 20221029 (experimental)
$ c++ --version
c++ (GCC) 13.0.0 20221029 (experimental)

(5) Do the above (3) again used with gcc/c++ 13

git clone https://github.com/llvm/llvm-project.git
mkdir -p llvm-project/llvm/build
cd llvm-project/llvm/build
cmake .. -G "Ninja" -DLLVM_TARGETS_TO_BUILD="X86" \
         -DLLVM_ENABLE_PROJECTS="clang;lldb" \
         -DCMAKE_BUILD_TYPE=Release \
         -DLLVM_BUILD_RUNTIME=OFF \
         -DCMAKE_C_COMPILER="/usr/local/gcc/bin/gcc" \
         -DCMAKE_CXX_COMPILER="/usr/local/gcc/bin/c++"
ninja
ninja check-lldb
We can see that "ninja check-lldb" failed due to OOM
used with gcc/c++ 13.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/107483] c++: fatal error: Killed signal terminated program cc1plus due to out of memory
  2022-11-01  1:41 [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory seehearfeel at 126 dot com
@ 2022-11-01  1:45 ` seehearfeel at 126 dot com
  2022-11-01  2:03 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: seehearfeel at 126 dot com @ 2022-11-01  1:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483

Tiezhu Yang <seehearfeel at 126 dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |seehearfeel at 126 dot com

--- Comment #1 from Tiezhu Yang <seehearfeel at 126 dot com> ---
dmesg shows that c++ 13 is getting killed by the OOM-killer due to using too
many resources. Adding 64G swap, it is still OOM. c++ 12 has no problem.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/107483] c++: fatal error: Killed signal terminated program cc1plus due to out of memory
  2022-11-01  1:41 [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory seehearfeel at 126 dot com
  2022-11-01  1:45 ` [Bug c++/107483] " seehearfeel at 126 dot com
@ 2022-11-01  2:03 ` pinskia at gcc dot gnu.org
  2022-11-01  2:04 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-01  2:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Which file is it happening?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/107483] c++: fatal error: Killed signal terminated program cc1plus due to out of memory
  2022-11-01  1:41 [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory seehearfeel at 126 dot com
  2022-11-01  1:45 ` [Bug c++/107483] " seehearfeel at 126 dot com
  2022-11-01  2:03 ` pinskia at gcc dot gnu.org
@ 2022-11-01  2:04 ` pinskia at gcc dot gnu.org
  2022-11-01  2:04 ` pinskia at gcc dot gnu.org
  2022-11-01  2:18 ` seehearfeel at 126 dot com
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-01  2:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you attach the preprocessed source of which file gcc is failing out of
memory on?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/107483] c++: fatal error: Killed signal terminated program cc1plus due to out of memory
  2022-11-01  1:41 [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory seehearfeel at 126 dot com
                   ` (2 preceding siblings ...)
  2022-11-01  2:04 ` pinskia at gcc dot gnu.org
@ 2022-11-01  2:04 ` pinskia at gcc dot gnu.org
  2022-11-01  2:18 ` seehearfeel at 126 dot com
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-01  2:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-11-01
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/107483] c++: fatal error: Killed signal terminated program cc1plus due to out of memory
  2022-11-01  1:41 [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory seehearfeel at 126 dot com
                   ` (3 preceding siblings ...)
  2022-11-01  2:04 ` pinskia at gcc dot gnu.org
@ 2022-11-01  2:18 ` seehearfeel at 126 dot com
  4 siblings, 0 replies; 6+ messages in thread
From: seehearfeel at 126 dot com @ 2022-11-01  2:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107483

--- Comment #4 from Tiezhu Yang <seehearfeel at 126 dot com> ---
https://github.com/llvm/llvm-project/blob/main/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp

This issue is introduced in the following commit:

$ git log -p lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
commit 05ae747a5353811f93f5814f24d2335e6229d78a
Author: Emmmer <yjhdandan@163.com>
Date:   Thu Oct 20 23:05:37 2022 +0800

    [LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV


Here is a patch of lldb for optimization, but build also failed used with c++
13.

[LLDB] Optimize lldb build time and memory consumption.
https://reviews.llvm.org/D137041

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-01  2:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01  1:41 [Bug c++/107483] New: c++: fatal error: Killed signal terminated program cc1plus due to out of memory seehearfeel at 126 dot com
2022-11-01  1:45 ` [Bug c++/107483] " seehearfeel at 126 dot com
2022-11-01  2:03 ` pinskia at gcc dot gnu.org
2022-11-01  2:04 ` pinskia at gcc dot gnu.org
2022-11-01  2:04 ` pinskia at gcc dot gnu.org
2022-11-01  2:18 ` seehearfeel at 126 dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).