public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@systemhalted.org>
To: trisha yad <trisha1march@gmail.com>
Cc: libc-help@sourceware.org, gcc-help@gcc.gnu.org, gcc-help@gnu.org
Subject: Re: Assertion `mutex->__data.__owner
Date: Fri, 25 Nov 2011 06:02:00 -0000	[thread overview]
Message-ID: <CADZpyizDcCyGE8mW2WtjwmvTmamqgw3Z=9vK3N5Zo-+djj97UA@mail.gmail.com> (raw)
In-Reply-To: <CAGr+u+z8ec8_35pndhfb+_Zz4ARyNHRj0fxPv4XGORPfKh862Q@mail.gmail.com>

On Thu, Nov 24, 2011 at 7:56 AM, trisha yad <trisha1march@gmail.com> 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.

WARNING: multiple messages have this Message-ID
From: "Carlos O'Donell" <carlos@systemhalted.org>
To: trisha yad <trisha1march@gmail.com>
Cc: libc-help@sourceware.org, gcc-help@gcc.gnu.org, gcc-help@gnu.org
Subject: Re: Assertion `mutex->__data.__owner
Date: Fri, 25 Nov 2011 06:15:00 -0000	[thread overview]
Message-ID: <CADZpyizDcCyGE8mW2WtjwmvTmamqgw3Z=9vK3N5Zo-+djj97UA@mail.gmail.com> (raw)
Message-ID: <20111125061500.YD2TuCxMqOxh_Joj58URaKqIx9J3MdotiIpe6Pz5uMA@z> (raw)
In-Reply-To: <CAGr+u+z8ec8_35pndhfb+_Zz4ARyNHRj0fxPv4XGORPfKh862Q@mail.gmail.com>

On Thu, Nov 24, 2011 at 7:56 AM, trisha yad <trisha1march@gmail.com> 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.

  parent reply	other threads:[~2011-11-24 14:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 15:10 trisha yad
2011-11-25  5:34 ` trisha yad
2011-11-25  6:02 ` Carlos O'Donell [this message]
2011-11-25  6:15   ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADZpyizDcCyGE8mW2WtjwmvTmamqgw3Z=9vK3N5Zo-+djj97UA@mail.gmail.com' \
    --to=carlos@systemhalted.org \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc-help@gnu.org \
    --cc=libc-help@sourceware.org \
    --cc=trisha1march@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).