Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
When investigating faulty rendering in GNOME Shell when running under s390x, I eventually discovered that compiling mutter with -O0 made the issue go away.
Eventually I narrowed it down to a function that did a memcpy from a local float array to a stack allocated float array in a callee.
I could also work around it in three ways:
* #pragma GCC optimize ("O0") around the affected function.
* Mark the float array copied from as volatile
* Switch the memcpy to a for loop
With that in mind, I took the relevant code, removed as much as I could while still reproducing. It isn't only the memcpy; e.g. it needs a bit of noise to make it reproduce.
Attaching reproducing C file. When running, if it doesn't reproduce, it exits cleanly. If it reproduces it'll print
1.000000 == 0.000000 failed
Aborted (core dumped)
The three discovered workarounds are included in the C file, hidden behind `#if 0`.
Reproducible: Always