Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Guinevere Larsen <guinevere@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3] gdb/testsuite: add test for memory requirements of gcore
Date: Tue, 11 Mar 2025 12:14:31 -0400	[thread overview]
Message-ID: <52f3a732-7866-45e8-9070-8f2aa143c5e7@simark.ca> (raw)
In-Reply-To: <20250226175058.3060581-2-guinevere@redhat.com>

On 2/26/25 12:50 PM, Guinevere Larsen wrote:
> For a long time, Fedora has been carrying an out-of-tree patch with a
> similar test to the one proposed in this patch, that ensures that the
> memory requirements don't grow with the inferior's memory. It's been
> so long that the context for why this test exists has been lost, but
> it looked like it could be interesting for upstream.
> 
> The test runs twice, once with the inferior allocating 4Mb of memory,
> and the other allocating 64Mb. My plan was to find the rate at which
> things increase based on inferior size, and have that tested to ensure
> we're not growing that requirement accidentally, but my testing
> actually showed memory requirements going down as the inferior increases,
> so instead I just hardcoded that we need less than 2Mb for the command,
> and it can be tweaked later if necessary.
> ---
> 
> Linaro flagged an issue in v2, where GDB couldn't set a breakpoint in
> line 51 (where i was incremented). That sounds like a gcc issue,
> optimizing i away because it was unused, but to avoid having this come
> and go as GCC changes, I changed to set a bp directly on the sleep line.
> This should work now.

On my CI, I see:

  The gcore command used 2 Mb (3004 Kb)
  FAIL: gdb.base/gcore-memory-usage.exp: 4 Mb: gdb did not use too much memory

  The gcore command used 2 Mb (3004 Kb)
  FAIL: gdb.base/gcore-memory-usage.exp: 64 Mb: gdb did not use too much memory

Locally if I try to build with the same configuration, I get:

  The gcore command used 1 Mb (1640 Kb)
  PASS: gdb.base/gcore-memory-usage.exp: 64 Mb: gdb did not use too much memory

I don't know why there's a difference.  It's not the same distribution
or tool versions, it could be a lot of things.

Note that I build with Asan, UBSan and -D_GLIBCXX_DEBUG=1, all of which
can raise the memory usage.  Also, on the CI, the workers are
containers, so perhaps it does something to the reported stats.

I don't really know if I should investigate that further or just bump
the threshold for "too much memory".

Simon

  parent reply	other threads:[~2025-03-11 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 14:04 [PATCH] " Guinevere Larsen
2025-02-24 15:24 ` Tom de Vries
2025-02-24 19:47   ` Guinevere Larsen
2025-02-24 18:21 ` Andrew Burgess
2025-02-24 20:00   ` Guinevere Larsen
2025-02-24 20:18     ` Guinevere Larsen
2025-02-25 13:45 ` [PATCH v2] " Guinevere Larsen
2025-02-26 17:50   ` [PATCH v3] " Guinevere Larsen
2025-03-04 18:19     ` Tom Tromey
2025-03-05 20:03       ` Guinevere Larsen
2025-03-05 20:21         ` Tom Tromey
2025-03-05 20:39           ` Guinevere Larsen
2025-03-11 16:14     ` Simon Marchi [this message]
2025-03-11 16:43       ` Guinevere Larsen

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=52f3a732-7866-45e8-9070-8f2aa143c5e7@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.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