-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8364664: gtest death tests failing on Windows #26661
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back swesonga! A progress list of the required criteria for merging this PR into |
@swesonga This change is no longer ready for integration - check the PR body for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a build/makefile point of view, this looks fine, but I would like input from someone more familiar with GTest as well.
/reviewers 2
How is it that we (Oracle) don't see these gtest death test failures in our The code in gtest-death-test-internal.h#L198-L212 referenced in the PR That led me to wonder why, on Windows, we build libgtest and rebuild libjvm https://github.com/openjdk/jdk/blame/f95af744b07a9ec87e2507b3d584cbcddc827bbd/make/hotspot/lib/CompileGtest.gmk#L71 That decision seems pretty old, like maybe from the initial introduction of I was concerned that this might effectively undo JDK-8185734, since the |
This warning from the C++ compiler (after removing the 2 -EHsc lines) indicates that gtest code is using C++ exception handling:
|
Should gtests be enabled in the pre-checkin GitHub actions to prevent regressions? I think they take a few minutes to execute. |
Thanks for pointing this out. Let me investigate. |
This all sounds very familiar; let me check. |
So, we run gtests on Windows with See issues
See more details in my PR description for 8185734, that's why this all sounded so familiar. The mechanism in place since 8267138 should be enough for my understanding. @swesonga, can you find out why this is not sufficient in your case? Is this option not passed on to your test?
In the libjvm code itself, we don't use C++ exceptions, and we catch all Windows SEH with
In my PR for 8184734, I wrote: " In JBS, @kimbarrett suggested to build gtests with GTEST_HAS_SEH switched off to prevent gtest from using SEH. Unfortunately that won't work since the use of death tests means we need SEH. If we switch GTEST_HAS_SEH off, the death tests don't build. I also do not like this suggestion since this configuration may have a higher chance of bitrotting upstream." So it looks this was the first thing I tried back then, and it failed. |
They are already executed :-) https://github.com/swesonga/jdk/actions/runs/16735029827/job/47374721173 They are launched from the GtestWrapper.java with the |
Your assumption is correct. This is from the initial JDK-8148244. I don't know if there is any rationale, or if this was just added by following gtest documentation. I guess it can be removed. I'm starting a test run of hs-tier1 without it right now, but I'm not sure if that is enough to provoke any potential problems. |
Well that did not work:
when compiling I'm not sure really of the effect of including, or not including, |
Well, that built and tested successfully at least. I've opened JDK-8365231, so we can continue further discussion about that change separate from this PR. |
0054bbe (from https://bugs.openjdk.org/browse/JDK-8343756) caused the gtest death tests to fail on Windows with the error message "Caught std::exception-derived exception escaping the death test statement. Exception message: unknown file: error: SEH exception with code 0xc0000005 thrown in the test body." The error message is from the catch block in https://github.com/google/googletest/blob/v1.14.0/googletest/include/gtest/internal/gtest-death-test-internal.h#L198-L212
In the failing death tests, the gtests start another process and expect the child process to be terminated by JVM error handling code. However, the structured exception handling code in the googletest code ends up getting executed instead. The death tests expect execution to continue after the instruction that triggered the exception by writing to the poissoned page. This change proposes build Windows gtests without structured exception handling to avoid changing the flow of exceptions in OpenJDK test code. The effect of this change is to stop using the SEH path in the HandleSehExceptionsInMethodIfSupported method and directly start the test.
All the Windows gtests now pass with this change.
Progress
Warning
8364664: gtest death tests failing on Windows
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26661/head:pull/26661
$ git checkout pull/26661
Update a local copy of the PR:
$ git checkout pull/26661
$ git pull https://git.openjdk.org/jdk.git pull/26661/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26661
View PR using the GUI difftool:
$ git pr show -t 26661
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26661.diff
Using Webrev
Link to Webrev Comment