llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.87k stars 11.92k forks source link

Ubuntu clang version 18.1.3 (1ubuntu1) crashes while building Boost 1.86.0 #105936

Closed valiko-ua closed 2 months ago

valiko-ua commented 2 months ago

Requested files are attached. Note that I replaced my username with "username" in them. The crash is reproducible on my side (tried twice).

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: clang++ -fvisibility-inlines-hidden -fPIC -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_SOURCE -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I. -I/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src -I/usr/include -c -o bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o /home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src/boost/locale/shared/date_time.cpp
1.  ./boost/date_time/gregorian/greg_weekday.hpp:41:69: current parser token '{'
2.  ./boost/date_time/gregorian/greg_weekday.hpp:18:1: parsing namespace 'boost'
3.  ./boost/date_time/gregorian/greg_weekday.hpp:19:1: parsing namespace 'boost::gregorian'
4.  ./boost/date_time/gregorian/greg_weekday.hpp:41:3: parsing struct/union/class body 'boost::gregorian::greg_weekday'
5.  ./boost/date_time/constrained_value.hpp:42:30: instantiating class definition 'boost::CV::constrained_value<boost::CV::simple_exception_policy<unsigned short, 0, 6, boost::gregorian::bad_weekday>>'
6.  ./boost/date_time/constrained_value.hpp:87:30: instantiating class definition 'boost::CV::simple_exception_policy<unsigned short, 0, 6, boost::gregorian::bad_weekday>'
7.  ./boost/type_traits/is_base_of.hpp:30:48: instantiating class definition 'boost::is_base_of<std::exception, boost::gregorian::bad_weekday>'
8.  ./boost/type_traits/is_base_of.hpp:20:14: instantiating class definition 'boost::detail::is_base_of_imp<std::exception, boost::gregorian::bad_weekday>'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.so.18.1      0x000075ffb9da63bf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63
1  libLLVM.so.18.1      0x000075ffb9da44f9 llvm::sys::RunSignalHandlers() + 89
2  libLLVM.so.18.1      0x000075ffb9cf0227
3  libc.so.6            0x000075ffb8845320
4  libc.so.6            0x000075ffb88a9bbc
5  libc.so.6            0x000075ffb88abfb1
6  libc.so.6            0x000075ffb88ad7e2 malloc + 418
7  libclang-cpp.so.18.1 0x000075ffc188d6fd
8  libclang-cpp.so.18.1 0x0000555d903443b0
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux
Thread model: posix
InstalledDir: /usr/bin
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/date_time-4c33b0.cpp
clang++: note: diagnostic msg: /tmp/date_time-4c33b0.sh
clang++: note: diagnostic msg: 

********************

    "clang++"   -fvisibility-inlines-hidden -fPIC -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --target=x86_64-pc-linux  -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_SOURCE -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG   -I"." -I"/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src" -I"/usr/include"  -c -o "bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o" "/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src/boost/locale/shared/date_time.cpp"

...failed clang-linux.compile.c++ bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o...

files.zip

Endilll commented 2 months ago

I can't reproduce this using either 20.0 or 18.1.3 with assertions. Can you reproduce this using snaphot builds from https://apt.llvm.org or your own build of main from sources?

llvmbot commented 2 months ago

@llvm/issue-subscribers-clang-frontend

Author: Valentyn Shtronda (valiko-ua)

Requested files are attached. Note that I replaced my username with "username" in them. The crash is reproducible on my side (tried twice). ``` PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: clang++ -fvisibility-inlines-hidden -fPIC -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_SOURCE -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I. -I/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src -I/usr/include -c -o bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o /home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src/boost/locale/shared/date_time.cpp 1. ./boost/date_time/gregorian/greg_weekday.hpp:41:69: current parser token '{' 2. ./boost/date_time/gregorian/greg_weekday.hpp:18:1: parsing namespace 'boost' 3. ./boost/date_time/gregorian/greg_weekday.hpp:19:1: parsing namespace 'boost::gregorian' 4. ./boost/date_time/gregorian/greg_weekday.hpp:41:3: parsing struct/union/class body 'boost::gregorian::greg_weekday' 5. ./boost/date_time/constrained_value.hpp:42:30: instantiating class definition 'boost::CV::constrained_value<boost::CV::simple_exception_policy<unsigned short, 0, 6, boost::gregorian::bad_weekday>>' 6. ./boost/date_time/constrained_value.hpp:87:30: instantiating class definition 'boost::CV::simple_exception_policy<unsigned short, 0, 6, boost::gregorian::bad_weekday>' 7. ./boost/type_traits/is_base_of.hpp:30:48: instantiating class definition 'boost::is_base_of<std::exception, boost::gregorian::bad_weekday>' 8. ./boost/type_traits/is_base_of.hpp:20:14: instantiating class definition 'boost::detail::is_base_of_imp<std::exception, boost::gregorian::bad_weekday>' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 libLLVM.so.18.1 0x000075ffb9da63bf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63 1 libLLVM.so.18.1 0x000075ffb9da44f9 llvm::sys::RunSignalHandlers() + 89 2 libLLVM.so.18.1 0x000075ffb9cf0227 3 libc.so.6 0x000075ffb8845320 4 libc.so.6 0x000075ffb88a9bbc 5 libc.so.6 0x000075ffb88abfb1 6 libc.so.6 0x000075ffb88ad7e2 malloc + 418 7 libclang-cpp.so.18.1 0x000075ffc188d6fd 8 libclang-cpp.so.18.1 0x0000555d903443b0 clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation) Ubuntu clang version 18.1.3 (1ubuntu1) Target: x86_64-pc-linux Thread model: posix InstalledDir: /usr/bin clang++: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /tmp/date_time-4c33b0.cpp clang++: note: diagnostic msg: /tmp/date_time-4c33b0.sh clang++: note: diagnostic msg: ******************** "clang++" -fvisibility-inlines-hidden -fPIC -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_SOURCE -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I"." -I"/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src" -I"/usr/include" -c -o "bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o" "/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src/boost/locale/shared/date_time.cpp" ...failed clang-linux.compile.c++ bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o... ``` [files.zip](https://github.com/user-attachments/files/16736706/files.zip)
llvmbot commented 2 months ago

@llvm/issue-subscribers-c-1

Author: Valentyn Shtronda (valiko-ua)

Requested files are attached. Note that I replaced my username with "username" in them. The crash is reproducible on my side (tried twice). ``` PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: clang++ -fvisibility-inlines-hidden -fPIC -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_SOURCE -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I. -I/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src -I/usr/include -c -o bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o /home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src/boost/locale/shared/date_time.cpp 1. ./boost/date_time/gregorian/greg_weekday.hpp:41:69: current parser token '{' 2. ./boost/date_time/gregorian/greg_weekday.hpp:18:1: parsing namespace 'boost' 3. ./boost/date_time/gregorian/greg_weekday.hpp:19:1: parsing namespace 'boost::gregorian' 4. ./boost/date_time/gregorian/greg_weekday.hpp:41:3: parsing struct/union/class body 'boost::gregorian::greg_weekday' 5. ./boost/date_time/constrained_value.hpp:42:30: instantiating class definition 'boost::CV::constrained_value<boost::CV::simple_exception_policy<unsigned short, 0, 6, boost::gregorian::bad_weekday>>' 6. ./boost/date_time/constrained_value.hpp:87:30: instantiating class definition 'boost::CV::simple_exception_policy<unsigned short, 0, 6, boost::gregorian::bad_weekday>' 7. ./boost/type_traits/is_base_of.hpp:30:48: instantiating class definition 'boost::is_base_of<std::exception, boost::gregorian::bad_weekday>' 8. ./boost/type_traits/is_base_of.hpp:20:14: instantiating class definition 'boost::detail::is_base_of_imp<std::exception, boost::gregorian::bad_weekday>' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 libLLVM.so.18.1 0x000075ffb9da63bf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 63 1 libLLVM.so.18.1 0x000075ffb9da44f9 llvm::sys::RunSignalHandlers() + 89 2 libLLVM.so.18.1 0x000075ffb9cf0227 3 libc.so.6 0x000075ffb8845320 4 libc.so.6 0x000075ffb88a9bbc 5 libc.so.6 0x000075ffb88abfb1 6 libc.so.6 0x000075ffb88ad7e2 malloc + 418 7 libclang-cpp.so.18.1 0x000075ffc188d6fd 8 libclang-cpp.so.18.1 0x0000555d903443b0 clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation) Ubuntu clang version 18.1.3 (1ubuntu1) Target: x86_64-pc-linux Thread model: posix InstalledDir: /usr/bin clang++: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /tmp/date_time-4c33b0.cpp clang++: note: diagnostic msg: /tmp/date_time-4c33b0.sh clang++: note: diagnostic msg: ******************** "clang++" -fvisibility-inlines-hidden -fPIC -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -m64 --target=x86_64-pc-linux -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_COBALT_USE_STD_PMR=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_SOURCE -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I"." -I"/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src" -I"/usr/include" -c -o "bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o" "/home/username/prj/config/libraries/boost/boost_1_86_0/libs/locale/src/boost/locale/shared/date_time.cpp" ...failed clang-linux.compile.c++ bin.v2/libs/locale/build/clang-linux-18/release/x86_64/threading-multi/visibility-hidden/shared/date_time.o... ``` [files.zip](https://github.com/user-attachments/files/16736706/files.zip)
valiko-ua commented 2 months ago

I've made some more attempts to build it and one attempt succeeded. So this problem is intermittent.

I also see the following errors during configuration:

...

    - cxx11_hdr_thread         : yes [2]
    - cxx11_hdr_regex          : yes [2]
error: No best alternative for /home/username/prj/config/libraries/boost/boost_1_86_0/libs/predef/install with <abi>sysv <address-model>64 <architecture>x86 <asynch-exceptions>off <binary-format>elf <boost.beast.allow-deprecated>on <boost.beast.separate-compilation>on <boost.cobalt.executor>any_io_executor <boost.cobalt.pmr>std <boost.process.fs>boost <context-impl>fcontext <coverage>off <debug-symbols>off <exception-handling>on <extern-c-nothrow>off <inlining>full <known-warnings>hide <link>static <optimization>speed <os>LINUX <pch>on <preserve-test-targets>on <profiling>off <python-debugging>off <python>2.7 <rtti>on <runtime-debugging>off <runtime-link>shared <stdlib>native <strip>off <target-os>linux <testing.execute>on <threadapi>pthread <threading>multi <toolset-clang:platform>linux <toolset-clang:version>18 <toolset>clang <variant>release <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on <x-deduced-platform>x86_64
    matched: (empty)
    matched: (empty)
    - compiler supports SSE2   : yes [4]
    - compiler supports SSE4.1 : yes [4]

...

    - cxx11_hdr_thread         : yes [4]
    - cxx11_hdr_regex          : yes [4]
error: No best alternative for /home/username/prj/config/libraries/boost/boost_1_86_0/libs/predef/install with <abi>sysv <address-model>64 <architecture>x86 <asynch-exceptions>off <binary-format>elf <boost.beast.allow-deprecated>on <boost.beast.separate-compilation>on <boost.cobalt.executor>any_io_executor <boost.cobalt.pmr>std <boost.process.fs>boost <context-impl>fcontext <coverage>off <debug-symbols>off <exception-handling>on <extern-c-nothrow>off <inlining>full <known-warnings>hide <link>shared <optimization>speed <os>LINUX <pch>on <preserve-test-targets>on <profiling>off <python-debugging>off <python>2.7 <rtti>on <runtime-debugging>off <runtime-link>shared <stdlib>native <strip>off <target-os>linux <testing.execute>on <threadapi>pthread <threading>multi <toolset-clang:platform>linux <toolset-clang:version>18 <toolset>clang <variant>release <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on <x-deduced-platform>x86_64
    matched: (empty)
    matched: (empty)

[1] clang-18
[2] clang-linux-18/release/x86_64/link-static/python-2.7/threading-multi/visibility-hidden
[3] clang-linux-18/release/x86_64/build-no/link-static/python-2.7/threading-multi/visibility-hidden
[4] clang-linux-18/release/x86_64/python-2.7/threading-multi/visibility-hidden
[5] clang-linux-18/release/x86_64/build-no/python-2.7/threading-multi/visibility-hidden

...
Endilll commented 2 months ago

I got back to 18.1.3 build in RelWithDebInfo configuration, but your reproducer didn't crash for me after 10 tries.

valiko-ua commented 2 months ago

@Endilll If configuration phase errors that I mentioned in my previous post cannot cause such compiler crash, feel free to close this issue. Maybe it's caused by OS instability (Ubuntu 24.04) or my hardware malfunction.