<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - LLD's idata table is ordered differently from MSVC's, which might affect DLL initialization order"
   href="https://llvm.org/bugs/show_bug.cgi?id=24466">24466</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD's idata table is ordered differently from MSVC's, which might affect DLL initialization order
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently I am trying to use ASan on Chromium. I'm debugging a startup crash
that looks like <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - attempting to call malloc_usable_size() for pointer which is not owned:"
   href="show_bug.cgi?id=24237">https://llvm.org/bugs/show_bug.cgi?id=24237</a>. 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.</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>