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

gtests don't terminate the VM safely

XMLWordPrintable

    • b10

        When a non-asserting gtest loads and initializes the JVM via JNI_CreateJavaVM, there is no corresponding clean shutdown via JNI_DestroyJavaVM. Instead the gtest wrapper macros just call ::exit to terminate the process. This can lead to problems if the atexit actions (including global destructors) trigger failures in concurrently executing threads in the JVM. A clean JVM exit will brings the system to a safepoint before performing shutdown actions, and then finally any atexit related actions.

        We should look at providing a safe/safer termination process, either by using JNI_DestroyJavaVM, or more crudely (but perhaps expeditiously) calling _exit() instead of exit() so that we get a more immediate termination of the process without executing atexit hooks etc.

              dholmes David Holmes
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: