Skip to content

RDKEMW-21888 : Fix coverity issues (from copilot) in subttxrend-app - #99

Open
krithikasvraman wants to merge 4 commits into
developfrom
topic/RDKEMW-21888
Open

krithikasvraman wants to merge 4 commits into
developfrom
topic/RDKEMW-21888

Conversation

@krithikasvraman

Copy link
Copy Markdown
Contributor

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
@krithikasvraman
krithikasvraman requested a review from a team as a code owner July 20, 2026 05:57
Copilot AI review requested due to automatic review settings July 20, 2026 05:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() and createSignalListener() 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>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in next commit

Comment thread subttxrend-app/src/main.cpp Outdated
Comment thread subttxrend-app/src/main.cpp Outdated
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);
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copilot AI review requested due to automatic review settings July 20, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread subttxrend-app/x86_builder/src/rdklogger/src/logger.cpp Outdated
Comment thread subttxrend-app/src/main.cpp
Reason for change: Fix coverity issues in subttxrend-app
Test Procedure: Regression tests
Risks: Low
Signed-off-by:krithika_venkataraman@comcast.com
Copilot AI review requested due to automatic review settings July 20, 2026 07:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread subttxrend-app/src/main.cpp
Reason for change: Fix coverity issues in subttxrend-app
Test Procedure: Regression tests
Risks: Low
Signed-off-by:krithika_venkataraman@comcast.com
Copilot AI review requested due to automatic review settings July 20, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() returns false on 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;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants