Re: [Qemu-devel] [PATCH 1/2] qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK

2015-03-07 Thread Paolo Bonzini
On 06/03/2015 16:54, Eric Blake wrote: > > The problem is that releasing error-checking locks in the child > > fails under glibc with EPERM, because the mutex stores a different > > owner tid than the duplicated thread in the child process. > > Is that a bug in glibc? Possibly, but I wouldn't b

Re: [Qemu-devel] [PATCH 1/2] qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK

2015-03-06 Thread Eric Blake
On 03/06/2015 02:22 AM, Paolo Bonzini wrote: > PTHREAD_MUTEX_ERRORCHECK is completely broken with respect to fork. > The way to safely do fork is to bring all threads to a quiescent > state by acquiring locks (either in callers---as we do for the > iothread mutex---or using pthread_atfork's prepare

[Qemu-devel] [PATCH 1/2] qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK

2015-03-06 Thread Paolo Bonzini
PTHREAD_MUTEX_ERRORCHECK is completely broken with respect to fork. The way to safely do fork is to bring all threads to a quiescent state by acquiring locks (either in callers---as we do for the iothread mutex---or using pthread_atfork's prepare callbacks) and then release them in the child. The