<div dir="ltr">Hello,<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yep, it seems valgrind outputs bunch of invalid reads and writes with <br>this test.</blockquote><div>Seems any test with valgrind generates invalid reads and writes... Probably it depends on macros-usage: probably they are not properly handled by valgrind</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It just seems a bit strange to first calculate a 'maximum' <br>miplevel but then use even bigger value in the test :)</blockquote><div>I would say that max level is calculated properly, but in test also used 0-level, which seems included as +1 to max_miplevel</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Alternatively I guess one could change those loops to not exceed max <br>level, use < operator instead of <= (?)</blockquote><div>If no more any objections - will update to '<'</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 15, 2019 at 3:07 PM Tapani Pälli <<a href="mailto:tapani.palli@intel.com">tapani.palli@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On 1/14/19 12:51 PM, Sergii Romantsov wrote:<br>
> Usage test 'depthstencil-render-miplevels 200 s=z24_s8' causes<br>
> core dump on exit.<br>
> Fixed: array of pointers is allocated to size max_miplevel, but<br>
> used as max_miplevel + 1.<br>
<br>
Yep, it seems valgrind outputs bunch of invalid reads and writes with <br>
this test.<br>
<br>
Alternatively I guess one could change those loops to not exceed max <br>
level, use < operator instead of <= (?) I'm not sure if other <br>
calculations would match so some careful investigation would be required <br>
there. It just seems a bit strange to first calculate a 'maximum' <br>
miplevel but then use even bigger value in the test :)<br>
<br>
<br>
> CC: Eric Anholt <<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>><br>
> Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=108819" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=108819</a><br>
> Fixes: 7a0e61d7792f (depthstencil-render-miplevels: Present the results in non-auto mode.)<br>
> Signed-off-by: Sergii Romantsov <<a href="mailto:sergii.romantsov@globallogic.com" target="_blank">sergii.romantsov@globallogic.com</a>><br>
> ---<br>
>   tests/texturing/depthstencil-render-miplevels.cpp | 4 ++--<br>
>   1 file changed, 2 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/tests/texturing/depthstencil-render-miplevels.cpp b/tests/texturing/depthstencil-render-miplevels.cpp<br>
> index 87af92f..9d4b42d 100644<br>
> --- a/tests/texturing/depthstencil-render-miplevels.cpp<br>
> +++ b/tests/texturing/depthstencil-render-miplevels.cpp<br>
> @@ -360,8 +360,8 @@ piglit_init(int argc, char **argv)<br>
>       piglit_require_extension("GL_ARB_depth_texture");<br>
>       piglit_require_extension("GL_ARB_texture_non_power_of_two");<br>
>   <br>
> -     depth_miplevel_data = (float **)calloc(max_miplevel, sizeof(float *));<br>
> -     stencil_miplevel_data = (uint8_t **)calloc(max_miplevel,<br>
> +     depth_miplevel_data = (float **)calloc(max_miplevel + 1, sizeof(float *));<br>
> +     stencil_miplevel_data = (uint8_t **)calloc(max_miplevel + 1,<br>
>                                                  sizeof(uint8_t *));<br>
>   <br>
>       /* argv[2]: buffer combination */<br>
> <br>
</blockquote></div>