From 94eb3bd406ee9b05ebd089ae618897cb7ee351fc Mon Sep 17 00:00:00 2001 From: Guru Chandru Date: Tue, 11 Jan 2022 14:27:59 +0530 Subject: [PATCH 1/5] Debug log to spot crash --- source/WebConfig/cosa_webconfig_internal.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/WebConfig/cosa_webconfig_internal.c b/source/WebConfig/cosa_webconfig_internal.c index ceb8c613..997ca9c6 100644 --- a/source/WebConfig/cosa_webconfig_internal.c +++ b/source/WebConfig/cosa_webconfig_internal.c @@ -288,6 +288,7 @@ int setForceSync(char* pString, char *transactionId,int *pStatus) { PCOSA_DATAMODEL_WEBCONFIG pMyObject = (PCOSA_DATAMODEL_WEBCONFIG)g_pCosaBEManager->hWebConfig; WebcfgDebug("setForceSync\n"); + WebcfgInfo("SYNC_CRASH: pStatus value is %d\n", pStatus); memset( pMyObject->ForceSync, 0, sizeof( pMyObject->ForceSync )); AnscCopyString( pMyObject->ForceSync, pString ); WebcfgDebug("pMyObject->ForceSync is %s\n", pMyObject->ForceSync); @@ -297,13 +298,17 @@ int setForceSync(char* pString, char *transactionId,int *pStatus) if(get_bootSync()) { WebcfgInfo("Bootup sync is already in progress, Ignoring this request.\n"); + WebcfgInfo("SYNC_CRASH: pStatus value before assigned in bootsync is %d\n", pStatus); *pStatus = 1; + WebcfgInfo("SYNC_CRASH: pStatus value after assigned in bootsync is %d\n", pStatus); return 0; } else if(strlen(pMyObject->ForceSyncTransID)>0) { WebcfgInfo("Force sync is already in progress, Ignoring this request.\n"); + WebcfgInfo("SYNC_CRASH: pStatus value before assigned in ForceSync is %d\n", pStatus); *pStatus = 1; + WebcfgInfo("SYNC_CRASH: pStatus value after assigned in ForceSync is %d\n", pStatus); return 0; } else @@ -669,6 +674,7 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char RFC_ENABLE = Get_RfcEnable(); WebcfgDebug("paramCount = %d\n",paramCount); + WebcfgInfo("SYNC_CRASH: session_status before set is %d\n", session_status); for(i=0; i Date: Tue, 11 Jan 2022 14:30:25 +0530 Subject: [PATCH 2/5] Webpa SetForceSync Crash Fix --- source/WebConfig/cosa_webconfig_internal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/WebConfig/cosa_webconfig_internal.c b/source/WebConfig/cosa_webconfig_internal.c index 997ca9c6..6b68d30f 100644 --- a/source/WebConfig/cosa_webconfig_internal.c +++ b/source/WebConfig/cosa_webconfig_internal.c @@ -666,7 +666,7 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char int i=0; char *subStr = NULL; BOOL RFC_ENABLE; - int session_status = 0; + static int session_status; int ret = 0; WebcfgDebug("*********** %s ***************\n",__FUNCTION__); @@ -718,8 +718,10 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char WebcfgInfo("SYNC_CRASH: session_status outside if else case is %d\n", session_status); if(session_status) { + session_status = 0; //To reset the static variable return CCSP_CR_ERR_SESSION_IN_PROGRESS; } + session_status = 0; //To reset the static variable if(!ret) { WebcfgError("setForceSync failed\n"); From dac49b653f91a8580073991e83bd2e6929c7c8bb Mon Sep 17 00:00:00 2001 From: Guru Chandru Date: Tue, 22 Feb 2022 12:23:52 +0530 Subject: [PATCH 3/5] Revised webpa Force Sync Fix --- source/WebConfig/cosa_webconfig_dml.c | 3 ++- source/WebConfig/cosa_webconfig_internal.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/WebConfig/cosa_webconfig_dml.c b/source/WebConfig/cosa_webconfig_dml.c index f25f4187..bfba5b8a 100644 --- a/source/WebConfig/cosa_webconfig_dml.c +++ b/source/WebConfig/cosa_webconfig_dml.c @@ -92,6 +92,7 @@ X_RDK_WebConfig_SetParamStringValue } if( AnscEqualString(ParamName, "ForceSync", TRUE)) { + int session_status = 0; if(AnscEqualString(strValue, "telemetry", TRUE)) { char telemetryUrl[256] = {0}; @@ -103,7 +104,7 @@ X_RDK_WebConfig_SetParamStringValue } } /* save update to backup */ - if(setForceSync(strValue, "", 0) == 1) + if(setForceSync(strValue, "", &session_status) == 1) { return TRUE; } diff --git a/source/WebConfig/cosa_webconfig_internal.c b/source/WebConfig/cosa_webconfig_internal.c index 6b68d30f..8110549e 100644 --- a/source/WebConfig/cosa_webconfig_internal.c +++ b/source/WebConfig/cosa_webconfig_internal.c @@ -666,7 +666,7 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char int i=0; char *subStr = NULL; BOOL RFC_ENABLE; - static int session_status; + int session_status = 0; int ret = 0; WebcfgDebug("*********** %s ***************\n",__FUNCTION__); @@ -718,10 +718,10 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char WebcfgInfo("SYNC_CRASH: session_status outside if else case is %d\n", session_status); if(session_status) { - session_status = 0; //To reset the static variable + //session_status = 0; //To reset the static variable return CCSP_CR_ERR_SESSION_IN_PROGRESS; } - session_status = 0; //To reset the static variable + //session_status = 0; //To reset the static variable if(!ret) { WebcfgError("setForceSync failed\n"); From 7ac7c9c0529e280ad6ba3ce38ebb7c1586e0a73a Mon Sep 17 00:00:00 2001 From: Guru Chandru Date: Wed, 23 Feb 2022 19:12:18 +0530 Subject: [PATCH 4/5] Removed Debug logs for sync crash --- source/WebConfig/cosa_webconfig_internal.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/source/WebConfig/cosa_webconfig_internal.c b/source/WebConfig/cosa_webconfig_internal.c index b5bbd544..d6a9b7aa 100644 --- a/source/WebConfig/cosa_webconfig_internal.c +++ b/source/WebConfig/cosa_webconfig_internal.c @@ -288,7 +288,6 @@ int setForceSync(char* pString, char *transactionId,int *pStatus) { PCOSA_DATAMODEL_WEBCONFIG pMyObject = (PCOSA_DATAMODEL_WEBCONFIG)g_pCosaBEManager->hWebConfig; WebcfgDebug("setForceSync\n"); - WebcfgInfo("SYNC_CRASH: pStatus value is %d\n", pStatus); memset( pMyObject->ForceSync, 0, sizeof( pMyObject->ForceSync )); AnscCopyString( pMyObject->ForceSync, pString ); WebcfgDebug("pMyObject->ForceSync is %s\n", pMyObject->ForceSync); @@ -298,9 +297,7 @@ int setForceSync(char* pString, char *transactionId,int *pStatus) if(get_bootSync()) { WebcfgInfo("Bootup sync is already in progress, Ignoring this request.\n"); - WebcfgInfo("SYNC_CRASH: pStatus value before assigned in bootsync is %d\n", pStatus); *pStatus = 1; - WebcfgInfo("SYNC_CRASH: pStatus value after assigned in bootsync is %d\n", pStatus); return 0; } else if(get_maintenanceSync()) @@ -312,9 +309,7 @@ int setForceSync(char* pString, char *transactionId,int *pStatus) else if(strlen(pMyObject->ForceSyncTransID)>0) { WebcfgInfo("Force sync is already in progress, Ignoring this request.\n"); - WebcfgInfo("SYNC_CRASH: pStatus value before assigned in ForceSync is %d\n", pStatus); *pStatus = 1; - WebcfgInfo("SYNC_CRASH: pStatus value after assigned in ForceSync is %d\n", pStatus); return 0; } else @@ -680,7 +675,6 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char RFC_ENABLE = Get_RfcEnable(); WebcfgDebug("paramCount = %d\n",paramCount); - WebcfgInfo("SYNC_CRASH: session_status before set is %d\n", session_status); for(i=0; i Date: Fri, 25 Feb 2022 12:05:41 +0530 Subject: [PATCH 5/5] Review comment Change to add the fix in empty doc case in webpa --- source/WebConfig/cosa_webconfig_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WebConfig/cosa_webconfig_internal.c b/source/WebConfig/cosa_webconfig_internal.c index d6a9b7aa..0b5c8e70 100644 --- a/source/WebConfig/cosa_webconfig_internal.c +++ b/source/WebConfig/cosa_webconfig_internal.c @@ -711,7 +711,7 @@ int setWebConfigParameterValues(parameterValStruct_t *val, int paramCount, char else //pass empty transaction id when Force sync is with empty doc { WebcfgDebug("setWebConfigParameterValues empty setForceSync\n"); - ret = setForceSync(val[i].parameterValue, "", 0); + ret = setForceSync(val[i].parameterValue, "", &session_status); } if(session_status) {