@matheusbsbs / matheus-bagliano / commits / 651aef3428
Fork 0

Makefile: add a note about the NO_MMAP setting on IRIX and IRIX64

When git is compiled with the MIPSpro 7.4.4m compiler, and NO_PTHREADS is set, and NO_MMAP is _not_ set, then git segfaults when trying to access the first entry in a reflog. If NO_PTHREADS is not set (which implies that the pthread library is linked in), or NO_MMAP _is_ set, then the segfault is not encountered. The conservative choice has been made to set NO_MMAP in the Makefile to avoid this flaw. The GNU C compiler does not produce this behavior. The segfault happens in refs.c:read_ref_at(). The mmap succeeds, and the loop is executed properly until rec is rewound into the first line (reflog entry) of the file. The segfault is caught by test 28 of t1400-update-ref.sh which fails when 'git rev-parse --verify "master@{May 25 2005}"' is called. So, add a comment in the Makefile to describe why NO_MMAP is set and as a hint to those who may be interested in unsetting it. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Oct 8, 2009 at 19:09 UTC 651aef3428d9688e3fdffc6760380ead47debb9f
1 file changed +12
Makefile
+12
@@ -841,6 +841,12 @@ ifeq ($(uname_S),IRIX)
841 NO_MEMMEM = YesPlease
842 NO_MKSTEMPS = YesPlease
843 NO_MKDTEMP = YesPlease
844 + # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
845 + # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
846 + # git dies with a segmentation fault when trying to access the first
847 + # entry of a reflog. The conservative choice is made to always set
848 + # NO_MMAP. If you suspect that your compiler is not affected by this
849 + # issue, comment out the NO_MMAP statement.
850 NO_MMAP = YesPlease
851 NO_EXTERNAL_GREP = UnfortunatelyYes
852 SNPRINTF_RETURNS_BOGUS = YesPlease
@@ -855,6 +861,12 @@ ifeq ($(uname_S),IRIX64)
861 NO_MEMMEM = YesPlease
862 NO_MKSTEMPS = YesPlease
863 NO_MKDTEMP = YesPlease
864 + # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
865 + # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
866 + # git dies with a segmentation fault when trying to access the first
867 + # entry of a reflog. The conservative choice is made to always set
868 + # NO_MMAP. If you suspect that your compiler is not affected by this
869 + # issue, comment out the NO_MMAP statement.
870 NO_MMAP = YesPlease
871 NO_EXTERNAL_GREP = UnfortunatelyYes
872 SNPRINTF_RETURNS_BOGUS = YesPlease