Skip to content

Stack corruption with -fstack-clash-protection + -O2 on ppc64le with clang 12 #49247

@llvmbot

Description

@llvmbot
Bugzilla Link 49903
Resolution FIXED
Resolved on Jun 14, 2021 23:01
Version trunk
OS Linux
Blocks #48661
Attachments Test case
Reporter LLVM Bugzilla Contributor
CC @bzEq,@serge-sans-paille,@tstellar
Fixed by commit(s) c87c294 bf58600 a37dff2 04a6828

Extended Description

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.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions