Bug 100871 - gles cts hangs mesa indefinitely
Summary: gles cts hangs mesa indefinitely
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: highest blocker
Assignee: Samuel Pitoiset
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-28 17:57 UTC by Mark Janes
Modified: 2017-04-30 21:55 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
incomplete patch (1.41 KB, patch)
2017-04-29 01:33 UTC, Matt Turner
Details | Splinter Review

Description Mark Janes 2017-04-28 17:57:09 UTC
Bisected to:
75a31a20af269c047661af33e28f793269537b79
Author:     Samuel Pitoiset <samuel.pitoiset@gmail.com>

glsl: set vector_elements to 1 for samplers

I don't see any reasons why vector_elements is 1 for images and
0 for samplers. This increases consistency and allows to clean
up some code a bit.

This will also help for ARB_bindless_texture.

No piglit regressions with RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>


---------------------------------------------------------

 With this commit, a wide range of intel hardware began hanging during
 the GLES CTS, with dmesg errors like:

 [25488.739167] traps: glcts[15106] general protection ip:7fdac6484ba5 sp:7ffdcda85a20 error:0

 Machines that did complete the cts, reported hundreds of errors like:

 *** Error in `/tmp/build_root/m64/bin/es/cts/glcts': malloc(): memory
     corruption: 0x0000562c7503b270 ***


There hasn't been a patch this broken pushed to mesa in the past 2 years.
Comment 1 Mark Janes 2017-04-28 18:33:52 UTC
also, over 1000 piglit tests fail, eg:
piglit.spec.arb_gpu_shader5.execution.sampler_array_indexing.gs-nonzero-base
piglit.spec.arb_gpu_shader5.texturegather.vs-r-0-float-2drect
piglit.spec.arb_gpu_shader5.texturegather.vs-rg-1-float-cube
piglit.spec.arb_gpu_shader5.texturegather.vs-rg-1-unorm-2darray
piglit.spec.arb_gpu_shader5.texturegather.vs-rgb-0-uint-2d
piglit.spec.arb_gpu_shader5.texturegather.vs-rgb-1-unorm-2d
piglit.spec.arb_gpu_shader5.texturegather.vs-rgba-0-int-2darray
piglit.spec.arb_gpu_shader5.texturegather.vs-rgba-0-int-2drect
piglit.spec.arb_gpu_shader5.texturegather.vs-rgba-0-unorm-cubearray
piglit.spec.arb_gpu_shader5.texturegather.vs-rgba-2-uint-2drect
piglit.spec.arb_gpu_shader5.texturegather.vs-rgba-3-unorm-2d
piglit.spec.arb_gpu_shader5.texturegatheroffset.vs-r-0-float-2darray-const
piglit.spec.arb_gpu_shader5.texturegatheroffset.vs-rg-1-uint-2d-const
piglit.spec.arb_gpu_shader5.texturegatheroffset.vs-rgba-0-int-2darray-const
piglit.spec.arb_gpu_shader5.texturegatheroffset.vs-rgba-1-unorm-2d-const
piglit.spec.arb_gpu_shader5.texturegatheroffset.vs-rgba-2-unorm-2darray-const
piglit.spec.arb_gpu_shader5.texturegatheroffsets.vs-rg-0-float-2darray
piglit.spec.arb_gpu_shader5.texturegatheroffsets.vs-rgb-1-float-2darray
piglit.spec.arb_gpu_shader5.texturegatheroffsets.vs-rgba-0-int-2d
piglit.spec.arb_gpu_shader5.texturegatheroffsets.vs-rgba-0-int-2darray
piglit.spec.arb_gpu_shader5.texturegatheroffsets.vs-rgba-2-float-2darray
piglit.spec.arb_shader_texture_image_samples.texturesamples.gs-usampler2dmsarray-8
piglit.spec.arb_texture_gather.texturegather.vs-r-none-unorm-2darray
piglit.spec.arb_texture_gather.texturegather.vs-r-zero-uint-2d
piglit.spec.arb_texture_gather.texturegather.vs-r-zero-uint-cubearray
piglit.spec.arb_texture_gather.texturegather.vs-rg-green-float-cubearray
piglit.spec.arb_texture_gather.texturegather.vs-rg-zero-uint-cube
piglit.spec.arb_texture_gather.texturegather.vs-rgb-blue-float-2darray
piglit.spec.arb_texture_gather.texturegather.vs-rgb-blue-uint-cube
piglit.spec.arb_texture_gather.texturegather.vs-rgb-blue-unorm-2darray
piglit.spec.arb_texture_gather.texturegather.vs-rgb-blue-unorm-cube
piglit.spec.arb_texture_gather.texturegather.vs-rgb-green-unorm-cube
piglit.spec.arb_texture_gather.texturegather.vs-rgb-none-int-cube
piglit.spec.arb_texture_gather.texturegather.vs-rgb-red-float-2d
piglit.spec.arb_texture_gather.texturegather.vs-rgba-zero-unorm-cube
piglit.spec.arb_texture_gather.texturegather.vs-rgba-zero-unorm-cubearray
piglit.spec.arb_texture_gather.texturegatheroffset.vs-r-zero-int-2d
piglit.spec.arb_texture_gather.texturegatheroffset.vs-rg-one-float-2d
piglit.spec.arb_texture_gather.texturegatheroffset.vs-rg-one-float-2darray
piglit.spec.arb_texture_gather.texturegatheroffset.vs-rgb-green-float-2darray
piglit.spec.arb_texture_gather.texturegatheroffset.vs-rgba-alpha-uint-2darray
piglit.spec.arb_texture_gather.texturegatheroffset.vs-rgba-green-uint-2d
piglit.spec.arb_texture_multisample.texelfetch.6-vs-sampler2dmsarray
piglit.spec.arb_texture_multisample.texturesize.gs-texturesize-isampler2dmsarray
piglit.spec.glsl-1_30.execution.texelfetch.vs-texelfetch-isampler1darray
piglit.spec.glsl-1_30.execution.texelfetch.vs-texelfetch-isampler2darray-swizzle
piglit.spec.glsl-1_30.execution.texelfetchoffset.vs-texelfetch-isampler2d
piglit.spec.glsl-1_30.execution.texturesize.vs-texturesize-usampler2d
piglit.spec.glsl-1_50.execution.texelfetch.gs-texelfetch-isampler3d
piglit.spec.glsl-1_50.execution.texturesize.gs-texturesize-sampler1dshadow
piglit.spec.glsl-1_50.execution.texturesize.gs-texturesize-sampler2d



/tmp/build_root/m64/lib/piglit/bin/textureGather vs  rgb blue unorm 2DArray -auto -fbo
piglit: debug: Requested an OpenGL 3.1 Forward-Compatible Core Context, and received a matching 4.5 context

Standard Error

*** Error in `/tmp/build_root/m64/lib/piglit/bin/textureGather': malloc(): memory corruption: 0x000055be72bde0a0 ***
Comment 2 Matt Turner 2017-04-29 01:33:28 UTC
Created attachment 131146 [details] [review]
incomplete patch

I hoped this patch would be enough, but it is not. I still get failures in 

src/mesa/drivers/dri/i965/gen6_constant_state.c:152:

      for (i = 0; i < prog_data->nr_params; i++) {
         param[i] = *prog_data->param[i];
      }
Comment 3 Timothy Arceri 2017-04-29 10:22:42 UTC
(In reply to Matt Turner from comment #2)
> Created attachment 131146 [details] [review] [review]
> incomplete patch
> 
> I hoped this patch would be enough, but it is not. I still get failures in 
> 
> src/mesa/drivers/dri/i965/gen6_constant_state.c:152:
> 
>       for (i = 0; i < prog_data->nr_params; i++) {
>          param[i] = *prog_data->param[i];
>       }

Are you able to provide an example of a test that is hitting this?
Comment 4 Timothy Arceri 2017-04-30 02:18:34 UTC
(In reply to Matt Turner from comment #2)
> Created attachment 131146 [details] [review] [review]
> incomplete patch
> 
> I hoped this patch would be enough, but it is not. I still get failures in 
> 
> src/mesa/drivers/dri/i965/gen6_constant_state.c:152:
> 
>       for (i = 0; i < prog_data->nr_params; i++) {
>          param[i] = *prog_data->param[i];
>       }

Hi Matt,

The problem with the patch is that it is skipping uniforms all members of a uniform struct if it the struct contains a sampler. I'm running a slightly different patch in jenkins and will send it out shortly if everything comes out ok.
Comment 5 Timothy Arceri 2017-04-30 06:58:14 UTC
Fix sent to the list, I liked Matts commit message so I reused it :)

https://patchwork.freedesktop.org/patch/153798/
Comment 6 Timothy Arceri 2017-04-30 21:55:53 UTC
Should be fixed by:

commit de8e01698fb745e6f91c22470393777093c2c2ee
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date:   Sun Apr 30 12:12:35 2017 +1000

    i965: Don't allocate uniform space for samplers
    
    Samplers are encoded into the instruction word, so there's no need to
    make space in the uniform file.
    
    Previously matrix_columns and vector_elements were set to 0, making this
    else case a no-op. Commit 75a31a20af26 changed that, causing malloc
    corruption in thousands of tests on i965.
    
    Fixes: 75a31a20af26 ("glsl: set vector_elements to 1 for samplers")
    
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100871


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.