{"thread":{"id":"50220","subject":"[Possible Bug] Commit generates GC repack failure","startedAt":"2019-01-14T14:50:46Z","lastAt":"2019-01-14T16:09:53Z","messageCount":5,"participants":["Randall S. Becker","Duy Nguyen","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"366652","messageId":"002601d4ac18$83d4a210$8b7de630$@nexbridge.com","threadId":"50220","inReplyTo":null,"subject":"[Possible Bug] Commit generates GC repack failure","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-01-14T14:50:33Z","receivedAt":"2019-01-14T14:50:46Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"Hi All,\n\nI'm trying to track down what happened this morning. We had a commit that\ncaused a background gc to occur. What happened was:\n\n$ git commit -m \"history commit ... \"\nAuto packing the repository in background for optimum performance.\nSee \"git help gc\" for manual housekeeping.\nwarning: The last gc run reported the following. Please correct the root\ncause\nand remove .git/gc.log.\nAutomatic cleanup will not be performed until the file is removed.\n\nfatal: open /dev/null failed: Invalid function argument\nfatal: failed to run repack\n\nObviously the /dev/null open was not right, but I don't know where this is\nin the git code to investigate further. Any pointers on where to look would\nbe appreciated. This started happening at  2.20.1 on the NonStop platform.\n\nCheers,\nRandall\n\n-- Brief whoami:\n NonStop developer since approximately 211288444200000000\n UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n\n\n\n"},{"id":"366653","messageId":"CACsJy8AEi4gzRpHY+ehFz3GEOaQ0rmdC2kKMpUSp80cdQbuc6g@mail.gmail.com","threadId":"50220","inReplyTo":"002601d4ac18$83d4a210$8b7de630$@nexbridge.com","subject":"Re: [Possible Bug] Commit generates GC repack failure","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-01-14T15:03:18Z","receivedAt":"2019-01-14T15:03:46Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jan 14, 2019 at 9:51 PM Randall S. Becker\n<rsbecker@nexbridge.com> wrote:\n>\n> Hi All,\n>\n> I'm trying to track down what happened this morning. We had a commit that\n> caused a background gc to occur. What happened was:\n>\n> $ git commit -m \"history commit ... \"\n> Auto packing the repository in background for optimum performance.\n> See \"git help gc\" for manual housekeeping.\n> warning: The last gc run reported the following. Please correct the root\n> cause\n> and remove .git/gc.log.\n> Automatic cleanup will not be performed until the file is removed.\n>\n> fatal: open /dev/null failed: Invalid function argument\n\nsanitize_stdfds() in setup.c can attempt to open /dev/null then\nredirect stdout and stderr to it. I think this is part of the\ndaemonization that is done in background gc.\n\n> fatal: failed to run repack\n>\n> Obviously the /dev/null open was not right, but I don't know where this is\n> in the git code to investigate further. Any pointers on where to look would\n> be appreciated. This started happening at  2.20.1 on the NonStop platform.\n>\n> Cheers,\n> Randall\n>\n> -- Brief whoami:\n>  NonStop developer since approximately 211288444200000000\n>  UNIX developer since approximately 421664400\n> -- In my real life, I talk too much.\n>\n>\n>\n>\n\n\n-- \nDuy\n"},{"id":"366654","messageId":"CACsJy8AtyTDs25R2PBd+nAvCW9aCYxtPHdXTS57JSS5VzgSFwQ@mail.gmail.com","threadId":"50220","inReplyTo":"CACsJy8AEi4gzRpHY+ehFz3GEOaQ0rmdC2kKMpUSp80cdQbuc6g@mail.gmail.com","subject":"Re: [Possible Bug] Commit generates GC repack failure","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-01-14T15:07:27Z","receivedAt":"2019-01-14T15:07:56Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jan 14, 2019 at 10:03 PM Duy Nguyen <pclouds@gmail.com> wrote:\n>\n> On Mon, Jan 14, 2019 at 9:51 PM Randall S. Becker\n> <rsbecker@nexbridge.com> wrote:\n> >\n> > Hi All,\n> >\n> > I'm trying to track down what happened this morning. We had a commit that\n> > caused a background gc to occur. What happened was:\n> >\n> > $ git commit -m \"history commit ... \"\n> > Auto packing the repository in background for optimum performance.\n> > See \"git help gc\" for manual housekeeping.\n> > warning: The last gc run reported the following. Please correct the root\n> > cause\n> > and remove .git/gc.log.\n> > Automatic cleanup will not be performed until the file is removed.\n> >\n> > fatal: open /dev/null failed: Invalid function argument\n>\n> sanitize_stdfds() in setup.c can attempt to open /dev/null then\n> redirect stdout and stderr to it. I think this is part of the\n> daemonization that is done in background gc.\n\nHowever the message does not match. I think you will find this \"open\n/dev/null failed\" line in run-command.c\n-- \nDuy\n"},{"id":"366655","messageId":"87tvib46kr.fsf@evledraar.gmail.com","threadId":"50220","inReplyTo":"002601d4ac18$83d4a210$8b7de630$@nexbridge.com","subject":"Re: [Possible Bug] Commit generates GC repack failure","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-01-14T15:11:48Z","receivedAt":"2019-01-14T15:11:54Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Jan 14 2019, Randall S. Becker wrote:\n\n> Hi All,\n>\n> I'm trying to track down what happened this morning. We had a commit that\n> caused a background gc to occur. What happened was:\n>\n> $ git commit -m \"history commit ... \"\n> Auto packing the repository in background for optimum performance.\n> See \"git help gc\" for manual housekeeping.\n> warning: The last gc run reported the following. Please correct the root\n> cause\n> and remove .git/gc.log.\n> Automatic cleanup will not be performed until the file is removed.\n>\n> fatal: open /dev/null failed: Invalid function argument\n> fatal: failed to run repack\n>\n> Obviously the /dev/null open was not right, but I don't know where this is\n> in the git code to investigate further. Any pointers on where to look would\n> be appreciated. This started happening at  2.20.1 on the NonStop platform.\n\nWe use start_command() when gc does run_command_v_opt() of\ne.g. git-repack. See in that file:\n\n    null_fd = open(\"/dev/null\", O_RDWR | O_CLOEXEC)\n\nMaybe that sort of code just fails on NonStop?\n"},{"id":"366658","messageId":"003601d4ac23$91ff2f80$b5fd8e80$@nexbridge.com","threadId":"50220","inReplyTo":"87tvib46kr.fsf@evledraar.gmail.com","subject":"RE: [Possible Bug] Commit generates GC repack failure","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-01-14T16:09:41Z","receivedAt":"2019-01-14T16:09:53Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 14, 2019 10:12, Ævar Arnfjörð Bjarmason wrote:\n> On Mon, Jan 14 2019, Randall S. Becker wrote:\n> \n> > Hi All,\n> >\n> > I'm trying to track down what happened this morning. We had a commit\n> > that caused a background gc to occur. What happened was:\n> >\n> > $ git commit -m \"history commit ... \"\n> > Auto packing the repository in background for optimum performance.\n> > See \"git help gc\" for manual housekeeping.\n> > warning: The last gc run reported the following. Please correct the\n> > root cause and remove .git/gc.log.\n> > Automatic cleanup will not be performed until the file is removed.\n> >\n> > fatal: open /dev/null failed: Invalid function argument\n> > fatal: failed to run repack\n> >\n> > Obviously the /dev/null open was not right, but I don't know where\n> > this is in the git code to investigate further. Any pointers on where\n> > to look would be appreciated. This started happening at  2.20.1 on the\n> NonStop platform.\n> \n> We use start_command() when gc does run_command_v_opt() of e.g. git-\n> repack. See in that file:\n> \n>     null_fd = open(\"/dev/null\", O_RDWR | O_CLOEXEC)\n> \n> Maybe that sort of code just fails on NonStop?\n\nThat line of code works fine on the platform. I tested it in isolation at various OS levels. Let me go back and say that I'm not 100% sure this is new, but may have been there since just before 2.16. Still perplexed recognizing that that is the only point in git code where that can happen.\n\nCheers,\nRandall\n\n"}]}