[agent][redisreply] Add null check in checkStatus() to prevent segfault#1166
[agent][redisreply] Add null check in checkStatus() to prevent segfault#1166rustiqly wants to merge 3 commits into
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@rustiqly can you try to add unit test coverage for this change? |
|
@yxieca acknowledged, working on adding unit tests. |
strcmp(m_reply->str, status) dereferences m_reply->str without checking for NULL. Redis error replies or type mismatches can leave str as NULL, causing a segfault. Add null check before strcmp and use "(null)" in the error log for clarity. Fixes: sonic-net#1164 Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
5866860 to
0cbe042
Compare
|
/azp run |
|
Added unit coverage in |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
|
Pushed follow-up Root cause from GitHub Actions: The test variable is now renamed to Validation: inspected the failed Actions log for #1166 and applied the exact warning fix; local full compile remains blocked by missing system |
|
/azp run |
1 similar comment
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Rebased/checked CI. The current required Azure failure appears unrelated to this PR's null-check change: vstest failed with Redis/DVS startup errors, e.g. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Rechecked CI for #1166. The current required failure is
Requesting a fresh Azure run. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI update for #1166: Latest Azure.sonic-swss-common
This looks unrelated to the /azp run Azure.sonic-swss-common |
|
/azp run Azure.sonic-swss-common |
|
CI failure classification for #1166: Azure.sonic-swss-common build 1112076 failed in
Requesting a fresh Azure run. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI failure classification for #1166: Azure.sonic-swss-common build 1112248 failed required This looks unrelated to the #1166 change, which only adds a null guard in |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI triage for #1166: Azure build
Log evidence saved locally at |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI failure in Azure build 1112472 looks unrelated to this RedisReply null-check change. Failed required check: Azure.sonic-swss-common (Test vstest): https://github.com/sonic-net/sonic-swss-common/runs/75769297882 The log shows broad VS/DVS instability rather than a RedisReply code failure: repeated Redis unix-socket connection errors, portchannel LACP/TPID failures, VNET VR object assertion failures, and P4RT/DASH failures:
Saved the inspected log as |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI note for #1166: the required The log shows broad VS/DVS instability across unrelated test areas:
The build and coverage jobs passed; re-running Azure to get a clean VS test leg. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI note for #1166: the required The failing The build and coverage checks completed green, so this looks like transient Azure/Ubuntu mirror connectivity rather than a PR regression. Re-running Azure. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI failure looks unrelated to this PR (#1166):
Requesting an Azure rerun. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI failure in Azure build
This PR only adds a null guard in |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI failure classification for #1166: Azure build The failed job is unrelated to the
Saved logs locally for traceability:
Re-running Azure. |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI classification for #1166: Azure build 1113228 failed required |
|
/azp run Azure.sonic-swss-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
Add null check for
m_reply->strbeforestrcmp()inRedisReply::checkStatus().How I did it
Check
!m_reply->strbefore callingstrcmp. Log"(null)"when str is NULL for debug clarity.How to verify it
Call
checkStatus()on a Redis reply with NULL str field — should throw instead of segfault.Which release branch to backport
master
Description for the changelog
Fix potential segfault in RedisReply::checkStatus() when m_reply->str is NULL.
Fixes: #1164