Crash in CATerminate 58/181758/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:15:40 +0000 (11:45 +0530)
commit1dcc1591c3e1f6ab0fe56849dc3424dca2a8df26
tree80bd315fbecf84eafeb6287f595ea21333b1ac99
parentee90b14a81ddd7d63a0c75ddd22da4c364ca2ba9
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: Ib18b91b9efde71d4075c0ec9c9639ac8051df6b6
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