From: Christine Caulfield <ccaulfie@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] liblogthread, fix fclose race
Date: Thu, 28 Aug 2014 13:00:50 +0100 [thread overview]
Message-ID: <53FF19F2.6060203@redhat.com> (raw)
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 <ccaulfie@redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logt_race_stable3.patch
Type: text/x-patch
Size: 569 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20140828/de0cdb6e/attachment.bin>
reply other threads:[~2014-08-28 12:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53FF19F2.6060203@redhat.com \
--to=ccaulfie@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).