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

            Bug ID: 48146
           Summary: exitLld() deallocates MemoryBuffer which may back a
                    section name being concurrently accessed by another
                    thread
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: i...@maskray.me
                CC: llvm-bugs@lists.llvm.org, smithp...@googlemail.com

The issue of low priority as it happens after the error limit is reached
so there is no loss of diagnostics.

When linking one executable, I observe that thread 1 and thread 6 are running
`parallelForEachN` code in `OutputSection::writeTo` (for the output section
`.text`) and are both reporting a relocation out-of-range error.

thread 6 emits an error and calls `exitLld` (since the error limit is reached)
which calls:
```
llvm::sys::Process::Exit(val)
SpecificBumpPtrAllocator<lld::elf::SymbolTable>::~SpecificBumpPtrAllocator
SpecificBumpPtrAllocator<lld::elf::SymbolTable>::DestroyAll
// The MemoryBuffer backing the section name accessed by thread 1 has been
deallocated
```

thread 1 is calling `InputSectionBase::getLocation` and fails because the
section name it is accessing has been deallocated by thread 6.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to