Windows 10에서 git을 사용할 때 "치명적인 오류 - cygheap 기본 불일치가 감지되었습니다" 오류를 어떻게 해결할 수 있나요?

Windows 10에서 git을 사용할 때 "치명적인 오류 - cygheap 기본 불일치가 감지되었습니다" 오류를 어떻게 해결할 수 있나요?

Windows 10(1803)에서 git을 사용하면 일부 명령에서 다음 오류가 발생합니다.

git submodule add https://github.com/..../......git ......
      3 [main] basename (13656) C:\.....\basename.exe: *** fatal error - cygheap base mismatch detected - 0x64313400/0x11E3400.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.

이 문제를 어떻게 해결할 수 있나요?

답변1

이 오류에는 여러 가지 이유가 있을 수 있습니다.

예를 들어 실제로 충돌하는 DLL 버전이 있을 수 있습니다.

그러나 최신 버전의 Windows 10에는 원래 Microsoft EMET의 일부였던 추가 보호 기능 세트가 내장되어 있습니다.

가장 주목할만한 것은 ASLR(주소 공간 레이아웃 무작위화) 보안 기능은 Windows용 Git 설치에 포함된 UNIX 유사 실행 파일과 호환되지 않습니다.

이 문제를 해결하려면 취약성 공격 방지 설정을 열고 프로그램 설정 탭으로 전환한 후 오류에 나열된 실행 파일 이름을 추가하세요(상당히 많을 수 있음).

주어진 예에서 basename.exe조금 더 편집증이 있는 경우에는 그냥 경로나 전체 경로를 입력할 수 있습니다.

각 실행 파일에 대해 ASLR 보호를 끄십시오.

자세한 내용은 다음 GitHub 문제를 참조하세요.

https://github.com/desktop/desktop/issues/3096

답변2

Windows 10에서 기본적으로 필수 ALSR을 활성화한 후.

모든 git-bash 실행 파일에 대해 ForceRelocateImages를 비활성화해야 합니다. 이렇게 하려면 작은 PowerShell 스크립트를 만들거나 아래 코드를 PowerShell에 직접 입력하세요. PowerShell을 관리자로 실행해야 합니다.

Get-Item -Path "C:\Program Files\Git\usr\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
Get-Item -Path "C:\Program Files\Git\bin\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }
Get-Item -Path "C:\Program Files\Git\*.exe" | %{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateImages }

그 후에는 git-bash가 제대로 작동합니다.

답변3

나에게 해결책은 호환되지 않는 msys-2.0.dll. "cygwin"에 대한 오류 메시지가 올바르지 않습니다.

msys-2.0.dll상자에 여러 파일이 있으면 문제가 발생할 수 있습니다. git 명령 옆에 있는 명령(c:\program files\git....)을 제외하고 모두 제거합니다.

또는 여러 버전이 필요한 경우 git 명령을 사용할 때 MSYS64 dll 버전을 찾을 수 없도록 PATH를 사용하세요.

답변4

  1. dll 이름을 바꾸면 msys도움이 될 수 있습니다.https://stackoverflow.com/a/74463416/2377343

  2. ASLR을 비활성화해 볼 수도 있습니다.https://stackoverflow.com/a/76296598/2377343

관련 정보