From: "Shawn O. Pearce" <spearce@spearce.org>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Jim Meyering <jim@meyering.net>, git list <git@vger.kernel.org>
Subject: Re: [PATCH] use xstrdup, not strdup in ll-merge.c
Date: Mon, 15 Jun 2009 07:26:48 -0700 [thread overview]
Message-ID: <20090615142648.GV16497@spearce.org> (raw)
In-Reply-To: <81b0412b0906150546p34ff53ceo81ea59785cf9d18a@mail.gmail.com>
Alex Riesen <raa.lkml@gmail.com> wrote:
> 2009/6/15 Jim Meyering <jim@meyering.net>:
> > Alex Riesen wrote:
> >> 2009/6/15 Jim Meyering <jim@meyering.net>:
> >>>
> >>> Exactly. ??This is why I think it's not worthwhile to invest in
> >>> a more precise diagnostic, here.
Sorry Alex, but I have to agree with Jim here. Use xstrdup()
and its friends and move on with life.
> As much as I'd like to know as much as possible about why something
> failed, I can't make a failure handling automatically simple (given the tools).
> I do suggest using goto to handle this particular OOM (below), but it looks
> almost too ugly. Maybe I am just paranoid, and am overdoing this particular
> case.
Yes, this is horrible. Its a huge amount of code for checking a
strdup failure that is unlikely to occur out of a configuration file.
Really, how big is that config file? It can't be so large that a
strdup() is likely to run out of memory pulling a value from it.
And even if it does run out of memory, unless we can reclaim space
by shedding pack windows, we're doomed, we can't continue executing.
The official error is "out of memory", most likely due to too low
of a rlimit on our heap, and the only resolution is to boost the
rlimit higher, not something we can do in our process if we're
already hitting the hard limit.
> The "goto oom" patch:
NAK. We don't do this anywhere else in git. Please don't start now.
--
Shawn.
next prev parent reply other threads:[~2009-06-15 14:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-14 19:47 [PATCH] use xstrdup, not strdup in ll-merge.c Jim Meyering
2009-06-14 22:03 ` Alex Riesen
2009-06-15 8:02 ` Jim Meyering
2009-06-15 8:45 ` Alex Riesen
2009-06-15 9:23 ` Jim Meyering
2009-06-15 11:39 ` Alex Riesen
2009-06-15 11:49 ` Jim Meyering
2009-06-15 12:46 ` Alex Riesen
2009-06-15 14:26 ` Shawn O. Pearce [this message]
2009-06-15 15:21 ` Alex Riesen
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=20090615142648.GV16497@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=jim@meyering.net \
--cc=raa.lkml@gmail.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;
as well as URLs for NNTP newsgroup(s).