mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8264827: Large mapped buffer/segment crash the VM when calling isLoaded
Reviewed-by: alanb, mcimadamore
This commit is contained in:
parent
e604320bbd
commit
3c9858ddfb
5 changed files with 36 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2021, 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
|
||||
|
@ -56,11 +56,11 @@ static long calculate_number_of_pages_in_range(void* address, size_t len, size_t
|
|||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_java_nio_MappedMemoryUtils_isLoaded0(JNIEnv *env, jobject obj, jlong address,
|
||||
jlong len, jint numPages)
|
||||
jlong len, jlong numPages)
|
||||
{
|
||||
jboolean loaded = JNI_TRUE;
|
||||
int result = 0;
|
||||
int i = 0;
|
||||
long i = 0;
|
||||
void *a = (void *) jlong_to_ptr(address);
|
||||
mincore_vec_t* vec = NULL;
|
||||
|
||||
|
@ -70,7 +70,7 @@ Java_java_nio_MappedMemoryUtils_isLoaded0(JNIEnv *env, jobject obj, jlong addres
|
|||
if ((long)pagesize == -1) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
numPages = (jint) calculate_number_of_pages_in_range(a, len, pagesize);
|
||||
numPages = (jlong) calculate_number_of_pages_in_range(a, len, pagesize);
|
||||
#endif
|
||||
|
||||
/* Include space for one sentinel byte at the end of the buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue