bugManeage - Bugs: bug #60282, Git installation crashes in macOS...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #60282: Git installation crashes in macOS after upgrading to Big Sur

Submitter:  Raul Infante-Sainz <infantesainz>
Submitted:  Tue 23 Mar 2021 10:52:04 PM UTC
   
 
Category:  Software Severity:  3 - Normal
Item Group:  Crash Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Thu 15 Jul 2021 07:07:03 PM UTC, comment #3: 

I'd be happy for someone with a Darwin/xnu system to try git-2.32.0, and would be pleased for the bug to disappear :), but I'm sceptical:

$ md5sum git-2.*/compat/regex/regex.h
f7f45f3dc1011d2635305c11a4cdb620  git-2.26.2/compat/regex/regex.h
f7f45f3dc1011d2635305c11a4cdb620  git-2.28.0/compat/regex/regex.h
f7f45f3dc1011d2635305c11a4cdb620  git-2.32.0/compat/regex/regex.h
$ md5sum git-2.*/compat/regex/regex_internal.h
49b00f3f18c9f3d16e9557546117f477  git-2.26.2/compat/regex/regex_internal.h
eb5b3f19dbce72fb8228cdbc8f4bece7  git-2.28.0/compat/regex/regex_internal.h
eb5b3f19dbce72fb8228cdbc8f4bece7  git-2.32.0/compat/regex/regex_internal.h
$ md5sum git-2.*/compat/regex/regex.c
1ac7245501b74a02f869920e5ecc9548  git-2.26.2/compat/regex/regex.c
e86c83485de14d5b3f66dec82265ce84  git-2.28.0/compat/regex/regex.c
e86c83485de14d5b3f66dec82265ce84  git-2.32.0/compat/regex/regex.c

Neither regex.h, regex_internal.h, nor regex.c change between git-2.28.0 and 2.32.0.

Boud Roukema <boud>
Group Member
Thu 15 Jul 2021 06:48:21 PM UTC, comment #2: 

Git has been upgraded a lot since last year (when we done the latest software update in Maneage): four releases have come out since then (it is currently 2.32).

I have a feeling that the Git people have already found this bug in macOS and fixed it. So probably its best to do checks after updating the Git version in Maneage.

Generally, we need to start a new run of updating the Maneage software, many updates have come for many of our tools :-).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Thu 15 Jul 2021 05:50:43 PM UTC, comment #1: 

Looking at git-2.28.0 that we have currently in Maneage, it looks like:

  • line 69 of regex.c includes <regex.h>, which is normally used to mean a system-level file (although I think the real rules are implementation is system-dependent)
  • lines 356, 357 of compat/regex/regex.h only define RE_TRANSLATE_TYPE if __USE_GNU is true; otherwise only __RE_TRANSLATE_TYPE is defined
  • line 70 of regex.c includes regex_internal.h
  • line 394 of regex_internal.h refers to RE_TRANSLATE_TYPE


So failure is expected if:

(i) no system-level include file regex.h is found, or (ii) if the system regex.h is found but it does not define RE_TRANSLATE_TYPE,

and

(iii) if __USE_GNU is false (e.g. undefined).

(i) should cause a compile error. So the bug appears to be (ii) + (iii).

It looks to me like the relevant code (all lines containing RE_TRANSLATE_TYPE) are identical in git-2.26.2 (Maneage prior to b3b4479), git-2.28.0 and git-2.32.0.


$ md5sum ../git-2.*/compat/regex/regex.h
f7f45f3dc1011d2635305c11a4cdb620  ../git-2.26.2/compat/regex/regex.h
f7f45f3dc1011d2635305c11a4cdb620  ../git-2.28.0/compat/regex/regex.h
f7f45f3dc1011d2635305c11a4cdb620  ../git-2.32.0/compat/regex/regex.h


It looks like regex.h is a glibc header file, associated with glibc source code or a compiled library, of course, e.g.

gnulib: /usr/share/gnulib/lib/regex.h
libc6-dev:amd64: /usr/include/regex.h

and it says on line 8 quite clearly that "This file is part of the GNU C Library."

I can't judge if this is considered to be a bug in git or rather in Darwin/xnu. My guess is that git accepts the GNU approach, i.e. it is happy to provide a backup in case the system-level regex.h is missing, but considers that if regex.h does not define RE_TRANSLATE_TYPE and the system is non-GNU, then it's better to have a compile failure than to guess what RE_TRANSLATE_TYPE should be defined to.

The other missing types I see are reg_errcode_t (an enum type) and reg_syntax_t a macro related to syntax.

There's also ret and REG_NOERROR.

I haven't checked if these are all defined as part of a POSIX standard.

The practical question is whether a hack to provide the if __USE_GNU definitions as a fallback for a non-GNU system that fails to provide these would be safe. Darwin/xnu presumably has its own (possibly secret, since the system is generally not free) hack for compiling git - I can't believe that git is not available as a binary install on a standard recent Darwin/xnu system...

Boud Roukema <boud>
Group Member
Tue 23 Mar 2021 10:52:04 PM UTC, original submission:  

After the upgrade of macOS to Big Sur 11.2.3 with Xcode 12.4 there are many problems during the installation of a number of programs. I had to remove zip and unzip from the prerequisites of tar (so they are not installed). After that I was able to fix several of the problems by just upgrading the version of those programs. In particular, I had to upgrade:

bash  5.0.18 -> 5.1
perl  5.32.0 -> 5.32.1
less  563    -> 580 (this is a beta release!)

But then, when it goes to install Git, it crashes. Even after upgrading it to the latest version:

git 2.28.0 -> 2.31.0

The last and relevant lines of the crash are:


In file included from compat/regex/regex.c:70:
compat/regex/regex_internal.h:394:3: error: unknown type name 'RE_TRANSLATE_TYPE'
  RE_TRANSLATE_TYPE trans;
  ^
compat/regex/regex_internal.h:422:8: error: unknown type name 'reg_errcode_t'
static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
       ^
compat/regex/regex_internal.h:691:3: error: unknown type name 'reg_syntax_t'
  reg_syntax_t syntax;
  ^
In file included from compat/regex/regex.c:72:
compat/regex/regex_internal.c:22:6: error: unknown type name 'RE_TRANSLATE_TYPE'
                                        RE_TRANSLATE_TYPE trans, int icase,
                                        ^
compat/regex/regex_internal.c:46:8: error: unknown type name 'reg_errcode_t'
static reg_errcode_t
       ^
compat/regex/regex_internal.c:49:7: error: unknown type name 'RE_TRANSLATE_TYPE'
                    RE_TRANSLATE_TYPE trans, int icase, const re_dfa_t *dfa)
                    ^
compat/regex/regex_internal.c:51:3: error: use of undeclared identifier 'reg_errcode_t'
  reg_errcode_t ret;
  ^
compat/regex/regex_internal.c:60:3: error: use of undeclared identifier 'ret'
  ret = re_string_realloc_buffers (pstr, init_buf_len);
  ^
compat/regex/regex_internal.c:61:11: error: use of undeclared identifier 'ret'
  if (BE (ret != REG_NOERROR, 0))
          ^
compat/regex/regex_internal.c:61:18: error: use of undeclared identifier 'REG_NOERROR'
  if (BE (ret != REG_NOERROR, 0))
                 ^
compat/regex/regex_internal.c:62:12: error: use of undeclared identifier 'ret'
    return ret;
           ^
compat/regex/regex_internal.c:69:10: error: use of undeclared identifier 'REG_NOERROR'
  return REG_NOERROR;
         ^
compat/regex/regex_internal.c:74:8: error: unknown type name 'reg_errcode_t'
static reg_errcode_t
       ^
compat/regex/regex_internal.c:77:8: error: unknown type name 'RE_TRANSLATE_TYPE'
                     RE_TRANSLATE_TYPE trans, int icase, const re_dfa_t *dfa)
                     ^
compat/regex/regex_internal.c:79:3: error: use of undeclared identifier 'reg_errcode_t'
  reg_errcode_t ret;
  ^
compat/regex/regex_internal.c:85:7: error: use of undeclared identifier 'ret'
      ret = re_string_realloc_buffers (pstr, len + 1);
      ^
compat/regex/regex_internal.c:86:15: error: use of undeclared identifier 'ret'
      if (BE (ret != REG_NOERROR, 0))
              ^
compat/regex/regex_internal.c:86:22: error: use of undeclared identifier 'REG_NOERROR'
      if (BE (ret != REG_NOERROR, 0))
                     ^
compat/regex/regex_internal.c:87:9: error: use of undeclared identifier 'ret'
        return ret;
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [Makefile:2431: compat/regex/regex.o] Error 1
make[1]: Leaving directory '/BDIR/software/build-tmp/git-2.31.0'
make: *** [reproduce/software/make/basic.mk:956: /BDIR/software/installed/version-info/proglib/git-2.31.0] Error 2


Attached in this post there is the full log. Thanks a lot for the help.

Raul Infante-Sainz <infantesainz>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #51125:  git-crash.tar.gz added by infantesainz (14KiB - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Posted a comment)
  • -email is unavailable- added by boud (Posted a comment)
  • -email is unavailable- added by infantesainz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-23 infantesainz Attached File- Added git-crash.tar.gz, #51125

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code