git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Todd Zullinger <tmz@pobox.com>
Cc: Elia Pinto <gitter.spiros@gmail.com>,
	Usman Akinyemi <usmanakinyemi202@gmail.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	Christian Couder <christian.couder@gmail.com>,
	git@vger.kernel.org
Subject: Re: [RFC]: Test Were failing on Fedora Linux.
Date: Sat, 9 Nov 2024 14:00:12 -0500	[thread overview]
Message-ID: <20241109190012.GA588841@coredump.intra.peff.net> (raw)
In-Reply-To: <Zy-IYwjb_RO5NW-s@teonanacatl.net>

On Sat, Nov 09, 2024 at 11:05:55AM -0500, Todd Zullinger wrote:

> The 64-bit libc_malloc_debug.so.0 is in /lib64 and was moved
> to the glibc-utils package in Fedora 40, with 2c1b0f0 (Move
> memory tracing libraries to glibc-utils, 2024-05-15)¹.  The
> commit message notes:
> 
>     On x86_64, glibc-utils will now only contain the 64-bit
>     version of these libraries but still need the 32-bit
>     version (in order to support tracing i686 applications).
>     Therefore, on i686 the libraries remain in the main
>     glibc package.
> 
> If you're interested in installing the various dependencies
> needed to run the test suite on Fedora, take a look at the
> Fedora git package spec file².

Hmm. I wonder if our test scripts could be a little more forgiving here.

The glibc malloc debugging stuff has always been turned on by default
since a731fa916e (Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the
test suite for detecting heap corruption, 2012-09-14). Back then the
setup just involved setting some environment variables. If we were on a
system where it didn't exist, it was no big deal. We'd just run without
it.

That changed in 131b94a10a (test-lib.sh: Use GLIBC_TUNABLES instead of
MALLOC_CHECK_ on glibc >= 2.34, 2022-03-04). Now that glibc split this
out into libc_malloc_debug.so, we have to add it to LD_PRELOAD. We only
do that when we detect glibc, but it sounds like it's possible to have
glibc but not the malloc debug library. In which case we'll produce
errors (at the very least it seems like ld.so will complain to stderr,
which perhaps is the source of the test failures here).

Can we do a better job of detecting that the library is available?

I don't offhand know of a good portable way to ask the system about
available libraries. But I guess just doing something like:

  err=$(LD_PRELOAD=libc_malloc.so.0 git version 2>&1 >/dev/null)
  if test -z "$err"
  then
	...seemed to work...
  fi

would do it? I dunno. Maybe this is not a common enough thing to worry
about. It just seems bad for us to make life harder for people running
the tests for an optional thing.

  Side note: The glibc malloc stuff seems a bit more redundant these
  days, since we run with ASan in CI (which I'd expect to catch a
  superset of what the malloc debugging would). There is some value in
  catching things sooner, though (I don't usually do an ASan run on my
  workstation, and of course some people may not use CI at all).

-Peff

  reply	other threads:[~2024-11-09 19:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-09  6:01 [RFC]: Test Were failing on Fedora Linux Usman Akinyemi
2024-11-09  8:12 ` Christian Couder
2024-11-09  9:32   ` Usman Akinyemi
2024-11-09 14:01     ` Christian Couder
2024-11-09 14:35       ` Andreas Schwab
2024-11-09 15:02         ` Usman Akinyemi
2024-11-09 16:05           ` Todd Zullinger
2024-11-09 19:00             ` Jeff King [this message]
2024-11-09 19:12               ` Usman Akinyemi
2024-11-11  3:11               ` Junio C Hamano
2024-11-11  7:01                 ` [PATCH] test-lib: check malloc debug LD_PRELOAD before using Jeff King
2024-11-13 10:19                   ` Toon Claes
2024-11-14  1:27                     ` Jeff King
2024-11-14  1:39                       ` [PATCH 2/1] test-lib: move malloc-debug setup after $PATH setup Jeff King
2024-11-20 13:51                         ` Toon Claes
2024-11-20 23:26                           ` Junio C Hamano
2024-11-09 19:09             ` [RFC]: Test Were failing on Fedora Linux Usman Akinyemi
2024-11-09 14:59       ` Usman Akinyemi

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=20241109190012.GA588841@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitter.spiros@gmail.com \
    --cc=schwab@linux-m68k.org \
    --cc=tmz@pobox.com \
    --cc=usmanakinyemi202@gmail.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).