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

"ro at CeBiTec dot Uni-Bielefeld.DE 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

--- Comment #2 from Rainer Orth <ro at CeBiTec dot Uni-Bielefeld.DE> ---
Some more insight: while there is the size difference between Linux and
Solaris, that's not the issue here.  Comparing the coredumps with
elfdump, one sees a crucial difference:

While the Solaris core includes the actual data (though without disk
space consumption) of the anon segments

* elfdump:

Program Header[9]:
    p_vaddr:      0x7fffbe6d0000      p_flags:    0
    p_paddr:      0                   p_type:     [ PT_LOAD ]
    p_filesz:     0                   p_memsz:    0x1000
    p_offset:     0                   p_align:    0
    pr_mflags:    [ CORE_NODATA ]

Program Header[10]:
    p_vaddr:      0x7fffbe6d2000      p_flags:    [ PF_W PF_R ]
    p_paddr:      0                   p_type:     [ PT_LOAD ]
    p_filesz:     0x1000              p_memsz:    0x1000
    p_offset:     0x387cec            p_align:    0

* pmap:

00007FFFBE6D0000     4K -------* [ unknown ]
00007FFFBE6D2000     4K rw-----  [ anon ]

Linux does not:

* elfdump:

Program Header[6]:
    p_vaddr:      0x7ac94c08b000      p_flags:    0
    p_paddr:      0                   p_type:     [ PT_LOAD ]
    p_filesz:     0                   p_memsz:    0x1000
    p_offset:     0xab3000            p_align:    0x1000
    pr_mflags:    [ CORE_NODATA ]

Program Header[7]:
    p_vaddr:      0x7ac94c08c000      p_flags:    [ PF_W PF_R ]
    p_paddr:      0                   p_type:     [ PT_LOAD ]
    p_filesz:     0                   p_memsz:    0x1000
    p_offset:     0xab3000            p_align:    0x1000
    pr_mflags:    [ CORE_NODATA ]

* pmap:

7AC94C08B000      4K -------* [ unknown ]
7AC94C08C000      4K rw-----* [ unknown ]

On Linux, the anon segment is marked CORE_NODATA, while on Solaris it's
not.  However, that is easily changed: with coreadm -P default-anon, one
can exclude the anon segments from the coredumps.  This changes the
corefile size from the original

-rw------- 1 ro gcc 797M Aug 21 08:48 many-headers.core

to just

-rw------- 1 ro gcc  16M Aug 21 14:59 many-headers.core

elfdump/pmap confirm that both segments are now marked CORE_NODATA, as
on Linux:

* elfdump:

Program Header[9]:
    p_vaddr:      0x7fffbe6d0000      p_flags:    0
    p_paddr:      0                   p_type:     [ PT_LOAD ]
    p_filesz:     0                   p_memsz:    0x1000
    p_offset:     0                   p_align:    0
    pr_mflags:    [ CORE_NODATA ]

Program Header[10]:
    p_vaddr:      0x7fffbe6d2000      p_flags:    [ PF_W PF_R ]
    p_paddr:      0                   p_type:     [ PT_LOAD ]
    p_filesz:     0                   p_memsz:    0x1000
    p_offset:     0                   p_align:    0
    pr_mflags:    [ CORE_NODATA ]

* pmap:

00007FFFBE6D0000     4K -------* [ unknown ]
00007FFFBE6D2000     4K rw-----* [ unknown ]

However, the gdb memory consumption is still as insanely large as before.

So we are clearly dealing with a gdb issue alone here.

-- 
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.