{"thread":{"id":"21161","subject":"[PATCH] Makefile: add a note about the NO_MMAP setting on IRIX and IRIX64","startedAt":"2009-10-09T00:09:37Z","lastAt":"2009-10-09T00:15:54Z","messageCount":2,"participants":["Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"124411","messageId":"wTau-ugyVF7kG6Pxm7DRuWdrZABot_lbCcrG1e9aKIiNkU3X9L4ELEaLmN_rFVebheOs8fQEyx028yJUR9W-0w@cipher.nrlssc.navy.mil","threadId":"21161","inReplyTo":null,"subject":"[PATCH] Makefile: add a note about the NO_MMAP setting on IRIX and IRIX64","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-10-09T00:09:37Z","receivedAt":"2009-10-09T00:09:37Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nWhen git is compiled with the MIPSpro 7.4.4m compiler, and NO_PTHREADS is\nset, and NO_MMAP is _not_ set, then git segfaults when trying to access the\nfirst entry in a reflog.  If NO_PTHREADS is not set (which implies that the\npthread library is linked in), or NO_MMAP _is_ set, then the segfault is\nnot encountered.  The conservative choise has been made to set NO_MMAP in\nthe Makefile to avoid this flaw.  The GNU C compiler does not produce this\nbehavior.\n\nThe segfault happens in refs.c:read_ref_at().  The mmap succeeds, and the\nloop is executed properly until rec is rewound into the first line (reflog\nentry) of the file.  The segfault is caught by test 28 of\nt1400-update-ref.sh which fails when 'git rev-parse --verify \"master@{May 25\n2005}\"' is called.\n\nSo, add a comment in the Makefile to describe why NO_MMAP is set and as a\nhint to those who may be interested in unsetting it.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n Makefile |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex dd3d520..a340fb1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -841,6 +841,12 @@ ifeq ($(uname_S),IRIX)\n \tNO_MEMMEM = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tNO_MKDTEMP = YesPlease\n+\t# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads\n+\t# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),\n+\t# git dies with a segmentation fault when trying to access the first\n+\t# entry of a reflog.  The conservative choice is made to always set\n+\t# NO_MMAP.  If you suspect that your compiler is not affected by this\n+\t# issue, comment out the NO_MMAP statement.\n \tNO_MMAP = YesPlease\n \tNO_EXTERNAL_GREP = UnfortunatelyYes\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n@@ -854,6 +860,12 @@ ifeq ($(uname_S),IRIX64)\n \tNO_MEMMEM = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tNO_MKDTEMP = YesPlease\n+\t# When compiled with the MIPSpro 7.4.4m compiler, and without pthreads\n+\t# (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),\n+\t# git dies with a segmentation fault when trying to access the first\n+\t# entry of a reflog.  The conservative choice is made to always set\n+\t# NO_MMAP.  If you suspect that your compiler is not affected by this\n+\t# issue, comment out the NO_MMAP statement.\n \tNO_MMAP = YesPlease\n \tNO_EXTERNAL_GREP = UnfortunatelyYes\n \tSNPRINTF_RETURNS_BOGUS = YesPlease\n-- \n1.6.5.rc2.17.gdbc1b\n"},{"id":"124412","messageId":"RLFF8Ml2w45o_YXX91uLQRAO7nrcr120NMK5ClTrG9qOvZhTxRRN_w@cipher.nrlssc.navy.mil","threadId":"21161","inReplyTo":"wTau-ugyVF7kG6Pxm7DRuWdrZABot_lbCcrG1e9aKIiNkU3X9L4ELEaLmN_rFVebheOs8fQEyx028yJUR9W-0w@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] Makefile: add a note about the NO_MMAP setting on IRIX and IRIX64","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2009-10-09T00:15:54Z","receivedAt":"2009-10-09T00:15:54Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"Brandon Casey wrote:\n> From: Brandon Casey <drafnel@gmail.com>\n> \n> When git is compiled with the MIPSpro 7.4.4m compiler, and NO_PTHREADS is\n> set, and NO_MMAP is _not_ set, then git segfaults when trying to access the\n> first entry in a reflog.  If NO_PTHREADS is not set (which implies that the\n> pthread library is linked in), or NO_MMAP _is_ set, then the segfault is\n> not encountered.  The conservative choise has been made to set NO_MMAP in\n                                        ^^^\n\nI misspelled 'choice'.  Doesn't seem worth a resend.  If you can fix it before\nyou apply, that would be great.  If you forget, no big deal.\n\n-brandon\n"}]}