Wed, Nov 30, 2022 at 02:01:13PM +0100, Klaus Schmidinger wrote:
VDR version 2.6.2 is now available at the official VDR GIT archive
git://git.tvdr.de
Thank you, Klaus!
While debugging hangs or crashes during the shutdown of rpihddevice (see https://github.com/reufer/rpihddevice/pull/6 for my fixes), I noticed that AddressSanitizer (enabled by -fsanitize=address in GCC or clang) would report some heap-use-after-free also in cDvbTuner::Action(), accessing a deleted cSdtFilter.
The attached patch fixes the issues for me. The Cancel(3) call in cDevice::~cDevice() is moved to cDevice::Shutdown(), because cDevice::~cDevice() would be executed too late, while cDvbDevice::~cDvbDevice() had already deleted the objects.
The Cancel(-1) calls in cDevice::Shutdown() are an optimization to reduce the shutdown time on systems when there are multiple devices.
The change to cDvbDevice::~cDvbDevice() is necessary to shut down all users of cDvbTuner before it is deleted. Without this last hunk, I would still occasionally get heap-use-after-free reports.
Marko