{"thread":{"id":"28203","subject":"[PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it","startedAt":"2011-08-24T05:47:17Z","lastAt":"2011-08-24T21:10:11Z","messageCount":4,"participants":["Brian Harring","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"174137","messageId":"20110824054717.GA16512@localhost","threadId":"28203","inReplyTo":null,"subject":"[PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it","fromName":"Brian Harring","fromEmail":"ferringb@gmail.com","sentAt":"2011-08-24T05:47:17Z","receivedAt":"2011-08-24T05:47:17Z","isPatch":true,"sender":{"key":"ferringb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1531180?v=4"},"body":"This fixes a segfault introduced by 051e400; via it, no longer able to \ntrigger the http/smartserv race.\n\nSigned-off-by: Brian Harring <ferringb@gmail.com>\n---\n upload-pack.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 6420918..8739bfa 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -533,6 +533,8 @@ static void check_non_tip(void)\n \tnamebuf[41] = '\\n';\n \tfor (i = get_max_object_index(); 0 < i; ) {\n \t\to = get_indexed_object(--i);\n+\t\tif (!o)\n+\t\t\tcontinue;\n \t\tif (!(o->flags & OUR_REF))\n \t\t\tcontinue;\n \t\tmemcpy(namebuf + 1, sha1_to_hex(o->sha1), 40);\n-- \n1.7.6\n"},{"id":"174170","messageId":"7vmxeypudw.fsf@alter.siamese.dyndns.org","threadId":"28203","inReplyTo":"20110824054717.GA16512@localhost","subject":"Re: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-24T17:54:51Z","receivedAt":"2011-08-24T17:54:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks for a fix.\n\nIt is both interesting and disturbing to see that these small mistakes are\ndiscovered a week after the topics hit 'master', even though it has been\ncooking in 'next' for a week before that happened (in the case of this\ntopic, it also hit 'maint' yesterday).\n"},{"id":"174188","messageId":"20110824204021.GA28157@beast","threadId":"28203","inReplyTo":"7vmxeypudw.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it","fromName":"Brian Harring","fromEmail":"ferringb@gmail.com","sentAt":"2011-08-24T20:40:21Z","receivedAt":"2011-08-24T20:40:21Z","isPatch":true,"sender":{"key":"ferringb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1531180?v=4"},"body":"On Wed, Aug 24, 2011 at 10:54:51AM -0700, Junio C Hamano wrote:\n> Thanks for a fix.\n> \n> It is both interesting and disturbing to see that these small mistakes are\n> discovered a week after the topics hit 'master', even though it has been\n> cooking in 'next' for a week before that happened (in the case of this\n> topic, it also hit 'maint' yesterday).\n\nI'll admit I'm slightly surprised it slipped past for initial \ndevelopment- that said, you have to explicitly trigger the race to \ntrigger the segfault.  And that's not easy w/out building out a \ncustom setup- even w/ that setup, you need to go digging in server \nlogs to realize the previous serverside failure just converted to a \nsegfault.  Clientside, it hung just the same.\n\nBit nonobvious.  Plus, shit happens. ;)\n\nEither way, I was poking at the source trying to figure out how to get \nsome unittests for an end to end testing of the http/smartserv; that \nsaid I was having a helluva time finding a way to do it without \nbundling a stub of a webserver.  Suggestions would be welcome on that \none.\n\n~brian\n"},{"id":"174190","messageId":"7vpqjuo6rw.fsf@alter.siamese.dyndns.org","threadId":"28203","inReplyTo":"20110824204021.GA28157@beast","subject":"Re: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-08-24T21:10:11Z","receivedAt":"2011-08-24T21:10:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Harring <ferringb@gmail.com> writes:\n\n> On Wed, Aug 24, 2011 at 10:54:51AM -0700, Junio C Hamano wrote:\n>> Thanks for a fix.\n>> \n>> It is both interesting and disturbing to see that these small mistakes are\n>> discovered a week after the topics hit 'master', even though it has been\n>> cooking in 'next' for a week before that happened (in the case of this\n>> topic, it also hit 'maint' yesterday).\n>\n> I'll admit I'm slightly surprised it slipped past for initial \n> development- that said, you have to explicitly trigger the race to \n> trigger the segfault.  And that's not easy w/out building out a \n> custom setup- even w/ that setup, you need to go digging in server \n> logs to realize the previous serverside failure just converted to a \n> segfault.  Clientside, it hung just the same.\n>\n> Bit nonobvious.  Plus, shit happens. ;)\n>\n> Either way, I was poking at the source trying to figure out how to get \n> some unittests for an end to end testing of the http/smartserv; that \n> said I was having a helluva time finding a way to do it without \n> bundling a stub of a webserver.  Suggestions would be welcome on that \n> one.\n\nI probably should have made it clear that I was not complaining, and if it\nsounded as if I was complaining at _you_, my deepest apologies.\n\nIn any case, thanks, and congratulations for your first commit in git.git\n;-)\n"}]}