Mathi,

W.r.t

> -     rc = clms_client_del_trackresp(client->client_id);
> +     rc = clms_client_del_trackresp(client_id);


`client_id` is in network byte order.. but the above function expects in 
host byte order. Please check.

Thanks,
Ramesh.


On 5/17/2014 1:49 AM, mathi.naic...@oracle.com wrote:
>   osaf/services/saf/clmsv/clms/clms_evt.c |   2 +-
>   osaf/services/saf/clmsv/clms/clms_mds.c |  15 ++++++++-------
>   2 files changed, 9 insertions(+), 8 deletions(-)
>
>
> Valgrind reported the following:
> ==9425== Invalid read of size 4
> ==9425== at 0x40AAE2: clms_client_delete_by_mds_dest (clms_evt.c:167)
> ==9425== by 0x40AC50: proc_clma_updn_mds_msg (clms_evt.c:621)
> ==9425== by 0x40BB8F: clms_process_mbx (clms_evt.c:1307)
> ==9425== by 0x403FDD: main (clms_main.c:499)
> ==9425== Address 0x67ba190 is 32 bytes inside a block of size 64 free'd
> ==9425== at 0x4C2BDEC: free (in 
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==9425== by 0x40AA22: clms_client_delete (clms_evt.c:205)
> ==9425== by 0x40AAE1: clms_client_delete_by_mds_dest (clms_evt.c:164)
> ==9425== by 0x40AC50: proc_clma_updn_mds_msg (clms_evt.c:621)
> ==9425== by 0x40BB8F: clms_process_mbx (clms_evt.c:1307)
> ==9425== by 0x403FDD: main (clms_main.c:499)
>
> This warning from valgrind is shown in the context of the below lines:
>                          rc = clms_client_delete(client->client_id);
>
>                          /* Delete this client data from the clmresp tracking 
> list */
>                          rc = clms_client_del_trackresp(client->client_id);
>
> It can be seen that clms_client_del_trackresp was accessing a memory that 
> would
> get freed in some flows by the previous line.
>
> The second part of the patch adds a check in clms_mds.c such that
> posting to mailbox is done only after explicitly checking whether
> the service id is for CLMA or AMFND.
> There is a subscription for CLMNA also, but we are not doing anything today
> for CLMNA down. So, in the case when CLMNA down comes, the event-type
> field is not getting set when posting to the mail box. This results
> in a situation where the mailbox processing invokes proc_initialize()
> because the event-type gets set to 0 which is the default value.
>
> diff --git a/osaf/services/saf/clmsv/clms/clms_evt.c 
> b/osaf/services/saf/clmsv/clms/clms_evt.c
> --- a/osaf/services/saf/clmsv/clms/clms_evt.c
> +++ b/osaf/services/saf/clmsv/clms/clms_evt.c
> @@ -164,7 +164,7 @@ uint32_t clms_client_delete_by_mds_dest(
>                       rc = clms_client_delete(client->client_id);
>   
>                       /* Delete this client data from the clmresp tracking 
> list */
> -                     rc = clms_client_del_trackresp(client->client_id);
> +                     rc = clms_client_del_trackresp(client_id);
>                       if (rc != NCSCC_RC_SUCCESS) {
>                               LOG_ER("clms_client_delete_trackresp FAILED: 
> %u", rc);
>                       }
> diff --git a/osaf/services/saf/clmsv/clms/clms_mds.c 
> b/osaf/services/saf/clmsv/clms/clms_mds.c
> --- a/osaf/services/saf/clmsv/clms/clms_mds.c
> +++ b/osaf/services/saf/clmsv/clms/clms_mds.c
> @@ -1170,13 +1170,14 @@ static uint32_t clms_mds_svc_event(struc
>                               evt->info.node_mds_info.node_id = 
> info->info.svc_evt.i_node_id;
>                               evt->info.node_mds_info.nodeup = false;
>                       }
> -
> -                     /* Push the event and we are done */
> -                     if (m_NCS_IPC_SEND(&clms_cb->mbx, evt, 
> NCS_IPC_PRIORITY_HIGH) != NCSCC_RC_SUCCESS) {
> -                             TRACE("ipc send failed");
> -                             free(evt);
> -                             rc = NCSCC_RC_FAILURE;
> -                             goto done;
> +                     if (evt->type) {
> +                             /* Push the event and we are done */
> +                             if (m_NCS_IPC_SEND(&clms_cb->mbx, evt, 
> NCS_IPC_PRIORITY_HIGH) != NCSCC_RC_SUCCESS) {
> +                                     TRACE("ipc send failed");
> +                                     free(evt);
> +                                     rc = NCSCC_RC_FAILURE;
> +                                     goto done;
> +                             }
>                       }
>       }
>    done:


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to