Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Michael Snyder <msnyder@vmware.com>,  Aarthy <aarthy82@gmail.com>
Subject: Re: reg: GDB's generate-core-file option
Date: Tue, 29 Sep 2009 10:20:00 -0000	[thread overview]
Message-ID: <200909291120.42397.pedro@codesourcery.com> (raw)
In-Reply-To: <4AC18D2F.5080809@vmware.com>

On Tuesday 29 September 2009 05:29:35, Michael Snyder wrote:

> > The
> > problem is that for one process i get the following error.
> > 
> > warning: Failed to write corefile contents (No space left on device).
> > ../../gdb/utils.c:1058: internal-error: virtual memory exhausted:
> > can't allocate 92123136 bytes.
> 
> This is an out-of-memory error.  It comes from function "nomem()"
> in utils.c, and results from the failure of an xmalloc() call.
> 
> There is only one xmalloc() call in gcore.c, it looks like this:
> 
>    memhunk = xmalloc (size);

A bit more context around that line on current-ish GDB sources,
shows:

  size = min (total_size, MAX_COPY_BYTES);
  memhunk = xmalloc (size);

and MAX_COPY_BYTES is described as:

 /* The largest amount of memory to read from the target at once.  We
    must throttle it to limit the amount of memory used by GDB during
    generate-core-file for programs with large resident data.  */
 #define MAX_COPY_BYTES (1024 * 1024)

If this is a recent GDB, it can't be that particular xmalloc call.
You must have an old GDB?  This MAX_COPY_BYTES cap was added in 2006.

> > warning: Failed to write corefile contents (No space left on device).
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note that this happens before gdb's internal error.  You're already going
to end up with a partial core.

-- 
Pedro Alves


      reply	other threads:[~2009-09-29 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29  2:09 Aarthy
2009-09-29  3:25 ` Hui Zhu
2009-09-29  4:32 ` Michael Snyder
2009-09-29 10:20   ` Pedro Alves [this message]

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=200909291120.42397.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=aarthy82@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=msnyder@vmware.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