Re: RFR: 8264827: Large mapped buffer/segment crash the VM when calling isLoaded [v2]

2021-04-12 Thread Maurizio Cimadamore
On Mon, 12 Apr 2021 08:31:51 GMT, Chris Hegarty  wrote:

>> Avoid overflow when calculating the number of pages for large mapped segment 
>> sizes.
>
> Chris Hegarty has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Skip testing on 32-bit systems

Looks good - thanks for fixing.

-

Marked as reviewed by mcimadamore (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3378


Re: RFR: 8264827: Large mapped buffer/segment crash the VM when calling isLoaded [v2]

2021-04-12 Thread Chris Hegarty
> Avoid overflow when calculating the number of pages for large mapped segment 
> sizes.

Chris Hegarty has updated the pull request incrementally with one additional 
commit since the last revision:

  Skip testing on 32-bit systems

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3378/files
  - new: https://git.openjdk.java.net/jdk/pull/3378/files/1816b200..1dbe4a63

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=3378=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=3378=00-01

  Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3378.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3378/head:pull/3378

PR: https://git.openjdk.java.net/jdk/pull/3378


Re: RFR: 8264827: Large mapped buffer/segment crash the VM when calling isLoaded

2021-04-09 Thread Alan Bateman
On Wed, 7 Apr 2021 15:45:30 GMT, Chris Hegarty  wrote:

> Avoid overflow when calculating the number of pages for large mapped segment 
> sizes.

Looks okay to me.

-

Marked as reviewed by alanb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3378


Re: RFR: 8264827: Large mapped buffer/segment crash the VM when calling isLoaded

2021-04-09 Thread Chris Hegarty
On Wed, 7 Apr 2021 15:45:30 GMT, Chris Hegarty  wrote:

> Avoid overflow when calculating the number of pages for large mapped segment 
> sizes.

Note for reviewers on the test. A 3GB file is sufficient to demonstrate the 
issue in the old code, as follows (with a 4K page size, since the narrowing 
cast of size is the significant issue):

jshell> int pageSize() { return 4 * 1024; }
|  created method pageSize()

jshell> int pageCount(long size) { return (int)(size + (long)pageSize() - 1L) / 
pageSize(); }
|  created method pageCount(long)

jshell> pageCount(3L * 1024L * 1024L * 1024L)
$3 ==> -262143

-

PR: https://git.openjdk.java.net/jdk/pull/3378


RFR: 8264827: Large mapped buffer/segment crash the VM when calling isLoaded

2021-04-09 Thread Chris Hegarty
Avoid overflow when calculating the number of pages for large mapped segment 
sizes.

-

Commit messages:
 - Test update
 - Initial changes

Changes: https://git.openjdk.java.net/jdk/pull/3378/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=3378=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264827
  Stats: 32 lines in 5 files changed: 19 ins; 0 del; 13 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3378.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3378/head:pull/3378

PR: https://git.openjdk.java.net/jdk/pull/3378