Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after trying include boost/geometry.hpp #178434

Open
4 tasks done
FoxLightning opened this issue Jul 25, 2024 · 2 comments
Open
4 tasks done

Crash after trying include boost/geometry.hpp #178434

FoxLightning opened this issue Jul 25, 2024 · 2 comments
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed

Comments

@FoxLightning
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

Error running '/opt/homebrew/opt/llvm/bin/clang-tidy': PLEASE submit a bug report to https://github.com/Homebrew/homebrew-core/issues and include the crash backtrace.
Stack dump:
0.      Program arguments: /opt/homebrew/opt/llvm/bin/clang-tidy -config-file=/Users/bohdanlysychenko/GameOne/.clang-tidy --extra-arg-before=--driver-mode=g++ /Users/bohdanlysychenko/GameOne/src/cpp/GameSystem/AppInstance.cpp -- /Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_CONTAINER_DYN_LINK -DBOOST_CONTAINER_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_RANDOM_DYN_LINK -DBOOST_RANDOM_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DBOOST_THREAD_USE_DLL -I/Users/bohdanlysychenko/GameOne/src/include -I/Users/bohdanlysychenko/GameOne/build/lib/SDL/include -I/Users/bohdanlysychenko/GameOne/lib/SDL/include -I/Users/bohdanlysychenko/GameOne/lib/SDL_image/include -I/Users/bohdanlysychenko/GameOne/lib/SDL_ttf/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/geometry/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/algorithm/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/array/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/assert/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/config/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/core/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/static_assert/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/throw_exception/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/bind/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/concept_check/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/preprocessor/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/type_traits/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/exception/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/smart_ptr/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/move/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/tuple/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/function/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/iterator/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/detail/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/function_types/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/mpl/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/predef/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/utility/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/io/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/fusion/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/container_hash/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/describe/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/mp11/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/typeof/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/functional/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/optional/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/range/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/conversion/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/regex/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/unordered/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/any/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/type_index/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/lexical_cast/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/container/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/intrusive/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/integer/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/math/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/random/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/dynamic_bitset/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/system/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/variant2/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/winapi/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/multiprecision/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/numeric/conversion/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/qvm/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/rational/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/tokenizer/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/variant/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/serialization/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/spirit/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/endian/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/phoenix/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/proto/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/pool/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/thread/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/atomic/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/chrono/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/ratio/include -I/Users/bohdanlysychenko/GameOne/lib/boost/libs/date_time/include -std=gnu++20 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -fPIE -MD -MT src/CMakeFiles/GameOne.dir/cpp/GameSystem/AppInstance.cpp.o -MF CMakeFiles/GameOne.dir/cpp/GameSystem/AppInstance.cpp.o.d -o CMakeFiles/GameOne.dir/cpp/GameSystem/AppInstance.cpp.o -c /Users/bohdanlysychenko/GameOne/src/cpp/GameSystem/AppInstance.cpp
1.      <eof> parser at end of file
2.      ASTMatcher: Processing 'modernize-use-constraints' against:
        FunctionTemplateDecl boost::multiprecision::abs : </Users/bohdanlysychenko/GameOne/lib/boost/libs/multiprecision/include/boost/multiprecision/detail/default_ops.hpp:2337:1, line:2342:1>
--- Bound Nodes Begin ---
    function - { FunctionDecl boost::multiprecision::abs : </Users/bohdanlysychenko/GameOne/lib/boost/libs/multiprecision/include/boost/multiprecision/detail/default_ops.hpp:2338:1, line:2342:1> }
    functionTemplate - { FunctionTemplateDecl boost::multiprecision::abs : </Users/bohdanlysychenko/GameOne/lib/boost/libs/multiprecision/include/boost/multiprecision/detail/default_ops.hpp:2337:1, line:2342:1> }
    return - { DependentNameTypeLoc : </Users/bohdanlysychenko/GameOne/lib/boost/libs/multiprecision/include/boost/multiprecision/detail/default_ops.hpp:2338:33, col:162> }
--- Bound Nodes End ---
 #0 0x000000011cc6dd60 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libLLVM.dylib+0x4695d60)
 #1 0x000000011cc6e134 SignalHandler(int) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libLLVM.dylib+0x4696134)
 #2 0x0000000191777584 (/usr/lib/system/libsystem_platform.dylib+0x180477584)
 #3 0x000000010497f9c0 clang::tidy::modernize::UseConstraintsCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x10053b9c0)
 #4 0x000000010497f9c0 clang::tidy::modernize::UseConstraintsCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x10053b9c0)
 #5 0x0000000104c3dd14 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007f9d14)
 #6 0x0000000104c502dc clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x10080c2dc)
 #7 0x0000000104c3d6dc clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::DynTypedNode const&) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007f96dc)
 #8 0x0000000104c3ef10 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007faf10)
 #9 0x0000000104c40a64 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007fca64)
#10 0x0000000104c40a64 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007fca64)
#11 0x0000000104c428bc clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007fe8bc)
#12 0x0000000104c293f8 clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1007e53f8)
#13 0x000000010d047f74 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x20cbf74)
#14 0x000000010b1870f8 clang::ParseAST(clang::Sema&, bool, bool) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x20b0f8)
#15 0x000000010d018dd4 clang::FrontendAction::Execute() (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x209cdd4)
#16 0x000000010cf9bad4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x201fad4)
#17 0x000000010d12c9e4 clang::tooling::FrontendActionFactory::runInvocation(std::__1::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::__1::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x21b09e4)
#18 0x00000001044508a4 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef)::ActionFactory::runInvocation(std::__1::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::__1::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x10000c8a4)
#19 0x000000010d12c724 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::__1::shared_ptr<clang::CompilerInvocation>, std::__1::shared_ptr<clang::PCHContainerOperations>) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x21b0724)
#20 0x000000010d12b33c clang::tooling::ToolInvocation::run() (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x21af33c)
#21 0x000000010d12e228 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/opt/homebrew/Cellar/llvm/18.1.8/lib/libclang-cpp.dylib+0x21b2228)
#22 0x000000010444b2c4 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x1000072c4)
#23 0x00000001044811b8 clang::tidy::clangTidyMain(int, char const**) (/opt/homebrew/Cellar/llvm/18.1.8/bin/clang-tidy+0x10003d1b8)
#24 0x00000001913be0e0 
Segmentation fault
make[2]: *** [src/CMakeFiles/GameOne.dir/cpp/GameSystem/AppInstance.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/GameOne.dir/all] Error 2
make: *** [all] Error 2

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Structure
image

file(GLOB_RECURSE CPP_FILES *.cpp)
add_executable(${PROJECT_NAME} ${CPP_FILES})

target_include_directories(
    ${PROJECT_NAME} PRIVATE
    ${PROJECT_SOURCE_DIR}/src/include
)

# Third party libs
target_link_libraries(${PROJECT_NAME} PRIVATE
    SDL3::SDL3
    SDL3_image::SDL3_image
    SDL3_ttf::SDL3_ttf
    Boost::geometry
)

if (WIN32)
    target_link_libraries(
        ${PROJECT_NAME} PRIVATE SDL3main
    )
endif()

# Clang-Tidy setup
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")

if(CLANG_TIDY_EXE)
    set(CLANG_TIDY_CONFIG_FILE ${PROJECT_SOURCE_DIR}/.clang-tidy)
    set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-config-file=${CLANG_TIDY_CONFIG_FILE}")
    message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
    message(STATUS "Using clang-tidy configuration: ${CLANG_TIDY_CONFIG_FILE}")
else()
    message(WARNING "clang-tidy not found!")
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY}" )

Homebrew LLVM version 18.1.8
Optimized build.

OS:
ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79

Hardware - MacBook Pro M1 Pro

What happened (include all command output)?

In cmake

What did you expect to happen?

No error when I exclude boost headers.

Step-by-step reproduction instructions (by running brew commands)

just include boost geometry header and run clang-tidy.
@FoxLightning FoxLightning added the bug Reproducible Homebrew/homebrew-core bug label Jul 25, 2024
@Bo98 Bo98 added the upstream issue An upstream issue report is needed label Jul 25, 2024
@Bo98
Copy link
Member

Bo98 commented Jul 25, 2024

Looks to be an upstream bug that will be fixed in LLVM 19: llvm/llvm-project#91872

@FoxLightning
Copy link
Author

Looks to be an upstream bug that will be fixed in LLVM 19: llvm/llvm-project#91872

Thanks, now I'll just use C++ 17 instead of 20, and that helped. I'll try to build clang-tidy from source with the new fix this weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed
Projects
None yet
Development

No branches or pull requests

2 participants