Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8185734

[Windows] Structured Exception Catcher missing around gtest execution

    XMLWordPrintable

Details

    • b02
    • x86
    • windows

    Backports

      Description

        When running gtests on Windows, there is no __try/__except handler around the test execution. As a result, SafeFetch32/SafeFetchN does not work properly on 32bit Windows during gtest execution. There might be other error handling related issues as well, but it was SafeFetch not working that uncovered the problem.

        This problem is very similar to JDK-8074860. Some of the infrastructure mentioned there (os::win32::call_test_func_with_wrapper() and such) was removed by that change. Since the tests in question were run during VM initialization, and that change made VM initialization properly protected, that infrastructure was no longer needed. But with gtest we've moved a bunch of those tests out of the VM initialization context, and they are no longer protected.

        I think conditionally wrapping the call to RUN_ALL_TESTS() in gtestMain.cpp with a __try/__except block using topLevelExceptionFilter will address this problem. For the conditionalization, I suggest using the existing GTEST_HAS_SEH macro.

        Attachments

          Issue Links

            Activity

              People

                stuefe Thomas Stuefe
                kbarrett Kim Barrett
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: