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: unassignedb...@nondot.org
          Reporter: mar...@martin.st
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to