<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 - ASAN lit test fails when linked with LLD on PowerPC64 and run with ASLR enabled."
href="https://bugs.llvm.org/show_bug.cgi?id=45076">45076</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ASAN lit test fails when linked with LLD on PowerPC64 and run with ASLR enabled.
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</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>sfertile@ca.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
</td>
</tr></table>
<p>
<div>
<pre>compiler-rt/test/asan/TestCases/Posix/no-fd.cpp fails when run with ASLR
enabled, but only when linked with LLD. Linking with ld.bfd and ld.gold the
test succeeds.
The relevant difference between the 2 binaries is that the got entry for the
symbol `__libc_stack_end` is always 0 when linked with LLD, while bfd and gold
emit a R_PPC64_ADDR64 dynamic relocation.
The reason for the failure is a culmination of several things:
* When an ASAN instrumented binary is invoked with ASLR enabled on PPC64 ELF V2
the sanitizer runtime will attempt to disable ASLR and rexec with a call to
'ReExec()'.
* When "__libc_stack_end' is undefined, the sanitizer runtime gets the
environment and args for re-execing by trying to open and parse
`/proc/self/cmdline` and `/proc/self/environ`.
*The lit tests uses an option to mimicking opening files failing
"test_only_emulate_no_memorymap=1" which means we fail to open and parse the
previously mentioned files leading to an invalid call to execve -->
execve("./bad_lld.out", [], [/* 0 vars */]) = 0</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>