Skip to content

[bug] windows-2022 can no longer run applications compiled with included mingw64 #6412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 11 tasks
IsaacShelton opened this issue Oct 16, 2022 · 3 comments
Closed
2 of 11 tasks
Labels
Area: C/C++ bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows

Comments

@IsaacShelton
Copy link

IsaacShelton commented Oct 16, 2022

Description

When you run a C/C++ executable compiled with the included mingw64, you would expect it to run without any issues on the same machine, instead of silently failing.

My particular workflow was working completely fine, but now, without any changes to my workflow, everything I build with mingw64 on Github runners silently crashes immediately.

Solution:

It's probably an issue with the MinGW DLLs not being included in the path.

(not having access or having outdated versions of MinGW DLLs can cause the executable to crash)

MinGW DLLs live at C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin.

Benefits of keeping change

Not having the DLLs in the path would make for more realistic testing.

Consequences of keeping change

The drawback is that you can't use mingw64 to easily test C/C++ code without manually changing the path yourself or searching for and copying the DLLs before running your code. This requirement is not made clear in build logs (completely silent error).

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Broken as of 2.298.2

Is it regression?

Yes, but hard to tell what runner version it broke due to caching.

My cache recently expired, so it could be any version after windows-latest Jun 8.

windows-latest Jun 8 - last successful build with cache miss

windows-2022 2.297.0 - last successful build with cache hit

Expected behavior

When you run a C/C++ executable compiled with the included mingw64, you would expect it to run without any issues on the same machine, instead of silently failing.

Actual behavior

In a workflow, attempting run a C/C++ executable compiled with the included mingw64 silently fails (even if done immediately after building).

Repro steps

Steps to reproduce the behavior:

  1. [workflow job] Compile basic C/C++ program using included mingw64
  2. [workflow job] Run resulting executable
  3. (it will fail silently - the workflow will continue as if nothing went wrong - the executable will crash immediately)

Edit:

This doesn't solve the issue of the resulting executables immediately crashing, but a slight correction:

Maybe the workflow will stop. The executable would crash with an exitcode of something like -12345. It's just that it doesn't stop my workflow because of how I invoke them.

TL;DR - The runner cannot run executables compiled with the included mingw64. If you try to run a resulting executable, the executable will instantly crash.

@IsaacShelton IsaacShelton changed the title [bug] windows-latest can no longer run applications compiled with included mingw64 [bug] windows-2022 can no longer run applications compiled with included mingw64 Oct 16, 2022
@IsaacShelton IsaacShelton changed the title [bug] windows-2022 can no longer run applications compiled with included mingw64 [bug] windows-2022 can no longer run applications compiled with included mingw64 Oct 16, 2022
@al-cheb al-cheb added Area: C/C++ OS: Windows investigate Collect additional information, like space on disk, other tool incompatibilities etc. and removed needs triage labels Oct 17, 2022
@al-cheb
Copy link
Contributor

al-cheb commented Oct 17, 2022

Hey @IsaacShelton.
We will take a look at it.

@IsaacShelton
Copy link
Author

I have confirmed that the cause of this issue is due to the MinGW64 DLLs not being included in the path anymore.

  • libgcc_s_seh-1.dll
  • libstdc++-6.dll
  • libwinpthread-1.dll

Adding C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin to the path fixes it.

@al-cheb
Copy link
Contributor

al-cheb commented Oct 17, 2022

Close as #6103

@al-cheb al-cheb closed this as completed Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C/C++ bug report investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: Windows
Projects
None yet
Development

No branches or pull requests

2 participants