8253916: ResourceExhausted/resexhausted001 crashes on Linux-x64

Reviewed-by: stuefe, sspitsyn, dholmes
This commit is contained in:
Coleen Phillimore 2020-12-02 13:40:26 +00:00
parent 287b829c04
commit cfb50a9cb7
6 changed files with 10 additions and 10 deletions

View File

@ -103,10 +103,7 @@ void StackOverflow::create_stack_guard_pages() {
} else {
log_warning(os, thread)("Attempt to protect stack guard pages failed ("
PTR_FORMAT "-" PTR_FORMAT ").", p2i(low_addr), p2i(low_addr + len));
if (os::uncommit_memory((char *) low_addr, len)) {
log_warning(os, thread)("Attempt to deallocate stack guard pages failed.");
}
return;
vm_exit_out_of_memory(len, OOM_MPROTECT_ERROR, "memory to guard stack pages");
}
log_debug(os, thread)("Thread " UINTX_FORMAT " stack guard pages activated: "

View File

@ -149,7 +149,8 @@ do {
enum VMErrorType {
INTERNAL_ERROR = 0xe0000000,
OOM_MALLOC_ERROR = 0xe0000001,
OOM_MMAP_ERROR = 0xe0000002
OOM_MMAP_ERROR = 0xe0000002,
OOM_MPROTECT_ERROR = 0xe0000003
};
// Set to suppress secondary error reporting.

View File

@ -510,10 +510,12 @@ void VMError::report(outputStream* st, bool _verbose) {
switch(static_cast<unsigned int>(_id)) {
case OOM_MALLOC_ERROR:
case OOM_MMAP_ERROR:
case OOM_MPROTECT_ERROR:
if (_size) {
st->print("# Native memory allocation ");
st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " :
"(mmap) failed to map ");
(_id == (int)OOM_MMAP_ERROR) ? "(mmap) failed to map " :
"(mprotect) failed to protect ");
jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size);
st->print("%s", buf);
st->print(" bytes");

View File

@ -131,8 +131,6 @@ vmTestbase/metaspace/gc/firstGC_50m/TestDescription.java 8208250 generic-all
vmTestbase/metaspace/gc/firstGC_99m/TestDescription.java 8208250 generic-all
vmTestbase/metaspace/gc/firstGC_default/TestDescription.java 8208250 generic-all
vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001/TestDescription.java 8253916 linux-all
vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted004/TestDescription.java 8253916 linux-all
vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 generic-all
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64

View File

@ -24,6 +24,7 @@
/*
* @test
* @bug 8253916
*
* @summary converted from VM Testbase nsk/jvmti/ResourceExhausted/resexhausted001.
* VM Testbase keywords: [jpda, jvmti, noras, vm6, nonconcurrent, quarantine, exclude]
@ -37,7 +38,7 @@
*
* @library /vmTestbase
* /test/lib
* @run main/othervm/native/timeout=240
* @run main/othervm/native/manual/timeout=240
* -agentlib:resexhausted=-waittime=5
* -XX:-UseGCOverheadLimit
* -Xms16m

View File

@ -24,6 +24,7 @@
/*
* @test
* @bug 8253916
*
* @key randomness
* @summary converted from VM Testbase nsk/jvmti/ResourceExhausted/resexhausted004.
@ -39,7 +40,7 @@
*
* @library /vmTestbase
* /test/lib
* @run main/othervm/native
* @run main/othervm/native/manual
* -agentlib:resexhausted=-waittime=5
* -Xms16m
* -Xmx16m