<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 - LTO with ASan is causing ODR violation"
href="https://bugs.llvm.org/show_bug.cgi?id=36464">36464</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LTO with ASan is causing ODR violation
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>lto
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>phosek@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When compiling YASM re2c with LTO and ASan, we're seeing an ODR violation:
=================================================================
==8618==ERROR: AddressSanitizer: odr-violation (0x000000218dc0):
[1] size=16 '<string literal>' ../../third_party/yasm/tools/re2c/main.c:150:8
[2] size=16 '<string literal>' ../../third_party/yasm/tools/re2c/code.c:68:12
These globals were registered at these points:
[1]:
#0 0x2614ae in __asan_register_globals
/b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_globals.cc:358:3
#1 0x334289 in asan.module_ctor.84
(/b/s/w/ir/kitchen-workdir/out/release-x86-64/host_x64-asan_no_detect_leaks/re2c+0x334289)
[2]:
#0 0x2614ae in __asan_register_globals
/b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_globals.cc:358:3
#1 0x329869 in asan.module_ctor.2
(/b/s/w/ir/kitchen-workdir/out/release-x86-64/host_x64-asan_no_detect_leaks/re2c+0x329869)
==8618==HINT: if you don't care about these errors you may set
ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global '<string literal>' at
../../third_party/yasm/tools/re2c/main.c:150:8
==8618==ABORTING
According to the error message, this is caused by:
<a href="https://github.com/yasm/yasm/blob/master/tools/re2c/main.c#L150">https://github.com/yasm/yasm/blob/master/tools/re2c/main.c#L150</a>
<a href="https://github.com/yasm/yasm/blob/master/tools/re2c/code.c#L68">https://github.com/yasm/yasm/blob/master/tools/re2c/code.c#L68</a>
However, both of these lines only do `fputs("Out of memory.\n", stderr);` so
this appears to be a compiler error, not a legit ODR violation.</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>