Gtest: CreateVM is not called when isolated tests are run?
thomas.stuefe at gmail.com
Wed Dec 7 10:52:43 UTC 2016
I am writing a metaspace-related gtest and was noticing my test to assert
in Thread::current() because the test thread was not attached to the VM.
When executed together with all other tests, it works.
Some other tests are affected as well, e.g. LogStream tests:
./hotspot/variant-server/libjvm/gtest/gtestLauncher.exe -jdk ./images/jdk/
[ RUN ] LogStreamTest.from_log
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=\runtime/thread.hpp:662
# A fatal error has been detected by the Java Runtime Environment:
# Internal Error
# assert(current != 0LL) failed: Thread::current() called on detached
Did anyone else notice this behaviour?
I see that when I run all tests (when omitting the filter argument),
Thread::create_vm is called, but not when the test is run isolated. So, the
VM is not initialized and all but the most primitive tests will fail.
Is this intended or would this be a bug?
Kind Regards, Thomas
More information about the hotspot-dev