obv patch: debuginfod concurrency fix
Commit Message
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>
@@ -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.
@@ -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))