Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Snyder <michsnyd@cisco.com>
Cc: gdb-patches@sources.redhat.com, gdb@sources.redhat.com
Subject: Re: [RFC] What to do on VM exhaustion
Date: Fri, 06 Jan 2006 08:50:00 -0000	[thread overview]
Message-ID: <uhd8hivtg.fsf@gnu.org> (raw)
In-Reply-To: <43BD965C.1080500@cisco.com> (message from Michael Snyder on Thu, 	05 Jan 2006 13:57:48 -0800)

> Date: Thu, 05 Jan 2006 13:57:48 -0800
> From: Michael Snyder <michsnyd@cisco.com>
> 
> > Perhaps we could do better: we could notice the memory usage each time
> > through the top-level command loop, just before invoking the command
> > dispatch, and then, if we ran out of memory during a command, we could
> > conclude that the last command is the culprit, and throw back to the
> > top level.  That would free the memory used up by that last command,
> > and GDB could ``recover gracefully'', as RMS wanted. 
> 
> It would take more than that.  For instance, the failure I'm seeing
> is on trying to load a huge symbol file.  For graceful recovery,
> we would need to register a "cleanup" that would unload the newly
> (partially) created symtab.

I assumed that we always do this.  If not, we should indeed add such a
cleanup, particularly before loading symtabs, since those are known as
memory hogs.

>  > If that doesn't
> > help, then yes, abort with internal error, since that means GDB leaks
> > some significant memory. 
> 
> That's what it currently does -- but it stumbles because internal_error
> calls query, which does console I/O, which needs to allocate memory,
> which fails, which causes it to recurse back into nomem.

Then we should do what someone else suggested: reserve a small buffer
in advance and free it when we detect the memory exhausted situation,
before internal_error is called.

But I think we should also add graceful recovery from such situations,
where possible.

> Instead, we could (for instance) call write (<fd of stderr>, "VM
> exhausted\n") and then abort or exit.

That might defeat front ends, so I think we should do this only as the
last resort.


  parent reply	other threads:[~2006-01-06  8:50 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 [this message]
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

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=uhd8hivtg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=michsnyd@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