Skip to content

RDKB-64747: CcspPandM component is crashing on Device.Time.Status subscription - #126

Open
JESTINJM wants to merge 1 commit into
developfrom
topic/64747
Open

RDKB-64747: CcspPandM component is crashing on Device.Time.Status subscription#126
JESTINJM wants to merge 1 commit into
developfrom
topic/64747

Conversation

@JESTINJM

Copy link
Copy Markdown

RDKB-64747: CcspPandM component is crashing on Device.Time.Status subscription

Reason for change: To fix PandM crash observed when subscribing to Device.Time.Status baked with a NULL value that is out of range from syscfg parameter ntp_status

Test Procedure: Execute 'syscfg set ntp_status 0' and then subscribe to the corresponding DM with command
'rbuscli sub Device.Time.Status' and confirm CcspPandM process is NOT crashed.

Risks: Low
Priority: P1

Copilot AI review requested due to automatic review settings July 30, 2026 07:17
@JESTINJM
JESTINJM requested review from a team as code owners July 30, 2026 07:17
@JESTINJM
JESTINJM requested a review from rajkamal-cv July 30, 2026 07:17

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

Fixes a crash path in the RBUS value-change subscription/polling logic when a subscribed DM parameter returns a NULL parameterValue (e.g., Device.Time.Status derived from ntp_status).

Changes:

  • Added NULL checks before calling strdup(val[0]->parameterValue) when caching the initial value on subscribe.
  • Added NULL checks before calling strdup(val[0]->parameterValue) when updating the cached value in the polling thread.
Comments suppressed due to low confidence (1)

source/util_api/ccsp_msg_bus/ccsp_rbus_value_change.c:431

  • If val[0]->parameterValue is NULL during initial subscription, rec->value stays NULL. Downstream code assumes rec->value is a valid C string (e.g., strcmp(rec->value, ...) in the polling thread and rbusMessage_SetString(msg, rec->value) when publishing oldValue), so subscribing to a parameter that returns NULL can still crash even though strdup(NULL) is avoided here.
            if(val[0]->parameterValue)
            {
                rec->value = strdup(val[0]->parameterValue);
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/util_api/ccsp_msg_bus/ccsp_rbus_value_change.c
Copilot AI review requested due to automatic review settings August 3, 2026 07:52

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 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

source/util_api/ccsp_msg_bus/ccsp_rbus_value_change.c:338

  • Even with the new NULL-safe strcmp, the filter path can still crash: when rec->filter is set, rbusValueChange_getFilterResult calls rbusValue_SetFromString on rec->value and val[0]->parameterValue. This change now allows those strings to be NULL, so a subscription using a filter could still dereference NULL during filter evaluation. Normalizing NULLs to a safe sentinel (e.g., empty string) before calling the filter helper avoids that crash while preserving filter semantics.
                if(changed)
                {
                    int filterResult = -1;
                    bool publish = true;

…scription

Reason for change: To fix PandM crash observed when subscribing to
Device.Time.Status baked with a NULL value that is out of range from
syscfg parameter ntp_status

Test Procedure: Execute 'syscfg set ntp_status 0' and then
subscribe to the corresponding DM with command
'rbuscli sub Device.Time.Status' and confirm CcspPandM process is
NOT crashed.

Risks: Low
Priority: P1

Signed-off-by: jmathe064 <Jestin_Mathew@comcast.com>
Copilot AI review requested due to automatic review settings August 3, 2026 08:13

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 1 out of 1 changed files in this pull request and generated no new comments.

@veeraputhiran-thangavel veeraputhiran-thangavel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The utopia script still initializes ntp_status to 0 on boot, which is the root cause identified in RDKB-64747. Is there a separate PR/ticket planned to fix that initialization to a valid value ?

@JESTINJM

JESTINJM commented Aug 4, 2026

Copy link
Copy Markdown
Author

The utopia script still initializes ntp_status to 0 on boot, which is the root cause identified in RDKB-64747. Is there a separate PR/ticket planned to fix that initialization to a valid value ?

I don't see any separate ticket/PR to fix that initialization. These changes would be good to have as it would be a generic fix to handle similar scenarios with other DMs.

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.

3 participants