[llvm-bugs] [Bug 36464] New: LTO with ASan is causing ODR violation

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 20 20:34:09 PST 2018


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

            Bug ID: 36464
           Summary: LTO with ASan is causing ODR violation
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: lto
          Assignee: unassignedbugs at nondot.org
          Reporter: phosek at chromium.org
                CC: llvm-bugs at lists.llvm.org

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:
https://github.com/yasm/yasm/blob/master/tools/re2c/main.c#L150
https://github.com/yasm/yasm/blob/master/tools/re2c/code.c#L68

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.

-- 
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/20180221/0a6f9805/attachment.html>


More information about the llvm-bugs mailing list