summaryrefslogtreecommitdiff
path: root/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorPrince Kumar Dubey <prince.dubey@samsung.com>2016-07-11 22:29:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-11 22:29:04 +0900
commit8fbb6dbbbb73dc0761ad6b3b5bcf1d1dc36ceef1 (patch)
treed24fb73b0f4880cc4290dd693b6398a9bed48d00 /src/lib/ecore_ipc
parent4329a359dc967d550965edd5139218afe3718347 (diff)
If there is situation when server is closed prior to client, the client pointer pointing to server must be reset and check must be there during client deletion
Summary: During mobile product testing, we got a crash with callstack which suggest server is getting deleted prior to client. On valgrind analysis we found invalid write operation with same callstack. callstack is pasted in comment section. Test Plan: create a situation where server got deleted prior to client. Reviewers: raster, cedric Subscribers: govi, rajeshps, jpeg Differential Revision: https://phab.enlightenment.org/D4152
Diffstat (limited to 'src/lib/ecore_ipc')
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 56de0ab43b..219c9503b6 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -461,7 +461,10 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr)
461 Ecore_Ipc_Client *cl; 461 Ecore_Ipc_Client *cl;
462 462
463 EINA_LIST_FREE(svr->clients, cl) 463 EINA_LIST_FREE(svr->clients, cl)
464 ecore_ipc_client_del(cl); 464 {
465 cl->svr = NULL;
466 ecore_ipc_client_del(cl);
467 }
465 if (svr->server) ecore_con_server_del(svr->server); 468 if (svr->server) ecore_con_server_del(svr->server);
466 servers = eina_list_remove(servers, svr); 469 servers = eina_list_remove(servers, svr);
467 470
@@ -875,7 +878,8 @@ ecore_ipc_client_del(Ecore_Ipc_Client *cl)
875 { 878 {
876 svr = cl->svr; 879 svr = cl->svr;
877 if (cl->client) ecore_con_client_del(cl->client); 880 if (cl->client) ecore_con_client_del(cl->client);
878 svr->clients = eina_list_remove(svr->clients, cl); 881 if (ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
882 svr->clients = eina_list_remove(svr->clients, cl);
879 if (cl->buf) free(cl->buf); 883 if (cl->buf) free(cl->buf);
880 ECORE_MAGIC_SET(cl, ECORE_MAGIC_NONE); 884 ECORE_MAGIC_SET(cl, ECORE_MAGIC_NONE);
881 free(cl); 885 free(cl);