Crash in CATerminate 64/181764/1
authorVeeraj Khokale <veeraj.sk@samsung.com>
Thu, 7 Jun 2018 13:30:59 +0000 (19:00 +0530)
committerAmit KS <amit.s12@samsung.com>
Mon, 18 Jun 2018 06:43:35 +0000 (12:13 +0530)
commitd0d563ada213484af2455ba6f4af51b53a694aea
tree2d2ef583a5e34ecd0b2afb3f7272a8512e50e0e7
parentbdd4ddc2ecd933591e9396b1652d761da815eb0f
Crash in CATerminate

The variable caglobals.tcp.terminate is used to signal the
receiver thread to stop. However using a volatile variable
to synchronize between threads is undefined behaviour as
per the C/C++ standards. In this particular case due to
cache coherence behaviour on SMP mobile(especially ARM)
multi core processors, the receiver thread is not guaranteed
to see the change to the terminate variable as soon as
adapter is terminated and this delay could cause an ANR.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/290
(cherry picked from commit 38101be161271b68cee847748d71fb4ded73bc5a)

Change-Id: Ied3fbb138fe095a1e4a9eb51016e59c2be5730e5
Signed-off-by: Veeraj Khokale <veeraj.sk@samsung.com>
Signed-off-by: Amit KS <amit.s12@samsung.com>
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c