[llvm-bugs] [Bug 32651] New: fdr-mode.cc and fdr-thread-order.cc fail in readValueFromFile - stack alignment issue?

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 13 08:12:04 PDT 2017


            Bug ID: 32651
           Summary: fdr-mode.cc and fdr-thread-order.cc fail in
                    readValueFromFile - stack alignment issue?
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: hfinkel at anl.gov
                CC: dberris at google.com, llvm-bugs at lists.llvm.org

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
                                                            Logging before
==39545==XRay FDR init successful.
Init status 2
Segmentation fault

The problem is the following:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004029e3 in readValueFromFile () at
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
(gdb) p BufSize
No symbol "BufSize" in current context.
(gdb) bt
#0  0x00000000004029e3 in readValueFromFile () at
#1  0x000000000040297b in __xray::getTSCFrequency() () at
#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
#4  fdrLoggingHandleArg0 () at
#5  0x0000000000402d81 in __xray_FunctionExit () at

   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.

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/20170413/36a6f7f9/attachment-0001.html>

More information about the llvm-bugs mailing list