Summary: | shader-db crashes on 72 core system after ast_type_qualifier bitset change | ||
---|---|---|---|
Product: | Mesa | Reporter: | Kenneth Graunke <kenneth> |
Component: | glsl-compiler | Assignee: | Francisco Jerez <currojerez> |
Status: | RESOLVED FIXED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | Keywords: | bisected, regression |
Version: | git | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Kenneth Graunke
2018-03-14 06:19:33 UTC
Somehow not hugely surprised, the line where the crash occurs is arguably relying on undefined behavior, because it's accessing an inactive union member of potentially both this->flags and valid_in_mask.flags. This was however already UB before my patch -- Funny thing about UB is things may seem to work fine until a harmless-looking change lands that just happens to change the behavior of some compiler versions, inexplicably leading to data corruption. What compiler was used to build mesa? Where exactly did it crash? Can you show me the x86 assembly and register dumps? Why do you think it is a concurrency issue? Aren't the data structures involved single-threaded at this point of the program? Thanks for letting me reproduce this on ogopogo. It seems to be crashing at this instruction: 0x00007ffff41106d9 <+169>: movaps %xmm0,-0x130(%rbp) => 0x00007ffff41106e0 <+176>: pand (%rbx),%xmm0 0x00007ffff41106e4 <+180>: movaps %xmm0,-0x120(%rbp) GCC 5.4 seems to be vectorizing the 128-bit bitmask operation, but the memory address of "this" is not 128-bit aligned (it's 0x7fffe8bff728 during this run), which causes the crash. Probably a GCC bug... I think you're right - GCC shouldn't be doing this. GCC 7.3.0 with -O3 seems to work fine. GCC 5.4 with -O2 seems to work fine. So it looks like a bug with GCC 5.4 and -O3 incorrectly vectorizing things. Closing as NOTOURBUG. I'm posting a patch to work-around this issue. gcc 5.4 is pretty common and this bug could be encountered by a lot of people. For the record, the bug can be repro'd with the Piglit tests/spec/glsl-1.50/execution/varying-struct-basic-gs-fs.shader_test test when Mesa's compiled with -O3. Fixed with 901db25d5b7cd2ac2dd648b370c4bddf23dd5c44 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.