This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: robust pthread_mutex_t in shared memory


* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]