google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
33.68k stars 9.98k forks source link

MSVC `SEH exception with code 0xc0000005` when using `SUCCEED` #4556

Open jviotti opened 4 weeks ago

jviotti commented 4 weeks ago

Describe the issue

I'm suddenly getting the following crash on tests that hit SUCCEED on Windows, specifically on GitHub Actions:

unknown file: error: SEH exception with code 0xc0000005 thrown in the test body.

I was able to bring it down to a very minimal reproducible example: https://github.com/jviotti/gtest-seh-windows. It fails on GitHub Actions (i.e. https://github.com/jviotti/gtest-seh-windows/actions/runs/9406537911/job/25910207604) but I cannot reproduce on my Windows machine.

Essentially, this is what fails:

TEST(Example, succeed) {
  SUCCEED();
}

Steps to reproduce the problem

See the small reproducible example: https://github.com/jviotti/gtest-seh-windows and its corresponding GitHub Action runs.

What version of GoogleTest are you using?

a7f443b80b105f940225332ed3c31f2790092f47

What operating system and version are you using?

Windows from GitHub Actions as of windows-latest

What compiler and version are you using?

MSVC 19.40.33811.0 from Visual Studio 17 2022 from GitHub Actions

What build system are you using?

cmake version 3.29.3 which comes from GitHub Actions

Additional context

Seems it is reproducible for both static and shared builds. I ruled out lots of things, like my own compilation options, etc. It was working fine on GitHub Actions until yesterday. They must have done something to their runners (maybe a Visual Studio upgrade?) that triggered this.

You can also find some more realistic production cases here: https://github.com/sourcemeta/jsontoolkit/actions/runs/9402916181/job/25899820862?pr=765

DominykasPetke commented 3 weeks ago

Relevant issue on GitHub Actions's side: https://github.com/actions/runner-images/issues/10004