[Bug 279901] glibc-2.39-2 and above on the host segfault

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 17 Dec 2024 16:59:36 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279901

--- Comment #36 from Florian Weimer <fweimer@redhat.com> ---
Thanks for the offers of machine access.

I should have studied the ld.so --list-diagnostics output. It's a recurrence of
the previous rep_movsb_threshold bug because it ends up as zero. The bhyve bug
that triggers this is that it reports 1 TiB of L3 cache
(x86.cpu_features.level3_cache_size=0x10000000000 in the diagnostic output).
This triggers an integer truncation in glibc's cache size computation.
Misreporting cache information like this typically impacts performance, so it
should be fixed independently of the glibc bug.

The glibc bug is below. I'll submit it upstream and we'll backport it.

diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
index e9579505..6a0a30ba 100644
--- a/sysdeps/x86/dl-cacheinfo.h
+++ b/sysdeps/x86/dl-cacheinfo.h
@@ -1021,11 +1021,11 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
     non_temporal_threshold = maximum_non_temporal_threshold;

   /* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8.  */
-  unsigned int minimum_rep_movsb_threshold;
+  unsigned long int minimum_rep_movsb_threshold;
   /* NB: The default REP MOVSB threshold is 4096 * (VEC_SIZE / 16) for
      VEC_SIZE == 64 or 32.  For VEC_SIZE == 16, the default REP MOVSB
      threshold is 2048 * (VEC_SIZE / 16).  */
-  unsigned int rep_movsb_threshold;
+  unsigned long int rep_movsb_threshold;
   if (CPU_FEATURE_USABLE_P (cpu_features, AVX512F)
       && !CPU_FEATURE_PREFERRED_P (cpu_features, Prefer_No_AVX512))
     {

With this fix, the testsuite is very clean, only nptl/tst-mutex10 fails with a
test timeout. Cause is unclear. (The test does not actually use elision because
the system does not support RTM.)

-- 
You are receiving this mail because:
You are the assignee for the bug.