From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 3FFD63858CDA; Mon, 22 Apr 2024 18:39:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FFD63858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713811199; bh=jjFxOkblO+aMDeS0y1IdmbjdmqKPNrLnZt1yXE6LcB8=; h=From:To:Subject:Date:From; b=YhiB/NY95gSpR7q/Gvw1Kaxuzt8DdMRudzrw9scxz3NKO0lWmX36+r/ylbRo772ZY H980ew/nNHXGqpbAbvrQzA/C/bKN/k2h+tlg5obBpp1nqR0+A4XANhOCVqwUNFJdF/ 8/c5VcZjAJa7aCqD2ILTR67VBvXn7z3pBZQal31U= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: f6d18bea387676e774e18ce410ace8c33a5c3511 X-Git-Newrev: 25b191f6d33cda5770a18fd18be86cce0ebb3228 Message-Id: <20240422183959.3FFD63858CDA@sourceware.org> Date: Mon, 22 Apr 2024 18:39:59 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=25b191f6d33cda5770a18fd18be86cce0ebb3228 commit 25b191f6d33cda5770a18fd18be86cce0ebb3228 Author: Adhemerval Zanella Date: Tue Mar 26 10:47:42 2024 -0300 elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) On some architectures and depending on the page size, the loader can also allocate some memory during dependencies loading and it will be marked as 'loader malloc'. However, if the system page size is large enough, the initial data page will be enough for all required allocation and there will be no extra loader mmap. To avoid false negatives, the test does not check for such pages. Checked on powerpc64le-linux-gnu with 64k pagesize. Reviewed-by: Simon Chopin Diff: --- elf/tst-decorate-maps.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/elf/tst-decorate-maps.c b/elf/tst-decorate-maps.c index 85ba5ce939..6d04344ba2 100644 --- a/elf/tst-decorate-maps.c +++ b/elf/tst-decorate-maps.c @@ -56,7 +56,6 @@ struct proc_maps_t int n_user_threads; int n_arenas; int n_malloc_mmap; - int n_loader_malloc_mmap; }; static struct proc_maps_t @@ -82,8 +81,12 @@ read_proc_maps (void) r.n_arenas++; else if (strstr (line, "[anon: glibc: malloc]") != NULL) r.n_malloc_mmap++; - else if (strstr (line, "[anon: glibc: loader malloc]") != NULL) - r.n_loader_malloc_mmap++; + /* On some architectures and depending on the page size, the loader can + also allocate some memory during dependencies loading and it will be + marked as 'loader malloc'. However, if the system page size is large + enough, the initial data page will be enough for all required + allocation and there will be no extra loader mmap. To avoid false + negatives, the test does not check for such pages. */ } free (line); xfclose (f); @@ -148,8 +151,6 @@ do_test_threads (bool set_guard) TEST_COMPARE (r.n_user_threads, num_user_threads); TEST_COMPARE (r.n_arenas, expected_n_arenas); TEST_COMPARE (r.n_malloc_mmap, 1); - /* On some architectures the loader might use more than one page. */ - TEST_VERIFY (r.n_loader_malloc_mmap >= 1); } /* Let the threads finish. */ @@ -164,7 +165,6 @@ do_test_threads (bool set_guard) TEST_COMPARE (r.n_user_threads, 0); TEST_COMPARE (r.n_arenas, expected_n_arenas); TEST_COMPARE (r.n_malloc_mmap, 1); - TEST_VERIFY (r.n_loader_malloc_mmap >= 1); } free (p);