This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Assertion `mutex->__data.__owner
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: trisha yad <trisha1march at gmail dot com>
- Cc: libc-help at sourceware dot org, gcc-help at gcc dot gnu dot org, gcc-help at gnu dot org
- Date: Thu, 24 Nov 2011 09:49:12 -0500
- Subject: Re: Assertion `mutex->__data.__owner
- References: <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.