8254042: gtest/GTestWrapper.java failed os.test_random

Reviewed-by: dholmes, stuefe, kbarrett
This commit is contained in:
Coleen Phillimore 2020-11-30 12:48:17 +00:00
parent 962f7a3bae
commit 4db05e991b
7 changed files with 4 additions and 14 deletions

View File

@ -2464,8 +2464,6 @@ void os::init(void) {
clock_tics_per_sec = sysconf(_SC_CLK_TCK);
init_random(1234567);
// _main_thread points to the thread that created/loaded the JVM.
Aix::_main_thread = pthread_self();

View File

@ -2089,8 +2089,6 @@ void os::init(void) {
clock_tics_per_sec = CLK_TCK;
init_random(1234567);
Bsd::set_page_size(getpagesize());
if (Bsd::page_size() == -1) {
fatal("os_bsd.cpp: os::init: sysconf failed (%s)", os::strerror(errno));

View File

@ -4394,8 +4394,6 @@ void os::init(void) {
clock_tics_per_sec = sysconf(_SC_CLK_TCK);
init_random(1234567);
Linux::set_page_size(sysconf(_SC_PAGESIZE));
if (Linux::page_size() == -1) {
fatal("os_linux.cpp: os::init: sysconf failed (%s)",

View File

@ -4164,8 +4164,6 @@ void nx_check_protection() {
void os::init(void) {
_initial_pid = _getpid();
init_random(1234567);
win32::initialize_system_info();
win32::setmode_streams();
init_page_sizes((size_t) win32::vm_page_size());

View File

@ -299,7 +299,6 @@ static jint wb_stress_virtual_space_resize(size_t reserved_space_size,
int seed = os::random();
tty->print_cr("Random seed is %d", seed);
os::init_random(seed);
for (size_t i = 0; i < iterations; i++) {

View File

@ -72,7 +72,7 @@
OSThread* os::_starting_thread = NULL;
address os::_polling_page = NULL;
volatile unsigned int os::_rand_seed = 1;
volatile unsigned int os::_rand_seed = 1234567;
int os::_processor_count = 0;
int os::_initial_active_processor_count = 0;
size_t os::_page_sizes[os::page_sizes_max];

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -120,10 +120,10 @@ TEST(os, test_random) {
unsigned int seed = 1;
// tty->print_cr("seed %ld for %ld repeats...", seed, reps);
os::init_random(seed);
int num;
for (int k = 0; k < reps; k++) {
num = os::random();
// Use next_random so the calculation is stateless.
num = seed = os::next_random(seed);
double u = (double)num / m;
ASSERT_TRUE(u >= 0.0 && u <= 1.0) << "bad random number!";
@ -148,7 +148,6 @@ TEST(os, test_random) {
ASSERT_LT(t, eps) << "bad variance";
}
#ifdef ASSERT
TEST_VM_ASSERT_MSG(os, page_size_for_region_with_zero_min_pages, "sanity") {
size_t region_size = 16 * os::vm_page_size();