[PATCH] D104353: [lld-macho] Avoid force-loading the same archive twice

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 18 18:22:45 PDT 2021


thakis added inline comments.


================
Comment at: lld/MachO/Driver.cpp:268
         for (const ArchiveMember &member : getArchiveMembers(*buffer)) {
           if (Optional<InputFile *> file = loadArchiveMember(
                   member.mbref, member.modTime, path, /*objCOnly=*/false)) {
----------------
thakis wrote:
> thakis wrote:
> > I don't know if that's what's happening, but if loadArchiveMember() loads a .o file that contains LC_LINKER_OPTIONS that has a -l flag that can recursively call addFile() again which can resize loadedArchives and invalidate the cachedFile ref.
> Reverted in c9b241efd68c for now to green up bots. This sounds like a plausible theory to me.
> Reverted in c9b241efd68c for now to green up bots. This sounds like a plausible theory to me.

Not sure why it's only on that bot, but the test failed 3 times in succession:

https://ci.chromium.org/ui/p/chromium/builders/try/win_upload_clang/1608/overview
https://ci.chromium.org/ui/p/chromium/builders/try/win_upload_clang/1609/overview
https://ci.chromium.org/ui/p/chromium/builders/try/win_upload_clang/1610/overview

But after the revert this test is happy:

https://ci.chromium.org/ui/p/chromium/builders/try/win_upload_clang/1611/overview

So it looks like the revert helped.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104353/new/

https://reviews.llvm.org/D104353



More information about the llvm-commits mailing list