{"thread":{"id":"9277","subject":"[PATCH] Don't rely on unspecified behavior","startedAt":"2007-07-28T16:39:38Z","lastAt":"2007-07-28T20:20:54Z","messageCount":11,"participants":["Thomas Schwinge","Thomas Glanzmann","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"48913","messageId":"11856407793933-git-send-email-tschwinge@gnu.org","threadId":"9277","inReplyTo":null,"subject":"[PATCH] Support building on GNU/Hurd","fromName":"Thomas Schwinge","fromEmail":"tschwinge@gnu.org","sentAt":"2007-07-28T16:39:38Z","receivedAt":"2007-07-28T16:39:38Z","isPatch":true,"sender":{"key":"tschwinge@gnu.org","avatar":"https://gravatar.com/avatar/426899ead04ada2363e81520b70cbc91cfbc790c2ba8fab9ad14404b89f3dc88?d=mp&s=160"},"body":"GNU/Hurd systems don't have strlcpy either.\n\nSigned-off-by: Thomas Schwinge <tschwinge@gnu.org>\n---\n Makefile |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2fea115..8d9a01b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -458,6 +458,10 @@ ifeq ($(uname_S),AIX)\n \tNO_STRLCPY = YesPlease\n \tNEEDS_LIBICONV=YesPlease\n endif\n+ifeq ($(uname_S),GNU)\n+\t# GNU/Hurd\n+\tNO_STRLCPY=YesPlease\n+endif\n ifeq ($(uname_S),IRIX64)\n \tNO_IPV6=YesPlease\n \tNO_SETENV=YesPlease\n-- \n1.5.3.rc3.26.g6c58-dirty\n"},{"id":"48912","messageId":"11856407791617-git-send-email-tschwinge@gnu.org","threadId":"9277","inReplyTo":"11856407793933-git-send-email-tschwinge@gnu.org","subject":"[PATCH] Don't rely on unspecified behavior","fromName":"Thomas Schwinge","fromEmail":"tschwinge@gnu.org","sentAt":"2007-07-28T16:39:39Z","receivedAt":"2007-07-28T16:39:39Z","isPatch":true,"sender":{"key":"tschwinge@gnu.org","avatar":"https://gravatar.com/avatar/426899ead04ada2363e81520b70cbc91cfbc790c2ba8fab9ad14404b89f3dc88?d=mp&s=160"},"body":"Calling access(p, m) with p == NULL is not specified, so don't do that.  On\nGNU/Hurd systems doing so will result in an SIGSEGV.\n\nSigned-off-by: Thomas Schwinge <tschwinge@gnu.org>\n---\n builtin-add.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-add.c b/builtin-add.c\nindex 5e6748f..c13c738 100644\n--- a/builtin-add.c\n+++ b/builtin-add.c\n@@ -74,7 +74,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec)\n \tpath = git_path(\"info/exclude\");\n \tif (!access(path, R_OK))\n \t\tadd_excludes_from_file(dir, path);\n-\tif (!access(excludes_file, R_OK))\n+\tif (excludes_file != NULL && !access(excludes_file, R_OK))\n \t\tadd_excludes_from_file(dir, excludes_file);\n \n \t/*\n-- \n1.5.3.rc3.26.g6c58-dirty\n"},{"id":"48916","messageId":"20070728173948.GD23337@cip.informatik.uni-erlangen.de","threadId":"9277","inReplyTo":"11856407791617-git-send-email-tschwinge@gnu.org","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-07-28T17:39:48Z","receivedAt":"2007-07-28T17:39:48Z","isPatch":true,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello,\n\n> Calling access(p, m) with p == NULL is not specified, so don't do\n> that.  On GNU/Hurd systems doing so will result in an SIGSEGV.\n\na friend of mine choked on this one when tried git for the second time\n(the first time \"git-repack -a -d -f\" screwed his repository after the\ninitial checkout. This is fixed for a long time). Lucky me that he had\nhis libusbdriver in LD_PRELOAD which could not handle the NULL argument.\nAnd I always thought libc would make the check before it does the system\ncall or does GNU/hurts not use the gnu libc?\n\n\tThomas\n"},{"id":"48919","messageId":"20070728182542.GA22651@fencepost.gnu.org","threadId":"9277","inReplyTo":"20070728173948.GD23337@cip.informatik.uni-erlangen.de","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Thomas Schwinge","fromEmail":"tschwinge@gnu.org","sentAt":"2007-07-28T18:25:42Z","receivedAt":"2007-07-28T18:25:42Z","isPatch":true,"sender":{"key":"tschwinge@gnu.org","avatar":"https://gravatar.com/avatar/426899ead04ada2363e81520b70cbc91cfbc790c2ba8fab9ad14404b89f3dc88?d=mp&s=160"},"body":"Hello!\n\nOn Sat, Jul 28, 2007 at 07:39:48PM +0200, Thomas Glanzmann wrote:\n> > Calling access(p, m) with p == NULL is not specified, so don't do\n> > that.  On GNU/Hurd systems doing so will result in an SIGSEGV.\n> \n> a friend of mine choked on this one when tried git for the second time\n> (the first time \"git-repack -a -d -f\" screwed his repository after the\n> initial checkout. This is fixed for a long time). Lucky me that he had\n> his libusbdriver in LD_PRELOAD which could not handle the NULL argument.\n> And I always thought libc would make the check before it does the system\n> call or does GNU/hurts not use the gnu libc?\n\nGNU/Hurd systems do (obviously ;-) use the GNU libc.  The glibc\nmaintainer Roland McGrath explicitly told me that ``access (NULL, m)''\nshall not be caught as it is not specified and thus must not be invoked\nlike this.\n\n\nI noticed that the patch I sent was prepared for an old version of the\nfile.  I'll send an updated patch that applies to the current revision.\n\n\nRegards,\n Thomas\n"},{"id":"48920","messageId":"11856471952272-git-send-email-tschwinge@gnu.org","threadId":"9277","inReplyTo":"20070728173948.GD23337@cip.informatik.uni-erlangen.de","subject":"[PATCH] Don't rely on unspecified behavior","fromName":"Thomas Schwinge","fromEmail":"tschwinge@gnu.org","sentAt":"2007-07-28T18:26:35Z","receivedAt":"2007-07-28T18:26:35Z","isPatch":true,"sender":{"key":"tschwinge@gnu.org","avatar":"https://gravatar.com/avatar/426899ead04ada2363e81520b70cbc91cfbc790c2ba8fab9ad14404b89f3dc88?d=mp&s=160"},"body":"Calling access(p, m) with p == NULL is not specified, so don't do that.  On\nGNU/Hurd systems doing so will result in a SIGSEGV.\n\nSigned-off-by: Thomas Schwinge <tschwinge@gnu.org>\n---\n builtin-add.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-add.c b/builtin-add.c\nindex 7345479..de5c108 100644\n--- a/builtin-add.c\n+++ b/builtin-add.c\n@@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,\n \t\tpath = git_path(\"info/exclude\");\n \t\tif (!access(path, R_OK))\n \t\t\tadd_excludes_from_file(dir, path);\n-\t\tif (!access(excludes_file, R_OK))\n+\t\tif (excludes_file != NULL && !access(excludes_file, R_OK))\n \t\t\tadd_excludes_from_file(dir, excludes_file);\n \t}\n \n-- \n1.5.3.rc3.26.g6c58-dirty\n"},{"id":"48923","messageId":"Pine.LNX.4.64.0707282028130.14781@racer.site","threadId":"9277","inReplyTo":"11856471952272-git-send-email-tschwinge@gnu.org","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-28T19:30:07Z","receivedAt":"2007-07-28T19:30:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 28 Jul 2007, Thomas Schwinge wrote:\n\n> Calling access(p, m) with p == NULL is not specified, so don't do that.  On\n> GNU/Hurd systems doing so will result in a SIGSEGV.\n> \n> Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>\n> ---\n\nIsn't this the same patch as you sent before?\n\n>  builtin-add.c |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/builtin-add.c b/builtin-add.c\n> index 7345479..de5c108 100644\n> --- a/builtin-add.c\n> +++ b/builtin-add.c\n> @@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,\n>  \t\tpath = git_path(\"info/exclude\");\n>  \t\tif (!access(path, R_OK))\n>  \t\t\tadd_excludes_from_file(dir, path);\n> -\t\tif (!access(excludes_file, R_OK))\n> +\t\tif (excludes_file != NULL && !access(excludes_file, R_OK))\n\nWe usually omit the \"!= NULL\"; see the other source code in git.git.\n\nCiao,\nDscho\n"},{"id":"48924","messageId":"20070728193402.GE23337@cip.informatik.uni-erlangen.de","threadId":"9277","inReplyTo":"Pine.LNX.4.64.0707282028130.14781@racer.site","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-07-28T19:34:02Z","receivedAt":"2007-07-28T19:34:02Z","isPatch":true,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello Dscho,\n\n> Isn't this the same patch as you sent before?\n\n> > @@ -74,7 +74,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec)\n> > @@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,\n       ~~~~~ ~~~~~                                                                            ~\n\nThe offset of the diff has changed. Not that git couldn't sort it out by\nitself. And the function had one or more parameters less.\n\n\tThomas\n"},{"id":"48926","messageId":"20070728194306.GA32203@fencepost.gnu.org","threadId":"9277","inReplyTo":"Pine.LNX.4.64.0707282028130.14781@racer.site","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Thomas Schwinge","fromEmail":"tschwinge@gnu.org","sentAt":"2007-07-28T19:43:06Z","receivedAt":"2007-07-28T19:43:06Z","isPatch":true,"sender":{"key":"tschwinge@gnu.org","avatar":"https://gravatar.com/avatar/426899ead04ada2363e81520b70cbc91cfbc790c2ba8fab9ad14404b89f3dc88?d=mp&s=160"},"body":"Hello!\n\nOn Sat, Jul 28, 2007 at 08:30:07PM +0100, Johannes Schindelin wrote:\n> On Sat, 28 Jul 2007, Thomas Schwinge wrote:\n> > Calling access(p, m) with p == NULL is not specified, so don't do that.  On\n> > GNU/Hurd systems doing so will result in a SIGSEGV.\n> > \n> > Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>\n> > ---\n> \n> Isn't this the same patch as you sent before?\n\nAs I wrote in <20070728182542.GA22651@fencepost.gnu.org>: ``I noticed\nthat the patch I sent was prepared for an old version of the file.  I'll\nsend an updated patch that applies to the current revision.''\n\n> > +\t\tif (excludes_file != NULL && !access(excludes_file, R_OK))\n> \n> We usually omit the \"!= NULL\"; see the other source code in git.git.\n\nOkay, so I should sent a thusly modified version to get it applied?\n\n\nRegards,\n Thomas\n"},{"id":"48931","messageId":"Pine.LNX.4.64.0707282115450.14781@racer.site","threadId":"9277","inReplyTo":"20070728193402.GE23337@cip.informatik.uni-erlangen.de","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-28T20:16:01Z","receivedAt":"2007-07-28T20:16:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 28 Jul 2007, Thomas Glanzmann wrote:\n\n> > Isn't this the same patch as you sent before?\n> \n> > > @@ -74,7 +74,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec)\n> > > @@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,\n>        ~~~~~ ~~~~~                                                                            ~\n> \n> The offset of the diff has changed. Not that git couldn't sort it out by\n> itself. And the function had one or more parameters less.\n\nAh.  Thanks for the explanation.\n\nCiao,\nDscho\n"},{"id":"48932","messageId":"Pine.LNX.4.64.0707282116390.14781@racer.site","threadId":"9277","inReplyTo":"20070728194306.GA32203@fencepost.gnu.org","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-28T20:17:22Z","receivedAt":"2007-07-28T20:17:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 28 Jul 2007, Thomas Schwinge wrote:\n\n> On Sat, Jul 28, 2007 at 08:30:07PM +0100, Johannes Schindelin wrote:\n> > On Sat, 28 Jul 2007, Thomas Schwinge wrote:\n> > > Calling access(p, m) with p == NULL is not specified, so don't do that.  On\n> > > GNU/Hurd systems doing so will result in a SIGSEGV.\n> > > \n> > > Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>\n> > > ---\n> > \n> > Isn't this the same patch as you sent before?\n> \n> As I wrote in <20070728182542.GA22651@fencepost.gnu.org>: ``I noticed\n> that the patch I sent was prepared for an old version of the file.  I'll\n> send an updated patch that applies to the current revision.''\n\nAh.\n\n> > > +\t\tif (excludes_file != NULL && !access(excludes_file, R_OK))\n> > \n> > We usually omit the \"!= NULL\"; see the other source code in git.git.\n> \n> Okay, so I should sent a thusly modified version to get it applied?\n\nI don't think that is necessary; a small change like this is usually fixed \nby Junio with --amend.\n\nCiao,\nDscho\n"},{"id":"48934","messageId":"20070728202054.GA3616@cip.informatik.uni-erlangen.de","threadId":"9277","inReplyTo":"Pine.LNX.4.64.0707282115450.14781@racer.site","subject":"Re: [PATCH] Don't rely on unspecified behavior","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-07-28T20:20:54Z","receivedAt":"2007-07-28T20:20:54Z","isPatch":true,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello,\n\n> Ah.  Thanks for the explanation.\n\nI have operating system / real time systems exam on monday. I have to\nprepare myself in stating the obvious.\n\n\tThomas\n"}]}