<div dir="ltr">Hello, Eric<span class="gmail-im" style="color:rgb(80,0,80)"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Can you explain how not freeing memory could cause a core dump on exit?</blockquote></span><div>Core mostly was generated due: a number of levels is max_miplevel (level 0 is also available, so index should be counted as <=max_miplevel), but array that holds pointers is size of max_miplevel (so without counting of 0-level). In that way happens array index out of bounds + memory allocation to some undefined address.</div><span class="gmail-im" style="color:rgb(80,0,80)"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">And, in general, I would recommend just freeing data after usage, rather than having a deinit function.</blockquote></span><div>Looks like it may complicate a logic and code of test. Test may exit with any call to 'piglit_report_result' and it can happens on any stage of execution. In proposed mechanism we shouldn't care when and why exit is done, so we can be sure that all resources will be freed.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 23, 2018 at 7:35 PM Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sergii Romantsov <<a href="mailto:sergii.romantsov@gmail.com" target="_blank">sergii.romantsov@gmail.com</a>> writes:<br>
<br>
> Usage test 'depthstencil-render-miplevels 200 s=z24_s8' causes core dump on exit.<br>
> Issues:<br>
> 1. Allocation of memory many times to the same variable<br>
> 2. Not complete array to store pointers<br>
> 3. Absence of memory freeing<br>
<br>
Can you explain how not freeing memory could cause a core dump on exit?<br>
And, in general, I would recommend just freeing data after usage, rather<br>
than having a deinit function.<br>
</blockquote></div>