RDKEMW-21888 : Fix coverity issues (from copilot) in subttxrend-app - #99
Open
krithikasvraman wants to merge 4 commits into
Open
krithikasvraman wants to merge 4 commits into
krithikasvraman wants to merge 4 commits into
Conversation
Reason for change: Fix coverity issues in subttxrend-app Test Procedure: Regression tests Risks: Low Signed-off-by:krithika_venkataraman@comcast.com
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets Coverity/static-analysis findings in subttxrend-app by simplifying log-level string mapping and refactoring the termination-signal listener setup in main().
Changes:
- Reworked
levelToString()to avoid runtime-initialized container state by using static names +switch/checks. - Split signal handling into
blockTerminationSignals()andcreateSignalListener()to make threading/signal masking flow clearer.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| subttxrend-app/x86_builder/src/rdklogger/src/logger.cpp | Replaces lazy-initialized map-based log-level lookup with static strings and explicit branching. |
| subttxrend-app/src/main.cpp | Refactors signal masking and async signal waiting into two helper functions used by main(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
21
to
23
| #include <rdk_debug.h> | ||
| #include <cstdarg> | ||
| #include <map> | ||
| #include <string> |
Contributor
Author
There was a problem hiding this comment.
fixed in next commit
Comment on lines
+43
to
+47
| return std::async(std::launch::async, [sigset]() { | ||
| int signum = 0; | ||
| // wait until a signal is delivered: | ||
| sigwait(&sigset, &signum); | ||
|
|
||
| return signum; | ||
| }; | ||
|
|
||
| return std::async(std::launch::async, signal_handler); | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
fixed in next commit
Reason for change: Fix coverity issues in subttxrend-app Test Procedure: Regression tests Risks: Low Signed-off-by:krithika_venkataraman@comcast.com
Reason for change: Fix coverity issues in subttxrend-app Test Procedure: Regression tests Risks: Low Signed-off-by:krithika_venkataraman@comcast.com
Reason for change: Fix coverity issues in subttxrend-app Test Procedure: Regression tests Risks: Low Signed-off-by:krithika_venkataraman@comcast.com
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
subttxrend-app/src/main.cpp:38
blockTerminationSignals()returnsfalseon failure but doesn't record which specific POSIX call failed (sigemptyset/sigaddset/pthread_sigmask). That makes the subsequent "Failed to block termination signals" message hard to act on when it occurs. Consider emitting a more specific error message at the point of failure (even if you don’t include strerror/errno).
static bool blockTerminationSignals(sigset_t& sigset)
{
if (sigemptyset(&sigset) != 0) {
return false;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: Fix coverity issues in subttxrend-app
Test Procedure: Regression tests
Risks: Low
Signed-off-by:krithika_venkataraman@comcast.com