<html>
    <head>
      <base href="http://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 - fdr-mode.cc and fdr-thread-order.cc fail in readValueFromFile - stack alignment issue?"
   href="http://bugs.llvm.org/show_bug.cgi?id=32651">32651</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fdr-mode.cc and fdr-thread-order.cc fail in readValueFromFile - stack alignment issue?
          </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>hfinkel@anl.gov
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dberris@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>XRay-x86_64-linux :: TestCases/Linux/fdr-mode.cc
    XRay-x86_64-linux :: TestCases/Linux/fdr-thread-order.cc

fail on my build system (RHEL 7.2) during a self-host check.

Running the tests manually reveals that they're segfaulting, for example:

$ XRAY_OPTIONS="patch_premain=false xray_naive_log=false
xray_logfile_base=fdr-logging-test- xray_fdr_log=true verbosity=1 xray_fdr
_log_func_duration_threshold_us=0" 
/path/to/projects/compiler-rt/test/xray/X86_64LinuxConfig/TestCases/Linux/Output/fdr-mode.cc.tmp
                                                                               
                                                            Logging before
init.                                                                           
==39545==XRay FDR init successful.
Init status 2
Patching...
Segmentation fault

The problem is the following:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004029e3 in readValueFromFile () at
/src/llvm/projects/compiler-rt/lib/xray/xray_x86_64.cc:43
43        char Line[BufSize] = {};
Missing separate debuginfos, use: debuginfo-install
glibc-2.17-157.el7_3.1.x86_64 libgcc-4.8.5-11.el7.x86_64
libstdc++-4.8.5-11.el7.x86_64
(gdb) p BufSize
No symbol "BufSize" in current context.
(gdb) bt
#0  0x00000000004029e3 in readValueFromFile () at
/src/llvm/projects/compiler-rt/lib/xray/xray_x86_64.cc:43
#1  0x000000000040297b in __xray::getTSCFrequency() () at
/src/llvm/projects/compiler-rt/lib/xray/xray_x86_64.cc:65
#2  0x00000000004066c9 in __xray::__xray_fdr_internal::thresholdTicks() ()
    at /src/llvm/projects/compiler-rt/lib/xray/xray_fdr_logging_impl.h:349
#3  0x0000000000405fcb in processFunctionHook () at
/src/llvm/projects/compiler-rt/lib/xray/xray_fdr_logging_impl.h:618
#4  fdrLoggingHandleArg0 () at
/src/llvm/projects/compiler-rt/lib/xray/xray_fdr_logging.cc:213
#5  0x0000000000402d81 in __xray_FunctionExit () at
/src/llvm/projects/compiler-rt/lib/xray/xray_trampoline_x86_64.S:113

   0x00000000004029d1 <+33>:    cmp    $0xffffffff,%r15d
   0x00000000004029d5 <+37>:    je     0x402aee <readValueFromFile()+318>
   0x00000000004029db <+43>:    lea    0x10(%rsp),%rbx
   0x00000000004029e0 <+48>:    xorps  %xmm0,%xmm0
=> 0x00000000004029e3 <+51>:    movaps %xmm0,0x100(%rsp)

p $rsp
$1 = (void *) 0x7fffffffdfc8

RSP is not 16-byte aligned, but the movaps (which seems to be zeroing the Line
buffer) is assuming that it is.</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>