jdk (original) (raw)
Code Review for jdk
Prepared by: | simonis on Wed Jan 22 18:39:19 CET 2014 |
---|---|
Workspace: | /net/usr.work/d046063/OpenJDK/ppc-aix-port/stage-9/jdk |
Compare against: | http://hg.openjdk.java.net/ppc-aix-port/stage-9/jdk |
Compare against version: | 8977 |
Summary of changes: | 616 lines changed: 575 ins; 22 del; 19 mod; 10795 unchg |
Changeset: | <jdk.changeset> |
Bug id: | JDK-8031581 : PPC64: Addons and fixes for AIX to pass the jdk regression tests |
Author comments: | src/share/native/java/util/zip/zip_util.c src/share/native/sun/management/DiagnosticCommandImpl.c According to ISO C it is perfectly legal for malloc to return zero if called with a zero argument. Fix various places where malloc can potentially correctly return zero because it was called with a zero argument. Also fixed DiagnosticCommandImpl.c to include stdlib.h. This only fixes a compiler warning on Linux, but on AIX it prevents a VM crash later on because the return value of malloc() will be casted to int which is especially bad if that pointer was bigger than 32-bit. make/CompileJavaClasses.gmk Also use PollingWatchService on AIX. src/share/classes/java/nio/file/CopyMoveHelper.java As discussed on the core-libs mailing list (see http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-December/024119.html) it is not necessary to call Files.getFileAttributeView() with any linkOptions because at that place we've already checked that the target file can not be a symbolic link. This change makes the implementation more robust on platforms which support symbolic links but do not support the O_NOFOLLOW flag to the open system call. It also makes the JDK pass the demo/zipfs/basic.sh test on AIX. src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Support "compound text" on AIX in the same way like on other Unix platforms. src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider Define the correct attach provider for AIX. src/solaris/native/sun/nio/ch/FileDispatcherImpl.c Calling fsync() on a "read-only" file descriptor on AIX will result in an error (i.e. "EBADF: The FileDescriptor parameter is not a valid file descriptor open for writing."). To prevent this error we have to query if the corresponding file descriptor is writwable. Notice that at that point we can not access the writeable attribute of the corresponding file channel so we have to usefcntl(). src/solaris/classes/java/lang/UNIXProcess.java.aix On AIX the implementation is especially tricky, because the close() system call will block if another thread is at the same time blocked in a file operation (e.g. 'read()') on the same file descriptor. We therefore combine the AIX ProcessPipeInputStream implemenatation with the DeferredCloseInputStream approach used on Solaris (see UNIXProcess.java.solaris). This means that every potentially blocking operation on the file descriptor increments a counter before it is executed and decrements it once it finishes. The 'close()' operation will only be executed if there are no pending operations. Otherwise it is deferred after the last pending operation has finished. src/share/transport/socket/socketTransport.c On AIX we have to call shutdown() on a socket descriptor before closing it, otherwise the close() call may be blocked. This is the same problem as described before. Unfortunately the JDI framework doesn't use the same IO wrappers like other class library components so we can not easily use the NET_ abstractions from aix_close.c here. Without this small change all JDI regression tests will fail on AIX because of the way how the tests act as a "debugger" which launches another VM (the "debugge") which connects itself back to the debugger. In this scenario the "debugge" can not shut down itself because one thread will always be blocked in the close() call on one of the communication sockets. src/solaris/native/java/net/NetworkInterface.c Set the scope identifier for IPv6 addresses on AIX. src/solaris/native/java/net/net_util_md.c It turns out that we do not always have to replace SO_REUSEADDR on AIX by SO_REUSEPORT. Instead we can simply use the same approach like BSD and only use SO_REUSEPORT additionally, if several datagram sockets try to bind to the same port. Also fixed a comment and removed unused local variables. Fixed the obviously inverted assignment newTime = prevTime; which should read prevTime = newTime;. Otherwise prevTime will never change and the timeout will be potential reached too fast. src/solaris/native/sun/management/OperatingSystemImpl.c AIX does not understand /proc/self so we have to query the real process ID to access the proc file system. src/solaris/native/sun/nio/ch/DatagramChannelImpl.c On AIX, connect() may legally return EAFNOSUPPORT if called on a socket with the address family set to AF_UNSPEC. |
Legend: | Modified file Deleted file New file |
[Cdiffs](make/CompileJavaClasses.gmk.cdiff.html) [Udiffs](make/CompileJavaClasses.gmk.udiff.html) [Sdiffs](make/CompileJavaClasses.gmk.sdiff.html) [Frames](make/CompileJavaClasses.gmk.frames.html) [Old](make/CompileJavaClasses.gmk-.html) [New](make/CompileJavaClasses.gmk.html) -----[Raw](raw%5Ffiles/new/make/CompileJavaClasses.gmk)
make/CompileJavaClasses.gmk
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
7 lines changed: 5 ins; 0 del; 2 mod; 453 unchg
[Cdiffs](src/aix/native/java/net/aix%5Fclose.c.cdiff.html) [Udiffs](src/aix/native/java/net/aix%5Fclose.c.udiff.html) [Sdiffs](src/aix/native/java/net/aix%5Fclose.c.sdiff.html) [Frames](src/aix/native/java/net/aix%5Fclose.c.frames.html) [Old](src/aix/native/java/net/aix%5Fclose.c-.html) [New](src/aix/native/java/net/aix%5Fclose.c.html) -----[Raw](raw%5Ffiles/new/src/aix/native/java/net/aix%5Fclose.c)
src/aix/native/java/net/aix_close.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
28 lines changed: 17 ins; 6 del; 5 mod; 416 unchg
[Cdiffs](src/share/classes/java/nio/file/CopyMoveHelper.java.cdiff.html) [Udiffs](src/share/classes/java/nio/file/CopyMoveHelper.java.udiff.html) [Sdiffs](src/share/classes/java/nio/file/CopyMoveHelper.java.sdiff.html) [Frames](src/share/classes/java/nio/file/CopyMoveHelper.java.frames.html) [Old](src/share/classes/java/nio/file/CopyMoveHelper.java-.html) [New](src/share/classes/java/nio/file/CopyMoveHelper.java.html) -----[Raw](raw%5Ffiles/new/src/share/classes/java/nio/file/CopyMoveHelper.java)
src/share/classes/java/nio/file/CopyMoveHelper.java
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
1 line changed: 0 ins; 0 del; 1 mod; 159 unchg
[Cdiffs](src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.cdiff.html) [Udiffs](src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.udiff.html) [Sdiffs](src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.sdiff.html) [Frames](src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.frames.html) [Old](src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java-.html) [New](src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.html) -----[Raw](raw%5Ffiles/new/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java)
src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
1 line changed: 0 ins; 0 del; 1 mod; 1316 unchg
[Cdiffs](src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider.cdiff.html) [Udiffs](src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider.udiff.html) [Sdiffs](src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider.sdiff.html) [Frames](src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider.frames.html) [Old](src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider-.html) [New](src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider.html) -----[Raw](raw%5Ffiles/new/src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider)
src/share/classes/sun/tools/attach/META-INF/services/com.sun.tools.attach.spi.AttachProvider
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
1 line changed: 1 ins; 0 del; 0 mod; 33 unchg
[Cdiffs](src/share/native/java/util/zip/zip%5Futil.c.cdiff.html) [Udiffs](src/share/native/java/util/zip/zip%5Futil.c.udiff.html) [Sdiffs](src/share/native/java/util/zip/zip%5Futil.c.sdiff.html) [Frames](src/share/native/java/util/zip/zip%5Futil.c.frames.html) [Old](src/share/native/java/util/zip/zip%5Futil.c-.html) [New](src/share/native/java/util/zip/zip%5Futil.c.html) -----[Raw](raw%5Ffiles/new/src/share/native/java/util/zip/zip%5Futil.c)
src/share/native/java/util/zip/zip_util.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
4 lines changed: 3 ins; 0 del; 1 mod; 1461 unchg
[Cdiffs](src/share/native/sun/management/DiagnosticCommandImpl.c.cdiff.html) [Udiffs](src/share/native/sun/management/DiagnosticCommandImpl.c.udiff.html) [Sdiffs](src/share/native/sun/management/DiagnosticCommandImpl.c.sdiff.html) [Frames](src/share/native/sun/management/DiagnosticCommandImpl.c.frames.html) [Old](src/share/native/sun/management/DiagnosticCommandImpl.c-.html) [New](src/share/native/sun/management/DiagnosticCommandImpl.c.html) -----[Raw](raw%5Ffiles/new/src/share/native/sun/management/DiagnosticCommandImpl.c)
src/share/native/sun/management/DiagnosticCommandImpl.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
20 lines changed: 12 ins; 7 del; 1 mod; 161 unchg
[Cdiffs](src/share/transport/socket/socketTransport.c.cdiff.html) [Udiffs](src/share/transport/socket/socketTransport.c.udiff.html) [Sdiffs](src/share/transport/socket/socketTransport.c.sdiff.html) [Frames](src/share/transport/socket/socketTransport.c.frames.html) [Old](src/share/transport/socket/socketTransport.c-.html) [New](src/share/transport/socket/socketTransport.c.html) -----[Raw](raw%5Ffiles/new/src/share/transport/socket/socketTransport.c)
src/share/transport/socket/socketTransport.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
13 lines changed: 13 ins; 0 del; 0 mod; 744 unchg
[Cdiffs](src/solaris/classes/java/lang/UNIXProcess.java.aix.cdiff.html) [Udiffs](src/solaris/classes/java/lang/UNIXProcess.java.aix.udiff.html) [Sdiffs](src/solaris/classes/java/lang/UNIXProcess.java.aix.sdiff.html) [Frames](src/solaris/classes/java/lang/UNIXProcess.java.aix.frames.html) [Old](src/solaris/classes/java/lang/UNIXProcess.java.aix-.html) [New](src/solaris/classes/java/lang/UNIXProcess.java.aix.html) -----[Raw](raw%5Ffiles/new/src/solaris/classes/java/lang/UNIXProcess.java.aix)
src/solaris/classes/java/lang/UNIXProcess.java.aix
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
86 lines changed: 85 ins; 0 del; 1 mod; 418 unchg
[Cdiffs](src/solaris/native/java/net/NetworkInterface.c.cdiff.html) [Udiffs](src/solaris/native/java/net/NetworkInterface.c.udiff.html) [Sdiffs](src/solaris/native/java/net/NetworkInterface.c.sdiff.html) [Frames](src/solaris/native/java/net/NetworkInterface.c.frames.html) [Old](src/solaris/native/java/net/NetworkInterface.c-.html) [New](src/solaris/native/java/net/NetworkInterface.c.html) -----[Raw](raw%5Ffiles/new/src/solaris/native/java/net/NetworkInterface.c)
src/solaris/native/java/net/NetworkInterface.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
6 lines changed: 5 ins; 0 del; 1 mod; 2167 unchg
[Cdiffs](src/solaris/native/java/net/net%5Futil%5Fmd.c.cdiff.html) [Udiffs](src/solaris/native/java/net/net%5Futil%5Fmd.c.udiff.html) [Sdiffs](src/solaris/native/java/net/net%5Futil%5Fmd.c.sdiff.html) [Frames](src/solaris/native/java/net/net%5Futil%5Fmd.c.frames.html) [Old](src/solaris/native/java/net/net%5Futil%5Fmd.c-.html) [New](src/solaris/native/java/net/net%5Futil%5Fmd.c.html) -----[Raw](raw%5Ffiles/new/src/solaris/native/java/net/net%5Futil%5Fmd.c)
src/solaris/native/java/net/net_util_md.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
15 lines changed: 3 ins; 9 del; 3 mod; 1671 unchg
[Cdiffs](src/solaris/native/sun/management/OperatingSystemImpl.c.cdiff.html) [Udiffs](src/solaris/native/sun/management/OperatingSystemImpl.c.udiff.html) [Sdiffs](src/solaris/native/sun/management/OperatingSystemImpl.c.sdiff.html) [Frames](src/solaris/native/sun/management/OperatingSystemImpl.c.frames.html) [Old](src/solaris/native/sun/management/OperatingSystemImpl.c-.html) [New](src/solaris/native/sun/management/OperatingSystemImpl.c.html) -----[Raw](raw%5Ffiles/new/src/solaris/native/sun/management/OperatingSystemImpl.c)
src/solaris/native/sun/management/OperatingSystemImpl.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
10 lines changed: 9 ins; 0 del; 1 mod; 466 unchg
[Cdiffs](src/solaris/native/sun/nio/ch/DatagramChannelImpl.c.cdiff.html) [Udiffs](src/solaris/native/sun/nio/ch/DatagramChannelImpl.c.udiff.html) [Sdiffs](src/solaris/native/sun/nio/ch/DatagramChannelImpl.c.sdiff.html) [Frames](src/solaris/native/sun/nio/ch/DatagramChannelImpl.c.frames.html) [Old](src/solaris/native/sun/nio/ch/DatagramChannelImpl.c-.html) [New](src/solaris/native/sun/nio/ch/DatagramChannelImpl.c.html) -----[Raw](raw%5Ffiles/new/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c)
src/solaris/native/sun/nio/ch/DatagramChannelImpl.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
9 lines changed: 8 ins; 0 del; 1 mod; 242 unchg
[Cdiffs](src/solaris/native/sun/nio/ch/FileDispatcherImpl.c.cdiff.html) [Udiffs](src/solaris/native/sun/nio/ch/FileDispatcherImpl.c.udiff.html) [Sdiffs](src/solaris/native/sun/nio/ch/FileDispatcherImpl.c.sdiff.html) [Frames](src/solaris/native/sun/nio/ch/FileDispatcherImpl.c.frames.html) [Old](src/solaris/native/sun/nio/ch/FileDispatcherImpl.c-.html) [New](src/solaris/native/sun/nio/ch/FileDispatcherImpl.c.html) -----[Raw](raw%5Ffiles/new/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c)
src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
13 lines changed: 13 ins; 0 del; 0 mod; 265 unchg
[Cdiffs](src/solaris/native/sun/nio/ch/Net.c.cdiff.html) [Udiffs](src/solaris/native/sun/nio/ch/Net.c.udiff.html) [Sdiffs](src/solaris/native/sun/nio/ch/Net.c.sdiff.html) [Frames](src/solaris/native/sun/nio/ch/Net.c.frames.html) [Old](src/solaris/native/sun/nio/ch/Net.c-.html) [New](src/solaris/native/sun/nio/ch/Net.c.html) -----[Raw](raw%5Ffiles/new/src/solaris/native/sun/nio/ch/Net.c)
src/solaris/native/sun/nio/ch/Net.c
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
13 lines changed: 12 ins; 0 del; 1 mod; 823 unchg
------ ------ ------ ------ ---[New](src/aix/classes/sun/nio/ch/sctp/SctpChannelImpl.java.html) -----[Raw](raw%5Ffiles/new/src/aix/classes/sun/nio/ch/sctp/SctpChannelImpl.java)
src/aix/classes/sun/nio/ch/sctp/SctpChannelImpl.java
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
150 lines changed: 150 ins; 0 del; 0 mod; 0 unchg
------ ------ ------ ------ ---[New](src/aix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java.html) -----[Raw](raw%5Ffiles/new/src/aix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java)
src/aix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
137 lines changed: 137 ins; 0 del; 0 mod; 0 unchg
------ ------ ------ ------ ---[New](src/aix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java.html) -----[Raw](raw%5Ffiles/new/src/aix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java)
src/aix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
rev 8978 : 8031581: PPC64: Addons and fixes for AIX to pass the jdk regression tests Reviewed-by: alanb, sla
102 lines changed: 102 ins; 0 del; 0 mod; 0 unchg
This code review page was prepared using /net/usr.work/d046063/OpenJDK/webrev/webrev.ksh(vers 25.2-hg+openjdk.java.net).