From: "Frank Ch. Eigler" <fche@redhat.com>
To: elfutils-devel@sourceware.org
Subject: obv patch: debuginfod concurrency fix
Date: Wed, 8 Dec 2021 10:47:22 -0500 [thread overview]
Message-ID: <20211208154722.GE6314@redhat.com> (raw)
Hi -
Committing as obvious.
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Wed Dec 8 10:20:58 2021 -0500
debuginfod: correct concurrency bug in fdcache metrics
The intern() function called set_metrics() outside a necessary lock
being held. helgrind identified this race condition. No QA impact.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 8c937d6629a3..8cbaa9aa6fd9 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,7 @@
+2021-12-08 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfod.cxx (intern): Call set_metrics() holding the fdcache mutex.
+
2021-12-04 Mark Wielaard <mark@klomp.org>
* debuginfod-client.c (debuginfod_query_server): Free winning_headers.
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 0d3f02978ee2..a26e7e8fce37 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -1354,8 +1354,8 @@ class libarchive_fdcache
if (verbose > 3)
obatched(clog) << "fdcache interned a=" << a << " b=" << b
<< " fd=" << fd << " mb=" << mb << " front=" << front_p << endl;
+ set_metrics();
}
- set_metrics();
// NB: we age the cache at lookup time too
if (statfs_free_enough_p(tmpdir, "tmpdir", fdcache_mintmp))
reply other threads:[~2021-12-08 15:47 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=20211208154722.GE6314@redhat.com \
--to=fche@redhat.com \
--cc=elfutils-devel@sourceware.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).