{"thread":{"id":"27260","subject":"[PATCH] shell: add missing initialization of argv0_path","startedAt":"2011-05-05T06:40:17Z","lastAt":"2011-05-05T16:32:48Z","messageCount":3,"participants":["Dima Sharov","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"167081","messageId":"62D8CA91-5C11-458E-AADB-D8EC8EB99F09@gmail.com","threadId":"27260","inReplyTo":null,"subject":"[PATCH] shell: add missing initialization of argv0_path","fromName":"Dima Sharov","fromEmail":"git.avalakvista@gmail.com","sentAt":"2011-05-05T06:40:17Z","receivedAt":"2011-05-05T06:40:17Z","isPatch":true,"sender":{"key":"git.avalakvista@gmail.com","avatar":null},"body":"According to c6dfb39 (remote-curl: add missing initialization of\nargv0_path, 2009-10-13), stand-alone programs (non-builtins)\nmust call git_extract_argv0_path(argv[0]) in order to help builds\nthat derive the installation prefix at runtime. Without this call,\nthe program segfaults (or raises an assertion failure).\n\nSigned-off-by: Dima Sharov <git.avalakvista@gmail.com>\n---\nshell.c |    2 ++\n1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/shell.c b/shell.c\nindex dea4cfd..abb8622 100644\n--- a/shell.c\n+++ b/shell.c\n@@ -137,6 +137,8 @@ int main(int argc, char **argv)\n\tint devnull_fd;\n\tint count;\n\n+\tgit_extract_argv0_path(argv[0]);\n+\n\t/*\n\t * Always open file descriptors 0/1/2 to avoid clobbering files\n\t * in die().  It also avoids not messing up when the pipes are\n-- \n1.7.2.3\n"},{"id":"167086","messageId":"4DC24A7F.20705@viscovery.net","threadId":"27260","inReplyTo":"62D8CA91-5C11-458E-AADB-D8EC8EB99F09@gmail.com","subject":"Re: [PATCH] shell: add missing initialization of argv0_path","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-05-05T06:58:07Z","receivedAt":"2011-05-05T06:58:07Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/5/2011 8:40, schrieb Dima Sharov:\n> According to c6dfb39 (remote-curl: add missing initialization of\n> argv0_path, 2009-10-13), stand-alone programs (non-builtins)\n> must call git_extract_argv0_path(argv[0]) in order to help builds\n> that derive the installation prefix at runtime. Without this call,\n> the program segfaults (or raises an assertion failure).\n\nGood catch! I checked PROGRAM_OBJS in Makefile, and shell.c was the only\none remaining that did not call this function.\n\n-- Hannes\n"},{"id":"167121","messageId":"7vmxj19kgf.fsf@alter.siamese.dyndns.org","threadId":"27260","inReplyTo":"4DC24A7F.20705@viscovery.net","subject":"Re: [PATCH] shell: add missing initialization of argv0_path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-05T16:32:48Z","receivedAt":"2011-05-05T16:32:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Am 5/5/2011 8:40, schrieb Dima Sharov:\n>> According to c6dfb39 (remote-curl: add missing initialization of\n>> argv0_path, 2009-10-13), stand-alone programs (non-builtins)\n>> must call git_extract_argv0_path(argv[0]) in order to help builds\n>> that derive the installation prefix at runtime. Without this call,\n>> the program segfaults (or raises an assertion failure).\n>\n> Good catch! I checked PROGRAM_OBJS in Makefile, and shell.c was the only\n> one remaining that did not call this function.\n\nThanks for an Ack; the patch was corrupt but was trivial to fix-up.\nWill queue.\n"}]}