Skip to content

Commit 952f05a

Browse files
committed
SERXIONE-6067: WPEFramework crash
Reason for change: Add try catch in DisplaySettings for thread creation Test Procedure: Risks: low Priority: P1 Signed-off-by:Hayden Gfeller [email protected]
1 parent b7c2e6e commit 952f05a

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

DisplaySettings/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.
1616

1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
1818

19+
## [2.0.1] - 2024-12-03
20+
### Fixed
21+
- Fixed unhandled exception that was occasionally causing a crash if thread creation failed.
22+
1923
## [2.0.0] - 2024-10-15
2024
### Removed
2125
- Get and Set Delay Offset support has been removed.

DisplaySettings/DisplaySettings.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ using namespace std;
8585

8686
#define API_VERSION_NUMBER_MAJOR 2
8787
#define API_VERSION_NUMBER_MINOR 0
88-
#define API_VERSION_NUMBER_PATCH 0
88+
#define API_VERSION_NUMBER_PATCH 1
8989

9090
static bool isCecEnabled = false;
9191
static bool isResCacheUpdated = false;
@@ -582,7 +582,11 @@ namespace WPEFramework {
582582
m_service = service;
583583
m_service->AddRef();
584584

585-
m_sendMsgThread = std::thread(sendMsgThread);
585+
try {
586+
m_sendMsgThread = std::thread(sendMsgThread);
587+
} catch (const std::system_error& e) {
588+
LOGERR("Failed to start m_sendMsgThread: %s", e.what());
589+
}
586590
m_timer.connect(std::bind(&DisplaySettings::onTimer, this));
587591
m_AudioDeviceDetectTimer.connect(std::bind(&DisplaySettings::checkAudioDeviceDetectionTimer, this));
588592
m_ArcDetectionTimer.connect(std::bind(&DisplaySettings::checkArcDeviceConnected, this));
@@ -4755,7 +4759,12 @@ namespace WPEFramework {
47554759
try
47564760
{
47574761
LOGWARN("creating worker thread for initAudioPortsWorker ");
4758-
std::thread audioPortInitThread = std::thread(initAudioPortsWorker);
4762+
std::thread audioPortInitThread;
4763+
try {
4764+
audioPortInitThread = std::thread(initAudioPortsWorker);
4765+
} catch (const std::system_error& e) {
4766+
LOGERR("Failed to start initAudioPortsWorker: %s", e.what());
4767+
}
47594768
audioPortInitThread.detach();
47604769
}
47614770
catch(const std::system_error& e)

0 commit comments

Comments
 (0)