public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: "Alexandra Hájková" <alexandra.khirnova@gmail.com>,
	libc-alpha@sourceware.org
Cc: "Alexandra Hájková" <ahajkova@redhat.com>
Subject: Re: [PATCH] Add valgrind smoke test
Date: Mon, 24 May 2021 10:28:11 -0400	[thread overview]
Message-ID: <d1a8d50a-4dfa-53ed-ff83-595ad82ac3c7@redhat.com> (raw)
In-Reply-To: <20210524121532.1374966-1-ahajkova@redhat.com>

On 5/24/21 8:15 AM, Alexandra Hájková via Libc-alpha wrote:
> From: Alexandra Hájková <ahajkova@redhat.com>
> 
> Check if valgrind is present during the configure time and
> run smoke tests with valgrind to verify dynamic loader.

Thanks for proposing this. We have been running similar valgrind smoke tests
in Fedora Rawhide and it is very beneficial.

> ---
>  Makefile     |  4 +++
>  configure    | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  configure.ac |  1 +
>  elf/Makefile |  8 +++++
>  4 files changed, 106 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 50f99ca611..a9ae15d65e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -146,6 +146,7 @@ GCONV_PATH="$${builddir}/iconvdata"
>  usage () {
>    echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
>    echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
> +  echo "       $$0 --tool=valgrind-test PROGRAM [ARGUMENTS...]" 2>&1

OK. Add valgrind-test to testrun.sh.

>    exit 1
>  }
>  
> @@ -181,6 +182,9 @@ case "$$toolname" in
>    valgrind)
>      exec env $(run-program-env) valgrind $(test-via-rtld-prefix) $${1+"$$@"}
>      ;;
> +  valgrind-test)
> +    exec env $(run-program-env) valgrind -q --error-exitcode=1 $(test-via-rtld-prefix) $${1+"$$@"}
> +    ;;

OK.

>    container)
>      exec env $(run-program-env) $(test-via-rtld-prefix) \
>        $(common-objdir)/support/test-container \
> diff --git a/configure b/configure
> index 5dde2ba355..769341ef05 100755
> --- a/configure
> +++ b/configure

OK.

> --- a/configure.ac
> +++ b/configure.ac
> @@ -52,6 +52,7 @@ fi
>  AC_SUBST(cross_compiling)
>  AC_PROG_CPP
>  AC_CHECK_TOOL(READELF, readelf, false)
> +AC_CHECK_TOOL([VALGRIND], [valgrind], [false])

OK.

>  
>  # We need the C++ compiler only for testing.
>  AC_PROG_CXX
> diff --git a/elf/Makefile b/elf/Makefile
> index 834ec858a8..5b72cc76f9 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -49,6 +49,14 @@ ifeq (yesyes,$(build-shared)$(run-built-tests))
>  tests-special += $(objpfx)list-tunables.out
>  endif
>  
> +# Run smoke tests with valgrind to verify dynamic loader
> +ifneq ($(VALGRIND),false)
> +tests-special += $(objpfx)valgrind-smoke-test.out
> +$(objpfx)valgrind-smoke-test.out: $(objpfx)ld.so
> +	$(common-objpfx)testrun.sh --tool=valgrind-test /usr/bin/true > $@
> +	$(common-objpfx)testrun.sh --tool=valgrind-test /usr/bin/true --help >> $@
> +endif
Does this work for cross-compiling?

Do you correctly detect the target valgrind and does the test wrapper allow the
correct execution of valgrind on the target system?

Please see scripts/cross-test-ssh.sh.

> +
>  # Make sure that the compiler does not insert any library calls in tunables
>  # code paths.
>  ifeq (yes,$(have-loop-to-function))
> 


-- 
Cheers,
Carlos.


  reply	other threads:[~2021-05-24 14:28 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 12:15 Alexandra Hájková
2021-05-24 14:28 ` Carlos O'Donell [this message]
2021-05-24 19:28   ` Joseph Myers
2021-06-28  8:29     ` Florian Weimer
2021-06-28 18:33       ` Joseph Myers
     [not found]     ` <CAJVr-EMvXXXx63a0Ht9iAxo-iV9fMpuo16c7ySqOukN10tpAVA@mail.gmail.com>
2021-07-02 13:18       ` Fwd: " Alexandra Petlanova Hajkova
2021-07-05 20:28         ` Joseph Myers
2021-12-06 14:40 Alexandra Hájková
2021-12-07 11:56 ` Mark Wielaard
2021-12-07 20:32 ` DJ Delorie
2021-12-07 20:58   ` Florian Weimer
2021-12-07 21:10     ` DJ Delorie
2021-12-10 12:56   ` Mark Wielaard
2021-12-10 13:07     ` Florian Weimer
2021-12-10 19:15     ` DJ Delorie
2021-12-13 12:55       ` Mark Wielaard
2021-12-17 18:26 ` Alexandra Hájková
2021-12-17 21:07   ` DJ Delorie
2021-12-20 11:31     ` Alexandra Petlanova Hajkova
2021-12-20 11:37 ` Alexandra Hájková
2022-01-10 12:13   ` Mark Wielaard
2022-01-10 12:38   ` Adhemerval Zanella
2022-01-12 17:15 ` Alexandra Hájková
2022-01-20 19:35   ` Alexandra Hájková
2022-01-24 18:34     ` Joseph Myers
2022-01-26 17:46       ` Joseph Myers
2022-01-26 17:59       ` Mark Wielaard
2022-01-26 18:40         ` Joseph Myers
2022-01-26 19:23           ` Mark Wielaard
2022-01-20 21:29   ` DJ Delorie

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=d1a8d50a-4dfa-53ed-ff83-595ad82ac3c7@redhat.com \
    --to=carlos@redhat.com \
    --cc=ahajkova@redhat.com \
    --cc=alexandra.khirnova@gmail.com \
    --cc=libc-alpha@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).