sourcegraph / scip-clang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on unconsumed symbol on indexing scip-clang itself

varungandhi-src opened this issue · comments

As of cfc13b1, we run into a bug with the following compilation database:

[
  {
    "command": "external/llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE --target=aarch64-apple-macosx -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -std=c++17 -stdlib=libc++ -std=c++20 -Wall -Wextra -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wsuggest-override -Wstring-concatenation -Wstring-conversion -Wmisleading-indentation --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fdebug-prefix-map=external/llvm_toolchain_llvm/=__bazel_toolchain_llvm_repo__/ -D\"SPDLOG_COMPILED_LIB\" -D\"BOOST_NO_CXX98_FUNCTION_BASE\" -D\"BOOST_ASIO_SEPARATE_COMPILATION\" -D\"BOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW\" -D\"BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF\" -D\"RAPIDJSON_HAS_STDSTRING\" -D\"RAPIDJSON_HAS_CXX11_RANGE_FOR\" -D\"RAPIDJSON_HAS_CXX11_RVALUE_REFS\" -D\"RAPIDJSON_HAS_CXX11_TYPETRAITS\" -D\"RAPIDJSON_ASSERT(x)=ENFORCE(x)\" -D\"LLVM_ON_UNIX=1\" -D\"HAVE_BACKTRACE=1\" -D\"BACKTRACE_HEADER=<execinfo.h>\" -D\"LTDL_SHLIB_EXT=\".so\"\" -D\"LLVM_PLUGIN_EXT=\".so\"\" -D\"LLVM_ENABLE_THREADS=1\" -D\"HAVE_DEREGISTER_FRAME=1\" -D\"HAVE_LIBPTHREAD=1\" -D\"HAVE_PTHREAD_GETNAME_NP=1\" -D\"HAVE_PTHREAD_H=1\" -D\"HAVE_PTHREAD_SETNAME_NP=1\" -D\"HAVE_REGISTER_FRAME=1\" -D\"HAVE_SETENV_R=1\" -D\"HAVE_STRERROR_R=1\" -D\"HAVE_SYSEXITS_H=1\" -D\"HAVE_UNISTD_H=1\" -D\"HAVE_MACH_MACH_H=1\" -D\"HAVE_MALLOC_MALLOC_H=1\" -D\"HAVE_MALLOC_ZONE_STATISTICS=1\" -D\"HAVE_PROC_PID_RUSAGE=1\" -D\"HAVE_UNW_ADD_DYNAMIC_FDE=1\" -D\"LLVM_NATIVE_ARCH=\"AArch64\"\" -D\"LLVM_NATIVE_ASMPARSER=LLVMInitializeAArch64AsmParser\" -D\"LLVM_NATIVE_ASMPRINTER=LLVMInitializeAArch64AsmPrinter\" -D\"LLVM_NATIVE_DISASSEMBLER=LLVMInitializeAArch64Disassembler\" -D\"LLVM_NATIVE_TARGET=LLVMInitializeAArch64Target\" -D\"LLVM_NATIVE_TARGETINFO=LLVMInitializeAArch64TargetInfo\" -D\"LLVM_NATIVE_TARGETMC=LLVMInitializeAArch64TargetMC\" -D\"LLVM_NATIVE_TARGETMCA=LLVMInitializeAArch64TargetMCA\" -D\"LLVM_HOST_TRIPLE=\"arm64-apple-darwin\"\" -D\"LLVM_DEFAULT_TARGET_TRIPLE=\"arm64-apple-darwin\"\" -D\"LLVM_VERSION_MAJOR=17\" -D\"LLVM_VERSION_MINOR=0\" -D\"LLVM_VERSION_PATCH=0\" -D\"LLVM_VERSION_STRING=\"17.0.0git\"\" -D\"__STDC_LIMIT_MACROS\" -D\"__STDC_CONSTANT_MACROS\" -D\"__STDC_FORMAT_MACROS\" -D\"LLVM_ENABLE_ZLIB=1\" -D\"BLAKE3_NO_AVX2\" -D\"BLAKE3_NO_AVX512\" -D\"BLAKE3_NO_SSE2\" -D\"BLAKE3_NO_SSE41\" -D\"BAZEL_CURRENT_REPOSITORY=\"\"\" -isystem external/spdlog/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/spdlog/include -isystem external/com_google_protobuf/src -isystem bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/src -isystem external/zlib/zlib/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/zlib/zlib/include -isystem external/boost -isystem bazel-out/darwin_arm64-fastbuild/bin/external/boost -isystem external/boost/libs/math/include_private -isystem bazel-out/darwin_arm64-fastbuild/bin/external/boost/libs/math/include_private -isystem external/cxxopts/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/cxxopts/include -isystem external/rapidjson/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/rapidjson/include -isystem external/wyhash/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/wyhash/include -isystem external/llvm-project/llvm/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/include -isystem external/llvm-project/clang/include -isystem bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include -isystem external/llvm-project/llvm/lib/Target/AArch64 -isystem bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/lib/Target/AArch64 -isystem external/llvm-project/llvm/lib/Target/X86 -isystem bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/lib/Target/X86 -isystem external/llvm-project/clang/lib/Driver -isystem bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/lib/Driver -I bazel-out/darwin_arm64-fastbuild/bin/external/com_google_perfetto/_virtual_includes/perfetto -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm_zstd/_virtual_includes/zstd -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/_virtual_includes/basic_internal_headers -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/InstCombineTableGen -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/_virtual_includes/libsema_openclbuiltins_inc_gen -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/AArch64CodeGen -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/AArch64CommonTableGen -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/AArch64Info -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/AArch64UtilsAndDesc -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/X86CodeGen -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/X86CommonTableGen -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/X86Info -I bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/_virtual_includes/X86UtilsAndDesc -I bazel-out/darwin_arm64-fastbuild/bin/external/scip/_virtual_includes/scip -iquote . -iquote bazel-out/darwin_arm64-fastbuild/bin -iquote external/com_google_absl -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_google_absl -iquote external/spdlog -iquote bazel-out/darwin_arm64-fastbuild/bin/external/spdlog -iquote external/com_google_protobuf -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/darwin_arm64-fastbuild/bin/external/zlib -iquote external/com_google_perfetto -iquote bazel-out/darwin_arm64-fastbuild/bin/external/com_google_perfetto -iquote external/boost -iquote bazel-out/darwin_arm64-fastbuild/bin/external/boost -iquote external/cxxopts -iquote bazel-out/darwin_arm64-fastbuild/bin/external/cxxopts -iquote external/rapidjson -iquote bazel-out/darwin_arm64-fastbuild/bin/external/rapidjson -iquote external/wyhash -iquote bazel-out/darwin_arm64-fastbuild/bin/external/wyhash -iquote external/llvm-project -iquote bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project -iquote external/llvm_terminfo -iquote bazel-out/darwin_arm64-fastbuild/bin/external/llvm_terminfo -iquote external/llvm_zlib -iquote bazel-out/darwin_arm64-fastbuild/bin/external/llvm_zlib -iquote external/llvm_zstd -iquote bazel-out/darwin_arm64-fastbuild/bin/external/llvm_zstd -iquote external/scip -iquote bazel-out/darwin_arm64-fastbuild/bin/external/scip -x c++ -c indexer/ApproximateNameResolver.cc",
    "directory": "/private/var/tmp/_bazel_varun/556335f3782e99575c0c742955be4ea7/execroot/scip_clang",
    "file": "indexer/ApproximateNameResolver.cc"
  }
]
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include/clang/Basic/AttrList.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include/clang/AST/TypeNodes.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include/clang/AST/DeclNodes.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include/clang/AST/CommentCommandList.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMP.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include/clang/AST/StmtNodes.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.inc' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 warning] driver    : found path '/Users/varun/Code/scip-clang/bazel-out/darwin_arm64-fastbuild/bin/external/llvm-project/llvm/include/llvm/Config/abi-breaking.h' with no recorded hashes; this is likely a scip-clang bug
[10:57:20 info] driver    : previously unseen headers were encountered when processing the compilation commands at indexes [0] in the compilation database
[10:57:20 info] driver    : it may be possible to reproduce this issue by subsetting the compilation database using `jq '[.[0]]` /Users/varun/Code/scip-clang/min3.json > bad.json` and re-running `scip-clang --compdb-path=bad.json <flags...>`
[10:57:20 error] driver    : unconsumed message: SymbolInformationBuilder for 'cxx . . . $clang/SourceManager#'
[10:57:20 error] driver    : Exception::raise(): ./indexer/RAII.h:37 enforced condition this->consumed has failed: forgot to call getValueAndConsume

Not fully fixed yet...