appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 65 forks source link

Msys2 unexpected exit code 254: c:\msys64\usr\bin\bash.exe --login -c exit #3777

Closed johncaliskan closed 1 year ago

johncaliskan commented 2 years ago

Does anyone know how to fix "unexpected exit code 254: c:\msys64\usr\bin\bash.exe --login -c exit" issue when installing msys2? Capture

gxgl commented 2 years ago

Hi,

same issue here and everything that I have found on the internet didn't help.

BR, George

gxgl commented 2 years ago

what is curious, it started with new version of git and then I have tested with msys2 and cygwin, all of them, same issue, I also suspect my machine

gxgl commented 2 years ago

Hi,

it looks like this settings (Windows Security -> App & browser control -> Exploit protection -> System settings) image must be off.

At least for me, this is the way that I fix the problem.

Now my question is: How and why this settings are blocking the apps? :)

BR, George

CPosingies commented 1 year ago

Anybody an idea to handle this crap on a current Windows 11 ([Version 10.0.25267.1000)? The SEHOP stuff applied to Vista like aeons ago.

som6one commented 1 year ago

Just create folders: \windows\system32\drivers\etc \windows\system32\drivers\etc\hosts (or host - I am not sure) \windows\system32\drivers\etc\services \windows\system32\drivers\etc\networks \windows\system32\drivers\etc\protokol

kikonen commented 10 months ago

So what is solution in windows 11?

i.e. getting

Error during installation process (com.msys2.root):
Execution failed (Unexpected exit code: 1): "C:/app/msys64\usr\bin\bash.exe --login -c exit"
TinkerRnD commented 9 months ago

Does anyone know how to fix "unexpected exit code 254: c:\msys64\usr\bin\bash.exe --login -c exit" issue when installing msys2? Capture

Hello all, I do know of a solution that may help most of you.

The problem stems from the ASLR features in windows. So instead of disabling ASLR system wide, we can work around this by disabling the "Mandatory ASLR" and the "BottumUp ASLR" security features located in:

Windows Security > App & Browse control> Program Settings > + Add program to customize

From here add all of the binaries in C:\msys64\usr\bin and disable those two features

Now this takes a lot of time so here is a script you can run that will do all of the work for you (depending on your installation path, you may need to update the location of your msys2): https://github.com/TinkerRnD/Helpful-Scripts/blob/main/Remove_ASLR.ps1

I have been able to fix all my windows shells this way (Cygwin, Git Bash and mys2). Hopefully not a permanent solution but will get you up and running until the next patch @msys2 ;)