<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assertion failed: (DataLocations.count(&WS) > 0"
   href="https://bugs.llvm.org/show_bug.cgi?id=52439">52439</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: (DataLocations.count(&WS) > 0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>wasm
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dodoentertainment@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, sbc@chromium.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Originally detected on the emscripten project while attempting to find more
information about a different bug:
<a href="https://github.com/emscripten-core/emscripten/issues/15427#issuecomment-963400640">https://github.com/emscripten-core/emscripten/issues/15427#issuecomment-963400640</a>

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 <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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>
<span class="quote">>(void*) + 662</span >
|| 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`.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>