[llvm-bugs] [Bug 37584] New: lld-link crash with SafeSEH and -debug:dwarf

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 24 16:22:33 PDT 2018


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

            Bug ID: 37584
           Summary: lld-link crash with SafeSEH and -debug:dwarf
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: smeenai at fb.com
                CC: compnerd at compnerd.org, llvm-bugs at lists.llvm.org,
                    peter at pcc.me.uk, rnk at google.com, ruiu at google.com

% cat reduced.s
.globl _main
_main:
        ret
.safeseh _main

% clang -target i686-windows-msvc -c reduced.s
% lld-link -entry:main -debug:dwarf reduced.o
(segmentation fault)

We're segfaulting when attempting to write the symbol table, at
https://reviews.llvm.org/diffusion/L/browse/lld/trunk/COFF/Writer.cpp;333237$650.
The symbol is the .sxdata section symbol, which has an RVA of 0. Since the RVA
is 0, whereas the first OutputSection has RVA 4096, we'll break out of the loop
above without ever assigning to Sec, so that'll remain nullptr, hence the
segfault.

This was broken by https://reviews.llvm.org/D42592. I think the reason that
diff broke it is that, prior to it, we would discard .sxdata sections from
input files early
(https://reviews.llvm.org/diffusion/L/browse/lld/trunk/COFF/InputFiles.cpp;324305$154-162),
so we never had the chance to reach the problematic path in the writer.

I'm thinking the .sxdata section symbol having an RVA of 0 is incorrect.
Thoughts on why that might be happening?

-- 
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/20180524/0f50f60e/attachment.html>


More information about the llvm-bugs mailing list