David Kuehling
2018-09-27 14:09:01 UTC
Package: mesa-opencl-icd
Version: 18.1.6-1~bpo9+1
Severity: normal
Dear Maintainer,
the mesa 18.1.6 version that is provided via debian-backports has a
memory leak in the functions that implement clEnqueueNDRangeKernel().
The root cause is that destructor
clover::kernel::scalar_argument::~scalar_argument() is never called, as
life-time is managed via a unique_ptr<> to the parent class 'argument'
which does not have a virtual destructor. This leads to memory
allocated by member vector<> kernel::scalar_argument::_v to leak.
For me adding a virtual destructor fixes this specific leak:
--- src.orig/mesa-18.1.6/src/gallium/state_trackers/clover/core/kernel.hpp 2018-08-13 18:42:38.000000000 +0200
+++ mesa-18.1.6/src/gallium/state_trackers/clover/core/kernel.hpp 2018-09-27 10:17:16.689585453 +0200
@@ -75,6 +75,7 @@
argument(const argument &arg) = delete;
argument &
operator=(const argument &arg) = delete;
+ virtual ~argument() = default;
/// \a true if the argument has been set.
bool set() const;
Maybe somebody more familiar with the sources could look through GCC
warnings or sanitizer output for whether more problems of that sort are
present throughout the Mesa sources?
This bug currently causes leela zero [1] to consume many gigabytes of
memory over time, making it impractical to run, see the corresponding
leela zero bug [2] ([2] also has more details like valgrind backtraces
of the leak in question).
cheers,
David
[1] http://zero.sjeng.org/
[2] https://github.com/gcp/leela-zero/issues/1823
-- Package-specific info:
Version: 18.1.6-1~bpo9+1
Severity: normal
Dear Maintainer,
the mesa 18.1.6 version that is provided via debian-backports has a
memory leak in the functions that implement clEnqueueNDRangeKernel().
The root cause is that destructor
clover::kernel::scalar_argument::~scalar_argument() is never called, as
life-time is managed via a unique_ptr<> to the parent class 'argument'
which does not have a virtual destructor. This leads to memory
allocated by member vector<> kernel::scalar_argument::_v to leak.
For me adding a virtual destructor fixes this specific leak:
--- src.orig/mesa-18.1.6/src/gallium/state_trackers/clover/core/kernel.hpp 2018-08-13 18:42:38.000000000 +0200
+++ mesa-18.1.6/src/gallium/state_trackers/clover/core/kernel.hpp 2018-09-27 10:17:16.689585453 +0200
@@ -75,6 +75,7 @@
argument(const argument &arg) = delete;
argument &
operator=(const argument &arg) = delete;
+ virtual ~argument() = default;
/// \a true if the argument has been set.
bool set() const;
Maybe somebody more familiar with the sources could look through GCC
warnings or sanitizer output for whether more problems of that sort are
present throughout the Mesa sources?
This bug currently causes leela zero [1] to consume many gigabytes of
memory over time, making it impractical to run, see the corresponding
leela zero bug [2] ([2] also has more details like valgrind backtraces
of the leak in question).
cheers,
David
[1] http://zero.sjeng.org/
[2] https://github.com/gcp/leela-zero/issues/1823
-- Package-specific info: