Details
Description
For the JDK 116 release on the OpenVMS platform running on DIGITAL's
hardware, DIGITAL has changed, the following JDK 116 source file
in the shared part of the JDK.
A potential bug footprint occurs, i.e. an unhand followed by a memory operation that can provoke GC followed by a use of the unhanded pointer;
src/share/java/lang/io.c
* @(#)io.c 1.55 98/07/01^G
Added called to unhand directly before use of thisptr:
i.e. dataptr = unhand(data)->body
diff -c -r JDK116/src/share/java/lang/io.c sun_JDK116/src/share/java/lang/io.c
*** JDK116/src/share/java/lang/io.c Fri Feb 27 21:38:24 1998
--- sun_JDK116/src/share/java/lang/io.c Thu Apr 16 13:49:46 1998
***************
*** 348,355 ****
}
while (len > 0) {
- /* JLR: Second time through loop, GC might trash dataptr. */
- dataptr = unhand(data)->body;
n = sysWriteFD(fdptr, dataptr + off, len);
if (n == -1) {
SignalError(0, IO_EXCEPTION, "write error");
--- 348,353 ----
***************
*** 538,547 ****
}
while (len > 0) {
- /* JLR: Paranoia: ptrs might get GC'd on second pass through loop */
- thisptr = unhand(this);
- fdptr = unhand(thisptr->fd);
- dataptr = unhand(data)->body;
n = sysWriteFD(fdptr, dataptr + off, len);
if (n == -1) {
SignalError(0, IO_EXCEPTION, "write error");
--- 536,541 ----
hardware, DIGITAL has changed, the following JDK 116 source file
in the shared part of the JDK.
A potential bug footprint occurs, i.e. an unhand followed by a memory operation that can provoke GC followed by a use of the unhanded pointer;
src/share/java/lang/io.c
* @(#)io.c 1.55 98/07/01^G
Added called to unhand directly before use of thisptr:
i.e. dataptr = unhand(data)->body
diff -c -r JDK116/src/share/java/lang/io.c sun_JDK116/src/share/java/lang/io.c
*** JDK116/src/share/java/lang/io.c Fri Feb 27 21:38:24 1998
--- sun_JDK116/src/share/java/lang/io.c Thu Apr 16 13:49:46 1998
***************
*** 348,355 ****
}
while (len > 0) {
- /* JLR: Second time through loop, GC might trash dataptr. */
- dataptr = unhand(data)->body;
n = sysWriteFD(fdptr, dataptr + off, len);
if (n == -1) {
SignalError(0, IO_EXCEPTION, "write error");
--- 348,353 ----
***************
*** 538,547 ****
}
while (len > 0) {
- /* JLR: Paranoia: ptrs might get GC'd on second pass through loop */
- thisptr = unhand(this);
- fdptr = unhand(thisptr->fd);
- dataptr = unhand(data)->body;
n = sysWriteFD(fdptr, dataptr + off, len);
if (n == -1) {
SignalError(0, IO_EXCEPTION, "write error");
--- 536,541 ----
Attachments
Issue Links
- relates to
-
JDK-4084384 KEEP_POINTER_ALIVE missing in 1.1.x
- Closed