Skip to content

Crash when loading device preset when a File Sink exists #1427

@srcejon

Description

@srcejon

SDRangel can crash if there is a File Sink in the GUI, when loading a Device Set Preset. It looks like the FileSink object is deleted before the FileSinkGUI object, as the in the log, we can see the destructor called first:

2022-09-19 19:40:03.930 (D) FileSink::~FileSink
2022-09-19 19:40:03.931 (D) DSPDeviceSourceEngine::removeSink: FileSink
2022-09-19 19:40:03.931 (D) DSPDeviceSourceEngine::handleSynchronousMessages: DSPRemoveBasebandSampleSink
2022-09-19 19:40:03.931 (D) FileSink::stop:
2022-09-19 19:40:03.932 (D) FileSinkBaseband::~FileSinkBaseband
2022-09-19 19:40:03.932 (D) FileSinkBaseband::stopWork
2022-09-19 19:40:03.936 (D) FFTFactory::releaseEngine: engineSequence: 1 FFT fwd size: 1024

And the crash is in:

FileSinkGUI::~FileSinkGUI()
{
m_fileSink->setMessageQueueToGUI(nullptr);

With m_fileSink being invalid.

Stack trace on Windows.

image

But crashes on Linux too.

Seems to be as a result of the fix for the reverse case of the FileSinkGUI being deleted before the FileSink!

#1356

(I would imagine the GUI should be deleted first, as it was created last)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions