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.
Mesa 18.1.9 was the last release in 18.1.x series .
Is there a reason that prevents upgrading to 18.2 series?
Almost all OpenCL related memory leaks were addressed in that release (also in libdrm 2.4.93)
PS: for completeness the commit that addressed this in 18.2 is 2f1ad72ac17268989d4033e8e3f9460c68eae462
Dylan, are there any plans wrt 18.1?
If not, I think this one should be closed as WONTFIX.
Mesa 18.1 is EOL at this point and there will be no more releases, if you can still reproduce this with 18.2 or current master later please reopen.