Assign descriptive names to SDRangel threads so thread activity can be
identified when investigating multi-threaded behavior, including crashes,
leaks, and synchronization issues in debuggers and others tools.
Use compact names to fit platform thread-name limits (14 chars) while
retaining the component and thread role where possible.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MessageQueue::pop() transfers ownership of the popped message to the
caller, but many handleInputMessages() implementations only deleted
the message when handleMessage() returned true. When a message was not
handled, ownership had already been transferred from the queue and the
message was leaked.
This was identified while investigating an ASAN leak in the audio
subsystem.
Update the applicable handleInputMessages() implementations to always
delete messages after handleMessage() returns. Unhandled messages are
also logged with the component and message identifier so unexpected
message routing is visible during debugging.
This change:
- Ensures every message popped from a queue has its ownership resolved.
- Prevents leaks when handleMessage() returns false.
- Makes unhandled messages visible instead of silently discarding them.
- Preserves the existing message handling logic and does not require
components to handle message types that are legitimately irrelevant
to them.
The changes are intentionally mechanical and limited to the common
message queue ownership and diagnostic pattern.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_blindAngleBorder to false in the DOA2Compass constructor. The
member was previously left uninitialized, resulting in undefined behavior
when its value was used before setBlindAngleBorder() was called.
This resolves the uninitialized member reported by Coverity (UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The same fix as da31464dd for the plugins whose applySettings takes the key list first, which
that sweep missed: 35 channels, modulators, sinks, sources and one MIMO device copied the
whole settings struct on every message, so a GUI message with no keys arriving just after an
API patch put the old values back. The DSD demodulator lost the deviation set at creation
this way.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The generated SWG setters overwrite the string pointer without deleting
what is already there, and every webapiSettingsGet and webapiReportGet
calls init() first, which has allocated one. Each call therefore leaked a
QString per string field. Measured at 117 bytes per settings GET for the
Satellite Tracker, over 20,000 requests.
Assign in place when the pointer is already set, which is what these same
functions have always done for title and reverseAPIAddress. 394 sites
across webapiFormatChannelSettings, webapiFormatDeviceSettings,
webapiFormatFeatureSettings and the three report equivalents.
The webapiReverseSend* functions are deliberately left alone: they build a
fresh SWG object whose constructor leaves the pointers null, so passing a
new QString is correct there.
After the change the same measurement is flat, at 7 bytes per GET.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Initialize m_useReverseAPI to false when resetting Interferometer settings
to their defaults. The member was not initialized by the constructor or
resetToDefaults(), allowing its value to be read before being set.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_useReverseAPI to false when resetting DOA2 settings to their
defaults. The member was not initialized by the constructor or
resetToDefaults(), allowing its value to be read before being set.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_streamIndex to zero in the stream source constructor.
BeamSteeringCWModBaseband subsequently assigns each source its actual
stream index, but initializing the member ensures getStreamIndex() does
not expose an indeterminate value during construction.
Detected by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Add memory buffer to Logger, so last 500 log messages can be included in crash report.
Generate and include stripped pdb files so stack trace can include function names.