From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20100 invoked by alias); 24 Nov 2011 14:49:27 -0000 Received: (qmail 20084 invoked by uid 22791); 24 Nov 2011 14:49:25 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Nov 2011 14:49:13 +0000 Received: by yenm2 with SMTP id m2so2926676yen.20 for ; Thu, 24 Nov 2011 06:49:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.240.15 with SMTP id n15mr4901014anh.105.1322146152417; Thu, 24 Nov 2011 06:49:12 -0800 (PST) Received: by 10.100.205.16 with HTTP; Thu, 24 Nov 2011 06:49:12 -0800 (PST) In-Reply-To: References: Date: Fri, 25 Nov 2011 06:02:00 -0000 Message-ID: Subject: Re: Assertion `mutex->__data.__owner From: "Carlos O'Donell" To: trisha yad Cc: libc-help@sourceware.org, gcc-help@gcc.gnu.org, gcc-help@gnu.org Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00251.txt.bz2 On Thu, Nov 24, 2011 at 7:56 AM, trisha yad wrote: > Today on my ARM Board one problem hit. > pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion > `mutex->__data.__owner == 0' failed. > This happen in pthread_mutex_lock.c. > May you pls let me know in which all cases it can happen. It should only happen if: * the atomic operation was *not* atomic and you took a lock owned by another thread. * another thread accidentally corrupted the mutex by writing into it without holding the lock e.g. buffer overrun/underrun etc. * you have a compiler bug that causes the threading library to be incorrectly compiled and violate the ordering requirements the code needs to be atomic. Is it reproducible? Cheers, Carlos. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20263 invoked by alias); 24 Nov 2011 14:49:31 -0000 Received: (qmail 20105 invoked by uid 22791); 24 Nov 2011 14:49:28 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Nov 2011 14:49:17 +0000 Received: from eggs.gnu.org ([140.186.70.92]:50313) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RTabz-00006l-TD for gcc-help@gnu.org; Thu, 24 Nov 2011 09:49:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTaby-0001wK-Ep for gcc-help@gnu.org; Thu, 24 Nov 2011 09:49:15 -0500 Received: from mail-yx0-f169.google.com ([209.85.213.169]:63882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTaby-0001vy-9K for gcc-help@gnu.org; Thu, 24 Nov 2011 09:49:14 -0500 Received: by yenm12 with SMTP id m12so3216820yen.0 for ; Thu, 24 Nov 2011 06:49:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.240.15 with SMTP id n15mr4901014anh.105.1322146152417; Thu, 24 Nov 2011 06:49:12 -0800 (PST) Received: by 10.100.205.16 with HTTP; Thu, 24 Nov 2011 06:49:12 -0800 (PST) In-Reply-To: References: Date: Fri, 25 Nov 2011 06:15:00 -0000 Message-ID: Subject: Re: Assertion `mutex->__data.__owner From: "Carlos O'Donell" To: trisha yad Cc: libc-help@sourceware.org, gcc-help@gcc.gnu.org, gcc-help@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.169 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00252.txt.bz2 Message-ID: <20111125061500.YD2TuCxMqOxh_Joj58URaKqIx9J3MdotiIpe6Pz5uMA@z> On Thu, Nov 24, 2011 at 7:56 AM, trisha yad wrote: > Today on my ARM Board one problem hit. > pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion > `mutex->__data.__owner == 0' failed. > This happen in pthread_mutex_lock.c. > May you pls let me know in which all cases it can happen. It should only happen if: * the atomic operation was *not* atomic and you took a lock owned by another thread. * another thread accidentally corrupted the mutex by writing into it without holding the lock e.g. buffer overrun/underrun etc. * you have a compiler bug that causes the threading library to be incorrectly compiled and violate the ordering requirements the code needs to be atomic. Is it reproducible? Cheers, Carlos.