{"thread":{"id":"18657","subject":"Re: [PATCH] AIX 5.2 - bug with 1.6.2.1","startedAt":"2009-03-31T10:37:04Z","lastAt":"2009-03-31T12:48:18Z","messageCount":4,"participants":["Jeff King","Pierre Poissinger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"109999","messageId":"20090331103703.GA1589@coredump.intra.peff.net","threadId":"18657","inReplyTo":"3930158b0903301647o790f7381l37ba61089713ce80@mail.gmail.com","subject":"Re: [PATCH] AIX 5.2 - bug with 1.6.2.1","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-31T10:37:04Z","receivedAt":"2009-03-31T10:37:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"[I'm cc'ing the git-list; please send bug reports there]\n\nOn Tue, Mar 31, 2009 at 01:47:47AM +0200, Pierre Poissinger wrote:\n\n> Looks like the patch posted here\n> http://osdir.com/ml/git/2009-01/msg01128.html\n> (around d8e96fd86d415554a9c2e09ffb929a9e22fdad25 I think - too late to\n> look for it - love google that gave me this guy as first hit...)\n> \n> breaks git on AIX 5.2 with gcc 2.9 :-(\n\nWow, I didn't know people were still using the 2.9 branch of gcc.\n\n> Nothing new to pack.\n> trace: built-in: git 'prune-packed'\n> The end...\n> fatal: unable to run 'git-repack'\n> error: waitpid 155256: code 128 (Error 0)\n> error: failed to run repack\n\nHmm. Can you confirm the status being passed back by run_command? The\nfollowing patch should do it:\n\ndiff --git a/git.c b/git.c\nindex c2b181e..a99c31b 100644\n--- a/git.c\n+++ b/git.c\n@@ -413,6 +413,7 @@ static void execv_dashed_external(const char **argv)\n \t * OK to return. Otherwise, we just pass along the status code.\n \t */\n \tstatus = run_command_v_opt(argv, 0);\n+\tfprintf(stderr, \"run_command produced status %d\\n\", status);\n \tif (status != -ERR_RUN_COMMAND_EXEC) {\n \t\tif (IS_RUN_COMMAND_ERR(status))\n \t\t\tdie(\"unable to run '%s'\", argv[0]);\n\n> The bottom line: Looks like my box really don't like the run-command\n> error define as:\n> #define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK)\n> \n> it will trigger even with x==0 :-)\n\nThat seems very wrong. I wonder if it is a problem with the signedness\nof enums in that version of gcc. Can you run the following program and\nreport on its output?\n\n-- >8 --\n#include <stdio.h>\nenum { FOO = 10000 };\nint main()\n{\n  printf(\"-FOO: %d\\n\", -FOO);\n  printf(\"0 <= -FOO: %d\\n\", 0 <= -FOO);\n  printf(\"-10000 <= -FOO: %d\\n\", -10000 <= -FOO);\n  return 0;\n}\n-- 8< --\n\n> So, following patch simply change this define to\n> #define IS_RUN_COMMAND_ERR(x) ((x) > ERR_RUN_COMMAND_FORK)\n\nThat's not right; x is going to be a large negative value. You could\ntry:\n\n  #define IS_RUN_COMMAND_ERR(x) ((-x) > ERR_RUN_COMMAND_FORK)\n\nThe other option is to rework run_command to just return positive values\n(which should be fine as long as they remain out of the range of normal\nexit codes).\n\n-Peff\n"},{"id":"110005","messageId":"3930158b0903310520h1f421518ka67de5f7aad0690b@mail.gmail.com","threadId":"18657","inReplyTo":"20090331103703.GA1589@coredump.intra.peff.net","subject":"Re: [PATCH] AIX 5.2 - bug with 1.6.2.1","fromName":"Pierre Poissinger","fromEmail":"pierre.poissinger@gmail.com","sentAt":"2009-03-31T12:20:17Z","receivedAt":"2009-03-31T12:20:17Z","isPatch":true,"sender":{"key":"pierre.poissinger@gmail.com","avatar":null},"body":"On Tue, Mar 31, 2009 at 12:37 PM, Jeff King <peff@peff.net> wrote:\n> [I'm cc'ing the git-list; please send bug reports there]\n[snip]\n>> breaks git on AIX 5.2 with gcc 2.9 :-(\n>\n> Wow, I didn't know people were still using the 2.9 branch of gcc.\n\nYep, that or \"C for AIX Compiler, Version 6\" but this one is awol for git\n[Hey, it feels cutting edge - I use Emacs 19 and digital C daily on\nOpenVMS 7.1...]\n\n> Hmm. Can you confirm the status being passed back by run_command?\n>[snip]\n0 - that's why I found out the funny enum stuff...\n\n> That seems very wrong. I wonder if it is a problem with the signedness\n> of enums in that version of gcc. Can you run the following program and\n> report on its output?\nNot only to you... just that's what I noticed...\n\n> -- >8 --\n-FOO: -10000\n0 <= -FOO: 1\n-10000 <= -FOO: 1\n\nThis seems to be a \"Old GCC'ism\" - XLC (version 6...cannot even\nunderstand git code) does it right:\n-FOO: -10000\n0 <= -FOO: 0\n-10000 <= -FOO: 1\n\n>  #define IS_RUN_COMMAND_ERR(x) ((-x) > ERR_RUN_COMMAND_FORK)\noops... works for me with\n#define IS_RUN_COMMAND_ERR(x) (-(x) > ERR_RUN_COMMAND_FORK)\n\n> The other option is to rework run_command to just return positive values\n> (which should be fine as long as they remain out of the range of normal\n> exit codes).\nChange define good enough for me and my oldies...\n\nRegs,\nPierre,\n-- \n>>> horsemen = ['war', 'pestilence', 'famine']\n>>> horsemen.append('Powerbuilder')\n"},{"id":"110006","messageId":"20090331122923.GA7173@coredump.intra.peff.net","threadId":"18657","inReplyTo":"3930158b0903310520h1f421518ka67de5f7aad0690b@mail.gmail.com","subject":"Re: [PATCH] AIX 5.2 - bug with 1.6.2.1","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-31T12:29:23Z","receivedAt":"2009-03-31T12:29:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 31, 2009 at 02:20:17PM +0200, Pierre Poissinger wrote:\n\n> >  #define IS_RUN_COMMAND_ERR(x) ((-x) > ERR_RUN_COMMAND_FORK)\n> oops... works for me with\n> #define IS_RUN_COMMAND_ERR(x) (-(x) > ERR_RUN_COMMAND_FORK)\n\nOops, it should actually be \"-(x) >= ERR_RUN_COMMAND_FORK\". But it\nshouldn't make a difference in your test, since x was '0' in your case.\n\nJunio, I think this patch should take care of it.\n\n-- >8 --\nSubject: [PATCH] fix portability problem with IS_RUN_COMMAND_ERR\n\nSome old versions of gcc don't seem to like us negating an\nenum constant. Let's work around it by negating the other\nhalf of the comparison instead.\n\nReported by Pierre Poissinger on gcc 2.9.\n---\n run-command.h |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/run-command.h b/run-command.h\nindex 15e870a..e345502 100644\n--- a/run-command.h\n+++ b/run-command.h\n@@ -10,7 +10,7 @@ enum {\n \tERR_RUN_COMMAND_WAITPID_SIGNAL,\n \tERR_RUN_COMMAND_WAITPID_NOEXIT,\n };\n-#define IS_RUN_COMMAND_ERR(x) ((x) <= -ERR_RUN_COMMAND_FORK)\n+#define IS_RUN_COMMAND_ERR(x) (-(x) >= ERR_RUN_COMMAND_FORK)\n \n struct child_process {\n \tconst char **argv;\n-- \n1.6.2.1.591.geb450\n"},{"id":"110007","messageId":"3930158b0903310548o5718be5dla2f3e91fbf718ded@mail.gmail.com","threadId":"18657","inReplyTo":"20090331122923.GA7173@coredump.intra.peff.net","subject":"Re: [PATCH] AIX 5.2 - bug with 1.6.2.1","fromName":"Pierre Poissinger","fromEmail":"pierre.poissinger@gmail.com","sentAt":"2009-03-31T12:48:18Z","receivedAt":"2009-03-31T12:48:18Z","isPatch":true,"sender":{"key":"pierre.poissinger@gmail.com","avatar":null},"body":"> Junio, I think this patch should take care of it.\nThanks !\n\nPierre,\n-- \n>>> horsemen = ['war', 'pestilence', 'famine']\n>>> horsemen.append('Powerbuilder')\n"}]}