[Bug corefiles/34555] New: gdb memory exhaustion on gdb.base/many-headers.exp

"ro at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34555

            Bug ID: 34555
           Summary: gdb memory exhaustion on gdb.base/many-headers.exp
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: corefiles
          Assignee: unassigned at sourceware dot org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
            Target: *-*-solaris2.11

When running the gdb.base/many-headers.exp test on Solaris, gdb consumes
excessive amounts of memory.  Because Solaris doesn't use lazy allocation,
this eventually consumes all swap, slows the machine to a crawl, and often
requires a reboot.

E.g. the Solaris/amd64 corefile is way larger than its Linux/x86_64
counterpart:
797 MB instead of 11 MB.

The corefile itself is fine: both elfdump and mdb can read it without problems.

The solaris-userland github repo includes a patch to reduce the number of
iterations in many-headers.c from 100000 to 1000.  This reduces the corefile
size to 13 MB and lets the test PASS.  With 10000 iterations instead, the file
grows to 84 MB and still lets gdb consume > 8 GB of RAM (restricted with an
approriate resource limit).

I wonder how best to address this:

* One could reduce the number of iterations as in the patch above.  It's
  certainly better than crashing the machine.

* Alternative, one could just skip the test on Solaris.

However, apart from the massively larger Solaris corefile, I suspect there are
other issues.  The solaris-userland repo used to contain patches to improve
Solaris corefile handling.  When I looked into getting those upstream years
ago, I came to the conclusion that corefile handling doesn't need just a couple
of bugfixes, but a complete rewrite.  I even started this, but things got so
involved (and gdb on Solaris has way more pressing issues) that I eventually
gave up.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.