8170941: Executing gtest with invalid -Xlog argument crashes gtestLauncher
Reviewed-by: rehn, stuefe
--- a/test/hotspot/gtest/gtestMain.cpp Mon Jan 22 14:14:26 2018 -0800
+++ b/test/hotspot/gtest/gtestMain.cpp Tue Jan 23 08:55:47 2018 +0100
@@ -111,7 +111,11 @@
const char* name = test_info.name();
if (!_is_initialized && is_suffix("_test_vm", name)) {
// we want to have hs_err and core files when we execute regular tests
- ASSERT_EQ(0, init_jvm(_argc, _argv, false)) << "Could not initialize the JVM";
+ int ret_val = init_jvm(_argc, _argv, false);
+ if (ret_val != 0) {
+ ADD_FAILURE() << "Could not initialize the JVM";
+ exit(1);
+ }
_is_initialized = true;
}
}