[llvm-bugs] [Bug 49903] New: Stack corruption with -fstack-clash-protection + -O2 on ppc64le with clang 12

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 8 16:36:44 PDT 2021


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

            Bug ID: 49903
           Summary: Stack corruption with -fstack-clash-protection + -O2
                    on ppc64le with clang 12
           Product: new-bugs
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24734
  --> https://bugs.llvm.org/attachment.cgi?id=24734&action=edit
Test case

On clang 12 on ppc64le with -O2, -fstack-stack-protection sometimes causes some
of my tests to fail.  I don't really speak PPC assembly so I've pretty much hit
the end of my ability to debug this further, sorry.

I'm attaching two test cases, one is the original (pre-processed), the other
has been run through cvise to try to reduce it, though I'm not sure that it
shows the same issue as the original (it seems to manifest as an infinite loop
instead of a segfault like the original).

Compile with something like:

  clang -O2 -fstack-clash-protection -o test test.c -lm

The corruption doesn't always occur, so you may have to run it a few times. 
For me, the counter in the function which calls the individual tests jumps from
76 to 140736792407376 (between the svml/mm256_cdfnorminv_pd and
svml/mm512_cdfnorminv_ps tests), and eventually there is a segfault.

I haven't been able to reproduce the problem with earlier versions of clang. 
The code works on other architectures.

If there is anything else I can do to help please let me know.  FWIW, I can
provide access to the machine I'm encountering this on, though I only have
clang-12 in an F32 docker container.

-- 
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/20210408/95f987ea/attachment.html>


More information about the llvm-bugs mailing list