<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 - msan: incorrect origin for 64-bit values"
href="https://bugs.llvm.org/show_bug.cgi?id=37138">37138</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>msan: incorrect origin for 64-bit values
</td>
</tr>
<tr>
<th>Product</th>
<td>compiler-rt
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dvyukov@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>clang version 7.0.0 (trunk 326052)
#include <stdlib.h>
__attribute__((noinline)) void inithalf(void* x)
{
*(int*)x = 0;
}
__attribute__((noinline)) void copyhalf(void* x, void* y)
{
*(int*)x = *(int*)y;
}
__attribute__((noinline)) void copy(long long* x, long long* y)
{
*x = *y;
}
int main() {
long long x, y, z;
copyhalf(&y, &z);
inithalf(&y);
copy(&x, &y);
if (x)
exit(1);
}
==258685==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x499df4 in main /tmp/msan.c:23:6
#1 0x7f00b44cb2b0 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
#2 0x41d639 in _start
(/usr/local/google/home/dvyukov/src/linux2/a.out+0x41d639)
Uninitialized value was stored to memory at
#0 0x499c98 in copy /tmp/msan.c:15:5
Uninitialized value was stored to memory at
#0 0x499c03 in copyhalf /tmp/msan.c:10:11
Uninitialized value was created by an allocation of 'z' in the stack frame of
function 'main'
#0 0x499cd0 in main /tmp/msan.c:18
SUMMARY: MemorySanitizer: use-of-uninitialized-value /tmp/msan.c:23:6 in main
Uninit value comes from 'y'.</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>