[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


http://bugs.llvm.org/show_bug.cgi?id=32651

            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
_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.

-- 
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