Bug 101834 - WebGL shaders cause system freeze
Summary: WebGL shaders cause system freeze
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: 17.1
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-19 00:58 UTC by grmat
Modified: 2018-04-11 04:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description grmat 2017-07-19 00:58:11 UTC
Hardware:
Radeon R9 290X (Hawaii)

Installed components:
Linux 4.11.9
Libdrm 2.4.81
Mesa 17.1.4

Running Arch Linux, using both radeon and amdgpu drm drivers, Chromium and Firefox the system can freeze when running WebGL shaders. I've experienced this on shadertoy.com before and now have a reproducible example:

https://threejs.org/examples/webgl_gpgpu_protoplanet.html

Sound keeps on playing and I can move the cursor but not interact with the system any more. If I can provide any logs to help, please ask.
Comment 1 Timothy Arceri 2018-04-11 04:34:32 UTC
There has been a series of changes to loop unrolling since this was reported but this in now working and I believe the final fix was likely the following patch as this was still crashing when I tested it before working on this fix. It entirely possible something else fixed it but its working now so closing.

commit 56b867395dee1a48594b27987d3bf68a4e745dda
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date:   Mon Mar 26 10:31:26 2018 +1100

    glsl: fix infinite loop caused by bug in loop unrolling pass
    
    Just checking for 2 jumps is not enough to be sure we can do a
    complex loop unroll. We need to make sure we also have also found
    2 loop terminators.
    
    Without this we were attempting to unroll a loop where the second
    jump was nested inside multiple ifs which loop analysis is unable
    to detect as a terminator. We ended up splicing out the first
    terminator but failed to actually unroll the loop, this resulted
    in the creation of a possible infinite loop.
    
    Fixes: 646621c66da9 "glsl: make loop unrolling more like the nir unrolling path"
    
    Tested-by: Gert Wollny <gw.fossdev@gmail.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105670


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.