<div dir="ltr">Hello, Tapani, Eric.<div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">No worries, I'm OK with using this patch too.</blockquote><div> </div><div>Can it be treated as r-b? </div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 16, 2019 at 11:06 AM 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>
<br>
On 1/15/19 5:02 PM, Sergii Romantsov wrote:<br>
> Hello,<br>
> <br>
> Yep, it seems valgrind outputs bunch of invalid reads and writes with<br>
> this test.<br>
> <br>
> Seems any test with valgrind generates invalid reads and writes... <br>
> Probably it depends on macros-usage: probably they are not properly <br>
> handled by valgrind<br>
<br>
Yeah this may be but this time it points directly to the test code as well.<br>
<br>
> It just seems a bit strange to first calculate a 'maximum'<br>
> miplevel but then use even bigger value in the test :)<br>
> <br>
> I would say that max level is calculated properly, but in test also used <br>
> 0-level, which seems included as +1 to max_miplevel<br>
> <br>
> Alternatively I guess one could change those loops to not exceed max<br>
> level, use < operator instead of <= (?)<br>
> <br>
> If no more any objections - will update to '<'<br>
<br>
No worries, I'm OK with using this patch too.<br>
<br>
> On Tue, Jan 15, 2019 at 3:07 PM Tapani Pälli <<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a> <br>
> <mailto:<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a>>> wrote:<br>
> <br>
> <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<br>
> 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> <mailto:<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<br>
> 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>
> <mailto:<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<br>
> 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,<br>
> sizeof(float *));<br>
> > - stencil_miplevel_data = (uint8_t **)calloc(max_miplevel,<br>
> > + depth_miplevel_data = (float **)calloc(max_miplevel + 1,<br>
> sizeof(float *));<br>
> > + stencil_miplevel_data = (uint8_t **)calloc(max_miplevel + 1,<br>
> > sizeof(uint8_t *));<br>
> ><br>
> > /* argv[2]: buffer combination */<br>
> ><br>
> <br>
</blockquote></div>