Open
Description
Assertion failed: (BlockScope.empty() && CurAbbrevs.empty() && "Block imbalance"), function ~BitstreamWriter, file BitstreamWriter.h, line 168.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /Users/sean/llvm/llvm-install/bin/clang-tidy "-extra-arg=-Xanalyzer -analyzer-constraints=z3" -p=. --config-file=./.clang-tidy /Users/sean/MyObjCFile.m
#0 0x000000010514e204 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100506204)
#1 0x000000010514c730 llvm::sys::RunSignalHandlers() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100504730)
#2 0x000000010514e990 SignalHandler(int, __siginfo*, void*) (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100506990)
#3 0x0000000196bef584 (/usr/lib/system/libsystem_platform.dylib+0x18047b584)
#4 0x0000000196bbec20 (/usr/lib/system/libsystem_pthread.dylib+0x18044ac20)
#5 0x0000000196acba30 (/usr/lib/system/libsystem_c.dylib+0x180357a30)
#6 0x0000000196acad20 (/usr/lib/system/libsystem_c.dylib+0x180356d20)
#7 0x0000000107737764 llvm::BitstreamWriter::flushAndClear() (.cold.1) (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x102aef764)
#8 0x0000000106250d58 llvm::BitstreamWriter::flushAndClear() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x101608d58)
#9 0x000000010630a854 std::__1::__shared_ptr_emplace<(anonymous namespace)::SDiagsWriter::SharedState, std::__1::allocator<(anonymous namespace)::SDiagsWriter::SharedState>>::__on_zero_shared() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x1016c2854)
#10 0x000000010630a298 (anonymous namespace)::SDiagsWriter::~SDiagsWriter() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x1016c2298)
#11 0x00000001062540d0 clang::ChainedDiagnosticConsumer::~ChainedDiagnosticConsumer() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x10160c0d0)
#12 0x0000000105801f80 clang::DiagnosticsEngine::~DiagnosticsEngine() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100bb9f80)
#13 0x00000001058b7b8c clang::tooling::ToolInvocation::run() (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100c6fb8c)
#14 0x00000001058ba560 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100c72560)
#15 0x00000001058c483c 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) (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100c7c83c)
#16 0x00000001058ebe50 clang::tidy::clangTidyMain(int, char const**) (/Users/sean/llvm/llvm-install/bin/clang-tidy+0x100ca3e50)
#17 0x0000000196833154
My regular invocation of clang-tidy with:
python3 /Users/sean/llvm/llvm-project/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -config-file ./.clang-tidy -p .
works. Then I added -extra-arg="-Xanalyzer -analyzer-constraints=z3"
(which is maybe not even the right way to accomplish that) and then I get the above asserts, for every file it tries to analyze.
(This is with my own build of clang from git master, at 9b93c9a.)