* [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it
@ 2011-08-24 5:47 Brian Harring
2011-08-24 17:54 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Brian Harring @ 2011-08-24 5:47 UTC (permalink / raw)
To: git
This fixes a segfault introduced by 051e400; via it, no longer able to
trigger the http/smartserv race.
Signed-off-by: Brian Harring <ferringb@gmail.com>
---
upload-pack.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/upload-pack.c b/upload-pack.c
index 6420918..8739bfa 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -533,6 +533,8 @@ static void check_non_tip(void)
namebuf[41] = '\n';
for (i = get_max_object_index(); 0 < i; ) {
o = get_indexed_object(--i);
+ if (!o)
+ continue;
if (!(o->flags & OUR_REF))
continue;
memcpy(namebuf + 1, sha1_to_hex(o->sha1), 40);
--
1.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it
2011-08-24 5:47 [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it Brian Harring
@ 2011-08-24 17:54 ` Junio C Hamano
2011-08-24 20:40 ` Brian Harring
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2011-08-24 17:54 UTC (permalink / raw)
To: Brian Harring; +Cc: git
Thanks for a fix.
It is both interesting and disturbing to see that these small mistakes are
discovered a week after the topics hit 'master', even though it has been
cooking in 'next' for a week before that happened (in the case of this
topic, it also hit 'maint' yesterday).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it
2011-08-24 17:54 ` Junio C Hamano
@ 2011-08-24 20:40 ` Brian Harring
2011-08-24 21:10 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Brian Harring @ 2011-08-24 20:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Wed, Aug 24, 2011 at 10:54:51AM -0700, Junio C Hamano wrote:
> Thanks for a fix.
>
> It is both interesting and disturbing to see that these small mistakes are
> discovered a week after the topics hit 'master', even though it has been
> cooking in 'next' for a week before that happened (in the case of this
> topic, it also hit 'maint' yesterday).
I'll admit I'm slightly surprised it slipped past for initial
development- that said, you have to explicitly trigger the race to
trigger the segfault. And that's not easy w/out building out a
custom setup- even w/ that setup, you need to go digging in server
logs to realize the previous serverside failure just converted to a
segfault. Clientside, it hung just the same.
Bit nonobvious. Plus, shit happens. ;)
Either way, I was poking at the source trying to figure out how to get
some unittests for an end to end testing of the http/smartserv; that
said I was having a helluva time finding a way to do it without
bundling a stub of a webserver. Suggestions would be welcome on that
one.
~brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it
2011-08-24 20:40 ` Brian Harring
@ 2011-08-24 21:10 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2011-08-24 21:10 UTC (permalink / raw)
To: Brian Harring; +Cc: git
Brian Harring <ferringb@gmail.com> writes:
> On Wed, Aug 24, 2011 at 10:54:51AM -0700, Junio C Hamano wrote:
>> Thanks for a fix.
>>
>> It is both interesting and disturbing to see that these small mistakes are
>> discovered a week after the topics hit 'master', even though it has been
>> cooking in 'next' for a week before that happened (in the case of this
>> topic, it also hit 'maint' yesterday).
>
> I'll admit I'm slightly surprised it slipped past for initial
> development- that said, you have to explicitly trigger the race to
> trigger the segfault. And that's not easy w/out building out a
> custom setup- even w/ that setup, you need to go digging in server
> logs to realize the previous serverside failure just converted to a
> segfault. Clientside, it hung just the same.
>
> Bit nonobvious. Plus, shit happens. ;)
>
> Either way, I was poking at the source trying to figure out how to get
> some unittests for an end to end testing of the http/smartserv; that
> said I was having a helluva time finding a way to do it without
> bundling a stub of a webserver. Suggestions would be welcome on that
> one.
I probably should have made it clear that I was not complaining, and if it
sounded as if I was complaining at _you_, my deepest apologies.
In any case, thanks, and congratulations for your first commit in git.git
;-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-24 21:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 5:47 [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it Brian Harring
2011-08-24 17:54 ` Junio C Hamano
2011-08-24 20:40 ` Brian Harring
2011-08-24 21:10 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.