<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: AddressSanitizer-*-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc fails on Gentoo stand-alone build"
   href="https://bugs.llvm.org/show_bug.cgi?id=36025">36025</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>asan: AddressSanitizer-*-linux-dynamic :: TestCases/Linux/asan_rt_confict_test-1.cc fails on Gentoo stand-alone build
          </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>normal
          </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>mgorny@gentoo.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>35804
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19715" name="attach_19715" title="sys-libs:compiler-rt-sanitizers-6.0.9999:20180120-132820.log.xz">attachment 19715</a> <a href="attachment.cgi?id=19715&action=edit" title="sys-libs:compiler-rt-sanitizers-6.0.9999:20180120-132820.log.xz">[details]</a></span>
sys-libs:compiler-rt-sanitizers-6.0.9999:20180120-132820.log.xz

When testing the 6.0 branch for Gentoo, I have two new ASAN test failures:

    AddressSanitizer-i386-linux-dynamic ::
TestCases/Linux/asan_rt_confict_test-1.cc
    AddressSanitizer-x86_64-linux-dynamic ::
TestCases/Linux/asan_rt_confict_test-1.cc

In both cases, the test executable segfaults without outputting anything.
Curious enough, I can't reproduce this when building compiler-rt in-tree with
other LLVM components.

I've attempted running the working in-tree executable with LD_LIBRARY_PATH
pointing to libasan built stand-alone, and it segfaulted like the stand-alone
build -- therefore, I suspect the problem lies in libasan itself and not the
test.

I'd appreciate any suggestions how to debug this further. I'm attaching the
build log for compiler-rt sanitizers.


FAIL: AddressSanitizer-i386-linux-dynamic ::
TestCases/Linux/asan_rt_confict_test-1.cc (1354 of 4782)
******************** TEST 'AddressSanitizer-i386-linux-dynamic ::
TestCases/Linux/asan_rt_confict_test-1.cc' FAILED ********************
Script:
--
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/lib/llvm/6/bin/clang
 --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer
-fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m32 
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
-o
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/I386LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
env LD_PRELOAD=libclang_rt.asan-i386.so not 
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/I386LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
2>&1 | FileCheck
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
--
Exit Code: 1

Command Output (stderr):
--
+
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/lib/llvm/6/bin/clang
--driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer
-fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m32
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
-o
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/I386LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
+ FileCheck
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
+ env LD_PRELOAD=libclang_rt.asan-i386.so not
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/I386LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc:13:11:
error: expected string not found in input
// CHECK: Your application is linked against incompatible ASan runtimes
          ^
<stdin>:1:1: note: scanning from here
ERROR: ld.so: object 'libclang_rt.asan-i386.so' from LD_PRELOAD cannot be
preloaded (wrong ELF class: ELFCLASS32): ignored.
^
<stdin>:2:1: note: possible intended match here
Error: Segmentation fault
^

--

********************

FAIL: AddressSanitizer-x86_64-linux-dynamic ::
TestCases/Linux/asan_rt_confict_test-1.cc (2197 of 4782)
******************** TEST 'AddressSanitizer-x86_64-linux-dynamic ::
TestCases/Linux/asan_rt_confict_test-1.cc' FAILED ********************
Script:
--
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/lib/llvm/6/bin/clang
 --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer
-fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64 
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
-o
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
env LD_PRELOAD=libclang_rt.asan-x86_64.so not 
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
2>&1 | FileCheck
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
--
Exit Code: 1

Command Output (stderr):
--
+
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/lib/llvm/6/bin/clang
--driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer
-fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
-o
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
+ FileCheck
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc
+ env LD_PRELOAD=libclang_rt.asan-x86_64.so not
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999_build/test/asan/X86_64LinuxDynamicConfig/TestCases/Linux/Output/asan_rt_confict_test-1.cc.tmp
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-6.0.9999/work/compiler-rt-sanitizers-6.0.9999/test/asan/TestCases/Linux/asan_rt_confict_test-1.cc:13:11:
error: expected string not found in input
// CHECK: Your application is linked against incompatible ASan runtimes
          ^
<stdin>:1:1: note: scanning from here
Error: Segmentation fault
^

--

********************</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [meta] 6.0.0 Release Blockers"
   href="https://bugs.llvm.org/show_bug.cgi?id=35804">Bug 35804</a>] [meta] 6.0.0 Release Blockers
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>