From: James Bottomley <James.Bottomley@SteelEye.com>
To: junkio@cox.net
Cc: git@vger.kernel.org, PARISC list <parisc-linux@lists.parisc-linux.org>
Subject: [PATCH] fix git-checkout-cache segfault on parisc
Date: Sat, 13 Aug 2005 10:29:32 -0500 [thread overview]
Message-ID: <1123946972.5115.4.camel@mulgrave> (raw)
This one I think is Linus' fault, so send him a brown paper bag with my
complements ...
The index cleanup code is executed via atexit() which is *after* main
has completed, so the stack allocated cache_file has gone out of scope.
Parisc seems to use stack in the destructor functions, so cache_file
gets partially overwritten leading to the predictable disastrous
consequences.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
---
James
diff --git a/checkout-cache.c b/checkout-cache.c
--- a/checkout-cache.c
+++ b/checkout-cache.c
@@ -80,10 +80,11 @@ static int checkout_all(void)
static const char checkout_cache_usage[] =
"git-checkout-cache [-u] [-q] [-a] [-f] [-n] [--prefix=<string>] [--] <file>...";
+static struct cache_file cache_file;
+
int main(int argc, char **argv)
{
int i, force_filename = 0;
- struct cache_file cache_file;
int newfd = -1;
if (read_cache() < 0) {
diff --git a/index.c b/index.c
reply other threads:[~2005-08-13 15:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1123946972.5115.4.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=parisc-linux@lists.parisc-linux.org \
/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).