[Mesa-dev] [Bug 108087] Memory leak in clover::kernel::argument::create<>() (i.e. clEnqueueNDRangeKernel())

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 27 14:31:50 UTC 2018


            Bug ID: 108087
           Summary: Memory leak in clover::kernel::argument::create<>()
                    (i.e. clEnqueueNDRangeKernel())
           Product: Mesa
           Version: 18.1
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Gallium/StateTracker/Clover
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: dvdk at posteo.de
        QA Contact: mesa-dev at lists.freedesktop.org


would you please consider adding a virtual destructor to class
clover::kernel::argument?  Currently life-time of kernel::scalar_argument is
managed via unique_ptr<argument> i.e. via a pointer to the parent class. 
Without virtual destructor in the parent, scalar_argument destructor never
runs.  This in turn causes scalar_argument::v to leak its memory.

Details are documented as part of this leela zero bug (which turned out to be
the Mesa issue just described):


I also just reported the same issue (and a patch) to Debian:


Adding the virtual destructor fixes the leak for me.  Note that Mesa 18.2 also
added the virtual destructor, while the latest 18.1 version still lacks it:


Maybe GCC warning output or some code sanitizers will point out more issues of
this kind.



You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180927/51443cbc/attachment.html>

More information about the mesa-dev mailing list