Hello, Eric > > Can you explain how not freeing memory could cause a core dump on exit?
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. > And, in general, I would recommend just freeing data after usage, > rather than having a deinit function. 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. On Fri, Nov 23, 2018 at 7:35 PM Eric Anholt <e...@anholt.net> wrote: > Sergii Romantsov <sergii.romant...@gmail.com> writes: > > > Usage test 'depthstencil-render-miplevels 200 s=z24_s8' causes core dump > on exit. > > Issues: > > 1. Allocation of memory many times to the same variable > > 2. Not complete array to store pointers > > 3. Absence of memory freeing > > Can you explain how not freeing memory could cause a core dump on exit? > And, in general, I would recommend just freeing data after usage, rather > than having a deinit function. >
_______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit