Received: from eggs.gnu.org ([2001:4830:134:3::10]:39825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAe1I-0005W7-CV for qemu-devel@nongnu.org; Thu, 02 Jul 2015 08:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAe1F-0000GQ-HZ for qemu-devel@nongnu.org; Thu, 02 Jul 2015 08:55:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAe1F-0000GF-C4 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 08:55:09 -0400 From: Markus Armbruster References: <1435747190-18017-1-git-send-email-quintela@redhat.com> <876162sqh4.fsf@neno.neno> Date: Thu, 02 Jul 2015 14:55:06 +0200 In-Reply-To: (Peter Maydell's message of "Thu, 2 Jul 2015 13:30:38 +0100") Message-ID: <87bnfuwwgl.fsf_-_@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] Mutex error checking (was: [PULL 00/26] Migration pull request) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Amit Shah , Paolo Bonzini , QEMU Developers , Juan Quintela Peter Maydell writes: > On 2 July 2015 at 13:17, Juan Quintela wrote: >> Why, o why, o why it didn't fail on linux, why. I think I know where >> the problem is. > > I think OSX defaults to being pickier about its mutexes, > whereas Linux defaults to "make lock/unlock as fast as > possible and assume the program is correct". >From pthread_mutexattr_settype(3p): PTHREAD_MUTEX_ERRORCHECK This type of mutex provides error checking. A thread attempting to relock this mutex without first unlocking it shall return with an error. A thread attempting to unlock a mutex which another thread has locked shall return with an error. A thread attempting to unlock an unlocked mutex shall return with an error. Not sure it detects this particular problem. Should we use it with --enable-debug or something?