This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: robust pthread_mutex_t in shared memory
- From: Florian Weimer <fweimer at redhat dot com>
- To: Michal Vaško <mvasko at cesnet dot cz>
- Cc: libc-help at sourceware dot org
- Date: Tue, 16 Apr 2019 11:25:32 +0200
- Subject: Re: robust pthread_mutex_t in shared memory
- References: <5961-5cb59080-33-df7e960@28850827>
* Michal Vaško:
> for anyone wondering, I manage to find out what the problem was. It is
> having a mutex on an address not dividable by 2, at least that is what
> it seems on my architecture x86. I have attached a simple program that
> always reproduces the problem for me. If I change HOLE_SIZE to a
> multiple of 2, it does not crash. Can anyone comment on this, please?
> Is this a bug?
It's a bug in your code. The pthread data structures must be allocated
to match their alignment requirements.
Thanks,
Florian