hanickadot / compile-time-regular-expressions

Compile Time Regular Expression in C++
https://twitter.com/hankadusikova
Apache License 2.0
3.37k stars 186 forks source link

cc1plus get killed #155

Open mawelo opened 3 years ago

mawelo commented 3 years ago

if you try to compile this code : https://pastebin.pl/view/e830efd6 (source also attached) the Gnu g++ Version 10.2 will run with high CPU load and gets finally killed. Linux Version: Linux node1 5.9.12-050912-generic #202012020835 SMP Wed Dec 2 09:10:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

use include: includes/ctre-unicode.hpp Compiler call and Error message: c++ --version c++ (GCC) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

c++ --std=c++20 -Os -Wall -Wextra -pedantic -ffunction-sections -fdata-sections -Wl,--gc-sections -DGIT_VERS=\"\" -D_FILE_OFFSET_BITS=64 -o constexpr_regextest constexpr_regextest.cpp -I./. -I./includes -L./libs c++: fatal error: Terminated signal terminated program cc1plus compilation terminated. make: *** [Makefile:13: build] Error 1

constexpr_regextest.zip

dotnwat commented 3 years ago

@mawelo can you check if it is being terminated by an out-of-memory situation? we upgraded to c++20 and a few compilation units using ctre have extremely high memory usage using gcc. with clang + libstdc++ it seems better.

mawelo commented 3 years ago

On 31.12.20 02:31, Noah Watkins wrote:

@mawelo https://github.com/mawelo can you check if it is being terminated by an out-of-memory situation? we upgraded to c++20 and a few compilation units using ctre have extremely high memory usage using gcc. with clang + libstdc++ it seems better.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hanickadot/compile-time-regular-expressions/issues/155#issuecomment-752811184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN367NEOXAFNCZU7JZN5BLSXPH7RANCNFSM4U2LI5WA.

Hi Noah,

yes, Linux OOMKiller will terminate cc1plus process.

Martin

--

dotnwat commented 3 years ago

Ok it looks like we are hitting the same issue. Using /usr/bin/time -v g++ ... I see that the regex I am using is eating up over 16GB memory peak and taking over a minute to compile. @hanickadot seems like this could be a gcc issue since it doesn't happen with clang + libstdc++ -- though perhaps clang has some features not enabled...