<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 - LLD can crash if exiting due to errors in writeTo"
   href="https://bugs.llvm.org/show_bug.cgi?id=38647">38647</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD can crash if exiting due to errors in writeTo
          </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>All
          </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>COFF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>martin@martin.st
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If LLD chooses to exit due to errors (either due to a 'fatal', or too many
'error') from within the writeTo methods (which are run in parallel), the
linker can easily crash.

The writeTo methods are run in parallel on many threads. When one of these
threads report errors that lead to the linker exiting, calling the exitLld
function, the exitLld function closes the output buffer, which can cause the
other threads to crash (which still are trying to write output data to the
buffer).

One way of making the error less prone to happen would to change most 'fatal'
into 'error' in Chunks.cpp, but that could still cause the linker to error out
once one has encountered too many errors.</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>