<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - segfault with empty dynamic list"
href="https://bugs.llvm.org/show_bug.cgi?id=46184">46184</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>segfault with empty dynamic list
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>ELF
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>edd-llvm@mr-edd.co.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
</td>
</tr></table>
<p>
<div>
<pre>This reproducible works as of
<a href="https://github.com/llvm/llvm-project/commit/579d6ed48cf9a893a21bfb20418b659d183a51a1">https://github.com/llvm/llvm-project/commit/579d6ed48cf9a893a21bfb20418b659d183a51a1</a>
I'm configuring with:
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=lld
-DLLVM_TARGETS_TO_BUILD=X86 ../llvm
The segfault is then provoked with:
dev:~$ ./bin/ld.lld --dynamic-list <( echo '' )
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0. Program arguments: ./bin/ld.lld --dynamic-list /dev/fd/63
#0 0x00000651116be06a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(./bin/ld.lld+0x57006a)
#1 0x00000651116bbe14 llvm::sys::RunSignalHandlers() (./bin/ld.lld+0x56de14)
#2 0x00000651116bbf63 SignalHandler(int) (./bin/ld.lld+0x56df63)
#3 0x00006ecca246d890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#4 0x0000065111973353 lld::elf::ScriptLexer::getCurrentMB()
(./bin/ld.lld+0x825353)
#5 0x00000651119735a7 lld::elf::ScriptLexer::getCurrentLocation[abi:cxx11]()
(./bin/ld.lld+0x8255a7)
#6 0x000006511197387d lld::elf::ScriptLexer::setError(llvm::Twine const&)
(.part.63) (./bin/ld.lld+0x82587d)
#7 0x00000651119748e0 lld::elf::ScriptLexer::next() (./bin/ld.lld+0x8268e0)
#8 0x0000065111974b88 lld::elf::ScriptLexer::expect(llvm::StringRef)
(./bin/ld.lld+0x826b88)
#9 0x0000065111855cd3 lld::elf::readDynamicList(llvm::MemoryBufferRef)
(./bin/ld.lld+0x707cd3)
#10 0x00000651117a4221 readConfigs(llvm::opt::InputArgList&)
(./bin/ld.lld+0x656221)
#11 0x00000651115f48b3 lld::elf::LinkerDriver::main(llvm::ArrayRef<char
const*>) (./bin/ld.lld+0x4a68b3)
#12 0x00000651117af419 lld::elf::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&, llvm::raw_ostream&) (./bin/ld.lld+0x661419)
#13 0x00000651115f21c0 main (./bin/ld.lld+0x4a41c0)
#14 0x00006ecca1548b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#15 0x000006511166021a _start (./bin/ld.lld+0x51221a)
Segmentation fault</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>