From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tvrtko Ursulin Subject: [PATCH 0/2] drmtest: Fix hanging child processes Date: Tue, 3 Dec 2013 16:44:53 +0000 Message-ID: <1386089095-9966-1-git-send-email-tvrtko.ursulin@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 972D3FB479 for ; Tue, 3 Dec 2013 08:45:20 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: Tvrtko Ursulin It was observed both on Linux and Android that tests which fork can sometimes hang failing to terminate child processes. This was eventually tracked down to race conditions in C library implementations, all with regards to caching of PID/TGID and TID values. Solution is to revert the previous workaround, which closed the race under glibc a bit, and ensure current values from the kernel are used during timing sensitive periods. This was tested under Android only but should be a generic fix. Tvrtko Ursulin (2): Revert "lib/drmtest: ducttape over fork race" drmtest: Avoid wrong PID/TID after clone races lib/drmtest.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) -- 1.8.4.3