[llvm-bugs] [Bug 34051] New: lld-link crashes when handed an empty .res file (empty except for the "this is a 32-bit res file" header)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 3 11:42:56 PDT 2017


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

            Bug ID: 34051
           Summary: lld-link crashes when handed an empty .res file (empty
                    except for the "this is a 32-bit res file" header)
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org

Created attachment 18902
  --> https://bugs.llvm.org/attachment.cgi?id=18902&action=edit
empty.res

thakis at thakis:~/src/chrome/src$ xxd empty.res
00000000: 0000 0000 2000 0000 ffff 0000 ffff 0000  .... ...........
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
thakis at thakis:~/src/chrome/src$
third_party/llvm-build/Release+Asserts/bin/lld-link empty.res
third_party/llvm-build/Release+Asserts/bin/lld-link: warning: /machine is not
specified. x64 is assumed
Program aborted due to an unhandled Error:
Stream Error: The stream is too short to perform the requested operation.
#0 0x0000000001a96c06 _ZL28PrintStackTraceSignalHandlerPv.llvm.74D59CD1
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1a96c06)
#1 0x0000000001a970d6 SignalHandler(int)
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1a970d6)
#2 0x00007f2540ff5330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007f253f87dc37 gsignal
/build/eglibc-SvCtMH/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007f253f881028 abort
/build/eglibc-SvCtMH/eglibc-2.19/stdlib/abort.c:91:0
#5 0x0000000001a4da54 llvm::Error::assertIsChecked()
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1a4da54)
#6 0x0000000003a3c0d1
llvm::object::WindowsResourceParser::parse(llvm::object::WindowsResource*)
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x3a3c0d1)
#7 0x0000000001ade912
lld::coff::convertResToCOFF(std::vector<llvm::MemoryBufferRef,
std::allocator<llvm::MemoryBufferRef> > const&)
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1ade912)
#8 0x0000000001abe1d9 lld::coff::LinkerDriver::link(llvm::ArrayRef<char
const*>) (third_party/llvm-build/Release+Asserts/bin/lld-link+0x1abe1d9)
#9 0x0000000001ab786f lld::coff::link(llvm::ArrayRef<char const*>,
llvm::raw_ostream&)
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1ab786f)
#10 0x0000000001a39d6f main
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1a39d6f)
#11 0x00007f253f868f45 __libc_start_main
/build/eglibc-SvCtMH/eglibc-2.19/csu/libc-start.c:321:0
#12 0x0000000001a1f029 _start
(third_party/llvm-build/Release+Asserts/bin/lld-link+0x1a1f029)
Stack dump:
0.      Program arguments: third_party/llvm-build/Release+Asserts/bin/lld-link
empty.res 
Aborted (core dumped)

-- 
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/20170803/0f27f75e/attachment.html>


More information about the llvm-bugs mailing list