Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <michsnyd@cisco.com>
To: kmacy@fsmware.com
Cc: Paul Koning <pkoning@equallogic.com>,
	gdb@sources.redhat.com,         gdb-patches@sources.redhat.com,
	wendyp@cisco.com
Subject: Re: [RFC] What to do on VM exhaustion
Date: Fri, 06 Jan 2006 03:16:00 -0000	[thread overview]
Message-ID: <43BDE115.3020601@cisco.com> (raw)
In-Reply-To: <b1fa29170601051800n452bda22sc28082a2776c858@mail.gmail.com>

Kip Macy wrote:
> 
> On 1/5/06, *Michael Snyder* <michsnyd@cisco.com 
> <mailto:michsnyd@cisco.com>> wrote:
> 
>     Kip Macy wrote:
>      > Why not just pre-allocate a small arena at startup for an "emergency"
>      > malloc? Hardly ideal, but it would allow gdb to fail gracefully.
> 
>     Wouldn't that require modifying malloc?
> 
> 
>     Or do you have in mind that, on detecting out-of-VM, we would
>     free our little reserved chunk, thus making it available for
>     libc (or whatever)?
> 
> 
> What I had in mind was that if we detect out-of-VM we set a flag so that 
> internal_error would allocate memory from the pre-allocated emergency 
> memory.

Internal error doesn't allocate memory.  It calls query, which calls
something else, which eventually calls malloc.  Hence we would have to
change the behavior of malloc.

 > Or, if there were some way of recovering, but it required some
> interim memory, you could allocate from the emergency memory in the 
> recovery path.

Well, all allocation is ultimately done by malloc.  OK with some
exceptions, but in general, that's where we're hitting the problem.
This sounds like modifying malloc.

On the other hand, the idea of freeing an emergency reserve just before
calling query might have some virtue...



      parent reply	other threads:[~2006-01-06  3:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-05  1:00 Michael Snyder
2006-01-05  5:13 ` Eli Zaretskii
     [not found]   ` <43BD965C.1080500@cisco.com>
2006-01-06  8:50     ` Eli Zaretskii
2006-01-05 14:50 ` Paul Koning
2006-01-05 22:00   ` Michael Snyder
     [not found]     ` <b1fa29170601051725t2fc37a96r2dc959a45a2aa92f@mail.gmail.com>
2006-01-06  1:35       ` Michael Snyder
     [not found]         ` <b1fa29170601051800n452bda22sc28082a2776c858@mail.gmail.com>
2006-01-06  3:16           ` Michael Snyder [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=43BDE115.3020601@cisco.com \
    --to=michsnyd@cisco.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=kmacy@fsmware.com \
    --cc=pkoning@equallogic.com \
    --cc=wendyp@cisco.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