[llvm-bugs] [Bug 24466] New: LLD's idata table is ordered differently from MSVC's, which might affect DLL initialization order

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 14 15:46:12 PDT 2015


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

            Bug ID: 24466
           Summary: LLD's idata table is ordered differently from MSVC's,
                    which might affect DLL initialization order
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Currently I am trying to use ASan on Chromium. I'm debugging a startup crash
that looks like https://llvm.org/bugs/show_bug.cgi?id=24237. I suspect that the
crash is due to a DLL initialization order change, but it might not be.

Here are the dependencies of Chromium url_unittests.exe as ordered by link.exe:

  Image has the following dependencies:

    KERNEL32.dll
    MSVCP120.dll
    MSVCR120.dll
    base.dll
    base_i18n.dll
    clang_rt.asan_dynamic-i386.dll
    icuuc.dll
    url_lib.dll

Here are the dependencies of Chromium url_unittests.exe as ordered by
lld-link.exe:

  Image has the following dependencies:

    icuuc.dll
    url_lib.dll
    KERNEL32.dll
    clang_rt.asan_dynamic-i386.dll
    MSVCR120.dll
    MSVCP120.dll
    base.dll
    base_i18n.dll

It looks like heap interception of MSVCR120.dll is failing, perhaps because
MSVCR120.dll is initializing before ASan gets initialized by one of the other
DLLs.

Even if DLL initialization order is arbitrary, I think we should try to make it
so that LLD binaries have the same order as link.exe to reduce the chance of
breakage.

It's also very possible that I've misdiagnosed this and the order of DLLs in
.idata has nothing to do with initialization order. I mostly wanted to dump my
thoughts in here before I go back to using a static_library Chromium build.

-- 
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/20150814/28ffd0f8/attachment.html>


More information about the llvm-bugs mailing list