From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christine Caulfield Date: Thu, 28 Aug 2014 13:00:50 +0100 Subject: [Cluster-devel] [PATCH] liblogthread, fix fclose race Message-ID: <53FF19F2.6060203@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit The mutex in liblogthread protects the list of messages to be printed, but not the FILE*. So the printing thread gets the mutex, takes the entries off the list and then releases it before doing the printing. It's quite possible that the FILE* has been freed by the calling daemon in this gap, thus causing a daemon segfault when the message comes to be printed The fclose/fopen code is already protected by the mutex so it seems to be a simple matter of moving the phthread_mutex_unlock() a little later in the print loop. Signed-Off-By: Christine Caulfield -------------- next part -------------- A non-text attachment was scrubbed... Name: logt_race_stable3.patch Type: text/x-patch Size: 569 bytes Desc: not available URL: