Created attachment 75878 [details] Fix for spurious aborts during GLSL compile. Asking GLSL to compile a shader should NOT involve the abort of the calling application. PERIOD. It is completely unreasonable to expect that only perfect code will be submitted to glsl_compile() and it is perfectly possible to handle IR validation failure more gracefully. This becomes even more important when the validation is broken and failing on code that does not contain an IR error of any kind. I've attached a patch which makes the use of abort() occur only in debug builds and fixed a crash site where a call through a NULL pointer was being made in parameter_lists_match. I discovered these errors while running SecondLife on Gallium so the crash can be replicated with that driver using the latest version of SL available here: http://download.cloud.secondlife.com/Viewer-3/SecondLife-i686-3.4.5.270263.tar.bz2
(In reply to comment #0) > Created attachment 75878 [details] > Fix for spurious aborts during GLSL compile. > > Asking GLSL to compile a shader should NOT involve the abort of the calling > application. PERIOD. > > It is completely unreasonable to expect that only perfect code will be > submitted to glsl_compile() and it is perfectly possible to handle IR > validation failure more gracefully. That's a little like saying assert shouldn't call abort. That validation pass is a big assertion check. The check isn't that the shader code is valid, the check is that the internal representation is valid after various optimization passes. Just removing the abort will almost always lead to a different kind of crash somewhere else... there's invalid IR, and the backend will probably choke on it. Cases of invalid shader code should be rejected long before ir_validate could ever be called. > This becomes even more important when the validation is broken and failing > on code that does not contain an IR error of any kind. Could you provide an apitrace of a specific failure or provide the code of the shader that triggers the failure? > I've attached a patch which makes the use of abort() occur only in debug > builds and fixed a crash site where a call through a NULL pointer was being > made in parameter_lists_match. I'm especially interested in this crash. Could you provide a backtrace? > I discovered these errors while running SecondLife on Gallium so the crash > can be replicated with that driver using the latest version of SL available > here: > > http://download.cloud.secondlife.com/Viewer-3/SecondLife-i686-3.4.5.270263. > tar.bz2
Created attachment 75938 [details] backtrace and shader code causing ir_validation failure Here's a backtrace of the GLSL compile fail along with what I believe is the code being compiled at the time of the failure.
I just committed a patch to Mesa master which fixed very similar looking crashes: commit 6c5cf8baa10f0bfdf1e61d944f24fdd7947b2a82 Author: Kenneth Graunke <kenneth@whitecape.org> Date: Tue Apr 30 00:58:09 2013 -0700 glsl: Ignore redundant prototypes after a function's been defined. Could you build the latest Mesa master and give it a try? Thanks!
Reported as fixed in #39251. Closing.
I'll give it a try when I get a chance...sounds plausible since the var it was crashing on validating was likely from a "forward decl" as described in the fix.
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.