[llvm-bugs] [Bug 38647] New: LLD can crash if exiting due to errors in writeTo

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 20 12:41:11 PDT 2018


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

            Bug ID: 38647
           Summary: LLD can crash if exiting due to errors in writeTo
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: martin at martin.st
                CC: llvm-bugs at lists.llvm.org

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.

-- 
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/20180820/702516d7/attachment.html>


More information about the llvm-bugs mailing list