Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>, Simon Marchi <simark@simark.ca>
Subject: [PATCH] Reduce gdb.base/many-headers.c iterations on Solaris [PR34555]
Date: Sat, 22 Aug 2026 22:40:50 +0200	[thread overview]
Message-ID: <ydda4qdga7h.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

As detailed in PR corefiles/34555, when reading the core file in the
gdb.base/many-headers.exp test, gdb consumes excessive amounts of memory
on Solaris.  If left unchecked, e.g. with ulimit -Sv 8388608, the test
will consume all available swap space.  Since Solaris doesn't do lazy
allocation, this will cause the system to become unusably slow.

To avoid this, this patch reduces the iteration count by a factor of 100.

Tested on sparcv9-sun-solaris2.11, x86_64-pc-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for trunk and the gdb-18 branch?


AFAICT, the issue is purely in gdb's Solaris corefile reader, which
seems to need a complete rewrite rather than a couple of bugfixes.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-many-headers-iter.patch --]
[-- Type: text/x-patch, Size: 626 bytes --]

# HG changeset patch
# Parent  c3dbfb6080fbfc4d3b581adca10f1951ecb880e6
Reduce gdb.base/many-headers.c iterations on Solaris [PR34555]

diff --git a/gdb/testsuite/gdb.base/many-headers.c b/gdb/testsuite/gdb.base/many-headers.c
--- a/gdb/testsuite/gdb.base/many-headers.c
+++ b/gdb/testsuite/gdb.base/many-headers.c
@@ -25,7 +25,12 @@ main (void)
   char *ptr;
   int ind, cnt;
 
+#if defined __sun__ && defined __svr4__
+  /* PR corefiles/34555.  */
+  cnt = 1000;
+#else
   cnt = 100000;
+#endif
   for (ind = 0; ind < cnt; ind++)
     {
       ptr = mmap (NULL, 100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);

                 reply	other threads:[~2026-08-22 20:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ydda4qdga7h.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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