[llvm-bugs] [Bug 52439] New: Assertion failed: (DataLocations.count(&WS) > 0

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 8 10:22:21 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=52439

            Bug ID: 52439
           Summary: Assertion failed: (DataLocations.count(&WS) > 0
           Product: lld
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: wasm
          Assignee: unassignedbugs at nondot.org
          Reporter: dodoentertainment at gmail.com
                CC: llvm-bugs at lists.llvm.org, sbc at chromium.org

Originally detected on the emscripten project while attempting to find more
information about a different bug:
https://github.com/emscripten-core/emscripten/issues/15427#issuecomment-963400640

Basically, when `-flto=thin` is combined with `-fwhole-program-vtables` I get
the following crash in the WebAssembly backend:

|| Assertion failed: (DataLocations.count(&WS) > 0), function writeOneObject,
file
/opt/s/w/ir/cache/builder/emscripten-releases/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp,
line 1794.
|| PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
|| 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.dylib            0x000000010ad4c67b
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
|| 1  libLLVM.dylib            0x000000010ad4b448
llvm::sys::RunSignalHandlers() + 248
|| 2  libLLVM.dylib            0x000000010ad4cce0 SignalHandler(int) + 288
|| 3  libsystem_platform.dylib 0x00007ff807aace2d _sigtramp + 29
|| 4  libsystem_platform.dylib 000000000000000000 _sigtramp +
18446603370452300272
|| 5  libsystem_c.dylib        0x00007ff8079e3d10 abort + 123
|| 6  libsystem_c.dylib        0x00007ff8079e30be err + 0
|| 7  libLLVM.dylib            0x000000010c69070a (anonymous
namespace)::WasmObjectWriter::writeOneObject(llvm::MCAssembler&,
llvm::MCAsmLayout const&, (anonymous namespace)::WasmObjectWriter::DwoMode) +
34842
|| 8  libLLVM.dylib            0x000000010c686e38 (anonymous
namespace)::WasmObjectWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout
const&) + 152
|| 9  libLLVM.dylib            0x000000010c62f36c llvm::MCAssembler::Finish() +
76
|| 10 libLLVM.dylib            0x000000010b73ef33
llvm::AsmPrinter::doFinalization(llvm::Module&) + 5683
|| 11 libLLVM.dylib            0x000000010aed7156
llvm::FPPassManager::doFinalization(llvm::Module&) + 70
|| 12 libLLVM.dylib            0x000000010aecfada
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 4522
|| 13 libLLVM.dylib            0x000000010c5f8a3c codegen(llvm::lto::Config
const&, llvm::TargetMachine*,
std::__2::function<std::__2::unique_ptr<llvm::NativeObjectStream,
std::__2::default_delete<llvm::NativeObjectStream> > (unsigned int)>, unsigned
int, llvm::Module&, llvm::ModuleSummaryIndex const&) + 1292
|| 14 libLLVM.dylib            0x000000010c5f990a
llvm::lto::thinBackend(llvm::lto::Config const&, unsigned int,
std::__2::function<std::__2::unique_ptr<llvm::NativeObjectStream,
std::__2::default_delete<llvm::NativeObjectStream> > (unsigned int)>,
llvm::Module&, llvm::ModuleSummaryIndex const&,
llvm::StringMap<std::__2::unordered_set<unsigned long long,
std::__2::hash<unsigned long long>, std::__2::equal_to<unsigned long long>,
std::__2::allocator<unsigned long long> >, llvm::MallocAllocator> const&,
llvm::DenseMap<unsigned long long, llvm::GlobalValueSummary*,
llvm::DenseMapInfo<unsigned long long>, llvm::detail::DenseMapPair<unsigned
long long, llvm::GlobalValueSummary*> > const&,
llvm::MapVector<llvm::StringRef, llvm::BitcodeModule,
llvm::DenseMap<llvm::StringRef, unsigned int,
llvm::DenseMapInfo<llvm::StringRef>,
llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >,
std::__2::vector<std::__2::pair<llvm::StringRef, llvm::BitcodeModule>,
std::__2::allocator<std::__2::pair<llvm::StringRef, llvm::Bitc
|| 15 libLLVM.dylib            0x000000010c5f978f
llvm::lto::thinBackend(llvm::lto::Config const&, unsigned int,
std::__2::function<std::__2::unique_ptr<llvm::NativeObjectStream,
std::__2::default_delete<llvm::NativeObjectStream> > (unsigned int)>,
llvm::Module&, llvm::ModuleSummaryIndex const&,
llvm::StringMap<std::__2::unordered_set<unsigned long long,
std::__2::hash<unsigned long long>, std::__2::equal_to<unsigned long long>,
std::__2::allocator<unsigned long long> >, llvm::MallocAllocator> const&,
llvm::DenseMap<unsigned long long, llvm::GlobalValueSummary*,
llvm::DenseMapInfo<unsigned long long>, llvm::detail::DenseMapPair<unsigned
long long, llvm::GlobalValueSummary*> > const&,
llvm::MapVector<llvm::StringRef, llvm::BitcodeModule,
llvm::DenseMap<llvm::StringRef, unsigned int,
llvm::DenseMapInfo<llvm::StringRef>,
llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >,
std::__2::vector<std::__2::pair<llvm::StringRef, llvm::BitcodeModule>,
std::__2::allocator<std::__2::pair<llvm::StringRef, llvm::Bitc
|| 16 libLLVM.dylib            0x000000010c5f23a7 (anonymous
namespace)::InProcessThinBackend::runThinLTOBackendThread(std::__2::function<std::__2::unique_ptr<llvm::NativeObjectStream,
std::__2::default_delete<llvm::NativeObjectStream> > (unsigned int)>,
std::__2::function<std::__2::function<std::__2::unique_ptr<llvm::NativeObjectStream,
std::__2::default_delete<llvm::NativeObjectStream> > (unsigned int)> (unsigned
int, llvm::StringRef)>, unsigned int, llvm::BitcodeModule,
llvm::ModuleSummaryIndex&, llvm::StringMap<std::__2::unordered_set<unsigned
long long, std::__2::hash<unsigned long long>, std::__2::equal_to<unsigned long
long>, std::__2::allocator<unsigned long long> >, llvm::MallocAllocator>
const&, llvm::DenseSet<llvm::ValueInfo, llvm::DenseMapInfo<llvm::ValueInfo> >
const&, std::__2::map<unsigned long long, llvm::GlobalValue::LinkageTypes,
std::__2::less<unsigned long long>, std::__2::allocator<std::__2::pair<unsigned
long long const, llvm::GlobalValue::LinkageTypes> > > const&,
llvm::DenseMap<unsigne
|| 17 libLLVM.dylib            0x000000010c5f21e2 void
std::__2::__function::__policy_invoker<void
()>::__call_impl<std::__2::__function::__default_alloc_func<std::__2::__bind<(anonymous
namespace)::InProcessThinBackend::start(unsigned int, llvm::BitcodeModule,
llvm::StringMap<std::__2::unordered_set<unsigned long long,
std::__2::hash<unsigned long long>, std::__2::equal_to<unsigned long long>,
std::__2::allocator<unsigned long long> >, llvm::MallocAllocator> const&,
llvm::DenseSet<llvm::ValueInfo, llvm::DenseMapInfo<llvm::ValueInfo> > const&,
std::__2::map<unsigned long long, llvm::GlobalValue::LinkageTypes,
std::__2::less<unsigned long long>, std::__2::allocator<std::__2::pair<unsigned
long long const, llvm::GlobalValue::LinkageTypes> > > const&,
llvm::MapVector<llvm::StringRef, llvm::BitcodeModule,
llvm::DenseMap<llvm::StringRef, unsigned int,
llvm::DenseMapInfo<llvm::StringRef>,
llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >,
std::__2::vector<std::__2::pair<llvm::StringRef, llvm::BitcodeModul
|| 18 libLLVM.dylib            0x000000010ace95c6 void*
llvm::thread::ThreadProxy<std::__2::tuple<llvm::ThreadPool::ThreadPool(llvm::ThreadPoolStrategy)::$_0>
>(void*) + 662
|| 19 libsystem_pthread.dylib  0x00007ff807a97514 _pthread_start + 125
|| 20 libsystem_pthread.dylib  0x00007ff807a9302f thread_start + 15

At the moment I don't have any open source reproducer, but the problem goes
away if I compile everything without `-fwhole-program-vtables`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211108/076d2f8c/attachment.html>


More information about the llvm-bugs mailing list