MSVC `SEH exception with code 0xc0000005` when using `SUCCEED`
- Dominant language
- C++
- Stars
- 39.5k
- Forks
- 10.9k
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
### 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:
```c++
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
Contributor guide
Research direction
Start with the minimal reproducible example linked in the issue and the TEST(Example, succeed) case using SUCCEED(). Reproduce it on the GitHub Actions windows-latest runner with MSVC 19.40.33811.0, then compare the static and shared builds described in the report. Done means the test no longer crashes with SEH exception code 0xc0000005 in that environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100