1.1 --- a/src/os/solaris/vm/perfMemory_solaris.cpp Fri Jan 24 09:28:47 2014 +0100 1.2 +++ b/src/os/solaris/vm/perfMemory_solaris.cpp Wed Mar 05 11:28:33 2014 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -431,10 +431,12 @@ 1.11 1.12 RESTARTABLE(::read(fd, addr, remaining), result); 1.13 if (result == OS_ERR) { 1.14 + ::close(fd); 1.15 THROW_MSG_0(vmSymbols::java_io_IOException(), "Read error"); 1.16 + } else { 1.17 + remaining-=result; 1.18 + addr+=result; 1.19 } 1.20 - remaining-=result; 1.21 - addr+=result; 1.22 } 1.23 1.24 ::close(fd); 1.25 @@ -906,8 +908,16 @@ 1.26 FREE_C_HEAP_ARRAY(char, filename, mtInternal); 1.27 1.28 // open the shared memory file for the give vmid 1.29 - fd = open_sharedmem_file(rfilename, file_flags, CHECK); 1.30 - assert(fd != OS_ERR, "unexpected value"); 1.31 + fd = open_sharedmem_file(rfilename, file_flags, THREAD); 1.32 + 1.33 + if (fd == OS_ERR) { 1.34 + return; 1.35 + } 1.36 + 1.37 + if (HAS_PENDING_EXCEPTION) { 1.38 + ::close(fd); 1.39 + return; 1.40 + } 1.41 1.42 if (*sizep == 0) { 1.43 size = sharedmem_filesize(fd, CHECK);