<div dir="ltr"><div dir="ltr"><div>(Ilya and Roman, I'm hoping this is an obvious/dumb question you'll just know the answer to - I'd like shared libs to work well for my laptop when I'm sitting on a train like today, but I have no idea how they work...)</div><div dir="ltr"><br></div><div dir="ltr">With cmake -DBUILD_SHARED_LIBS=On, everything builds ok, but I get crashes in index tests (both lit and unittests, so both binaries affected).<div>I'm using release clang+lld 7 on debian. We have no bots at all for shared libs.<br></div><div><br></div><div>e.g.</div><div>ninja ClangdTests && tools/clang/tools/extra/unittests/clangd/ClangdTests --gtest_filter=BackgroundIndexTest.NoCrashOnErrorFile<div>Segfaults with the first useful frame:</div><div> #5 0x00007fad94321f4c (anonymous namespace)::IndexASTConsumer::Initialize(clang::ASTContext&) /home/sammccall/src/llvm/clang/lib/Index/IndexingAction.cpp:59:33<br></div><div><br></div><div>I've narrowed it down to clang/index/IndexAction.cpp:185: the make_shared<SymbolCollector> call returns nullptr. (I can even print the pointer, it's null!)</div></div><div>Following it in a debugger, shared_ptr just skips over the constructor call.</div><div><br></div><div>I figure it must be a deps issue somehow, but I'm not sure how to work it out. The callsite and SymbolCollector are defined in the same library (clangDaemon). I've tried adding dependencies at random (e.g. adding the whole dependency list of clangDaemon, clangIndex, and ClangdTests to the other targets) but it doesn't make a difference.</div><div><br></div><div>Anyone have ideas?</div></div></div></div>