/hg/icedtea7-forest/jdk: 5 new changesets
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Thu Jul 30 16:53:13 UTC 2015
changeset c1787ebf3df9 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=c1787ebf3df9
author: andrew
date: Mon Jul 20 00:11:26 2015 +0100
PR2487: Make jdk8 mode the default for jdk.tls.ephemeralDHKeySize
Summary: Backout 45680a70921daf8a5929b890de22c2fa5d117d82
changeset 61d3e001dee6 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=61d3e001dee6
author: andrew
date: Tue Jul 21 01:32:24 2015 +0100
PR2521: Systems with a GLib without libgio segfault when obtaining proxy information
changeset 45990351ea27 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=45990351ea27
author: sla
date: Fri Oct 18 11:52:24 2013 +0200
8021897, PR2560: EXCEPTION_ACCESS_VIOLATION on debugging String.contentEquals()
Reviewed-by: alanb, sspitsyn
changeset ab23850139cb in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=ab23850139cb
author: egahlin
date: Wed Oct 23 10:50:34 2013 +0200
7105883, PR2560: JDWP: agent crash if there exists a ThreadGroup with null name
Reviewed-by: sla, jbachorik
changeset a2334007f1a8 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=a2334007f1a8
author: andrew
date: Thu Jul 30 17:52:32 2015 +0100
PR2568: openjdk causes a full desktop crash on RHEL 6 i586
Summary: Re-apply "8025775: JNI warnings in TryXShmAttach"; some changes lost in bad merge changeset 4b26f93b23ba
diffstat:
src/share/back/ThreadGroupReferenceImpl.c | 2 +-
src/share/back/outStream.c | 4 +-
src/share/classes/sun/security/ssl/ServerHandshaker.java | 19 +-
src/solaris/classes/sun/awt/X11/XConstants.java | 5 -
src/solaris/classes/sun/awt/X11/XErrorHandler.java | 94 ------------
src/solaris/native/common/deps/glib2/gio_fp.c | 10 +-
src/solaris/native/common/deps/glib2/glib_fp.h | 7 +-
src/solaris/native/sun/awt/awt_GraphicsEnv.h | 2 +-
src/solaris/native/sun/awt/awt_xembed_server.c | 17 +-
src/solaris/native/sun/java2d/x11/X11SurfaceData.c | 4 +-
src/solaris/native/sun/net/spi/DefaultProxySelector.c | 3 +
test/com/sun/jdi/GetUninitializedStringValue.java | 91 ++++++++++++
test/com/sun/jdi/NullThreadGroupNameTest.java | 112 +++++++++++++++
13 files changed, 237 insertions(+), 133 deletions(-)
diffs (truncated from 539 to 500 lines):
diff -r ff3cd846027a -r a2334007f1a8 src/share/back/ThreadGroupReferenceImpl.c
--- a/src/share/back/ThreadGroupReferenceImpl.c Sun Jul 19 18:19:29 2015 +0100
+++ b/src/share/back/ThreadGroupReferenceImpl.c Thu Jul 30 17:52:32 2015 +0100
@@ -47,7 +47,7 @@
(void)memset(&info, 0, sizeof(info));
threadGroupInfo(group, &info);
- (void)outStream_writeString(out, info.name);
+ (void)outStream_writeString(out, info.name == NULL ? "" : info.name);
if ( info.name != NULL )
jvmtiDeallocate(info.name);
diff -r ff3cd846027a -r a2334007f1a8 src/share/back/outStream.c
--- a/src/share/back/outStream.c Sun Jul 19 18:19:29 2015 +0100
+++ b/src/share/back/outStream.c Thu Jul 30 17:52:32 2015 +0100
@@ -298,17 +298,15 @@
outStream_writeString(PacketOutputStream *stream, char *string)
{
jdwpError error;
- jint length;
+ jint length = string != NULL ? (int)strlen(string) : 0;
/* Options utf8=y/n controls if we want Standard UTF-8 or Modified */
if ( gdata->modifiedUtf8 ) {
- length = (int)strlen(string);
(void)outStream_writeInt(stream, length);
error = writeBytes(stream, (jbyte *)string, length);
} else {
jint new_length;
- length = (int)strlen(string);
new_length = (gdata->npt->utf8mToUtf8sLength)
(gdata->npt->utf, (jbyte*)string, length);
if ( new_length == length ) {
diff -r ff3cd846027a -r a2334007f1a8 src/share/classes/sun/security/ssl/ServerHandshaker.java
--- a/src/share/classes/sun/security/ssl/ServerHandshaker.java Sun Jul 19 18:19:29 2015 +0100
+++ b/src/share/classes/sun/security/ssl/ServerHandshaker.java Thu Jul 30 17:52:32 2015 +0100
@@ -120,15 +120,15 @@
String property = AccessController.doPrivileged(
new GetPropertyAction("jdk.tls.ephemeralDHKeySize"));
if (property == null || property.length() == 0) {
- useLegacyEphemeralDHKeys = true;
+ useLegacyEphemeralDHKeys = false;
useSmartEphemeralDHKeys = false;
customizedDHKeySize = -1;
} else if ("matched".equals(property)) {
useLegacyEphemeralDHKeys = false;
useSmartEphemeralDHKeys = true;
customizedDHKeySize = -1;
- } else if ("jdk8".equals(property)) {
- useLegacyEphemeralDHKeys = false;
+ } else if ("legacy".equals(property)) {
+ useLegacyEphemeralDHKeys = true;
useSmartEphemeralDHKeys = false;
customizedDHKeySize = -1;
} else {
@@ -1253,14 +1253,15 @@
* 768 bits ephemeral DH private keys were used to be used in
* ServerKeyExchange except that exportable ciphers max out at 512
* bits modulus values. We still adhere to this behavior in legacy
- * mode (system property "jdk.tls.ephemeralDHKeySize"
+ * mode (system property "jdk.tls.ephemeralDHKeySize" is defined
+ * as "legacy").
+ *
+ * Older versions of OpenJDK don't support DH keys bigger
+ * than 1024 bits. We have to consider the compatibility requirement.
+ * 1024 bits DH key is always used for non-exportable cipher suites
+ * in default mode (system property "jdk.tls.ephemeralDHKeySize"
* is not defined).
*
- * New JDK (JDK 8 and later) releases use a 1024 bit DH key for
- * non-exportable cipher suites in default mode and this can
- * be enabled when the system property "jdk.tls.ephemeralDHKeySize"
- * is defined as "jdk8".
- *
* However, if applications want more stronger strength, setting
* system property "jdk.tls.ephemeralDHKeySize" to "matched"
* is a workaround to use ephemeral DH key which size matches the
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/classes/sun/awt/X11/XConstants.java
--- a/src/solaris/classes/sun/awt/X11/XConstants.java Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/classes/sun/awt/X11/XConstants.java Thu Jul 30 17:52:32 2015 +0100
@@ -699,9 +699,4 @@
public static final long XkbModifierMapMask = (1L<<2);
public static final long XkbVirtualModsMask = (1L<<6); //server map
- /*****************************************************************
- * X SHARED MEMORY EXTENSION FUNCTIONS
- *****************************************************************/
-
- public static final int X_ShmAttach = 1;
}
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/classes/sun/awt/X11/XErrorHandler.java
--- a/src/solaris/classes/sun/awt/X11/XErrorHandler.java Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/classes/sun/awt/X11/XErrorHandler.java Thu Jul 30 17:52:32 2015 +0100
@@ -41,29 +41,6 @@
return XErrorHandlerUtil.SAVED_XERROR_HANDLER(display, err);
}
}
-
- /**
- * This is a base synthetic error handler containing a boolean flag which allows
- * to show that an error is handled or not.
- */
- public static class XErrorHandlerWithFlag extends XBaseErrorHandler {
- private volatile boolean errorOccurred = false;
-
- public boolean getErrorOccurredFlag() {
- return errorOccurred;
- }
-
- /**
- * Sets an internal boolean flag to a particular value. Should be always called
- * with {@code false} value of the parameter {@code errorOccurred} before this
- * error handler is set as current.
- * @param errorOccurred {@code true} to indicate that an error was handled,
- * {@code false} to reset the internal boolean flag
- */
- public void setErrorOccurredFlag(boolean errorOccurred) {
- this.errorOccurred = errorOccurred;
- }
- }
/*
* Instead of validating window id, we simply call XGetWindowProperty,
@@ -99,75 +76,4 @@
return theInstance;
}
}
-
- /**
- * This is a synthetic error handler for errors generated by the native function
- * {@code XShmAttach}. If an error is handled, an internal boolean flag of the
- * handler is set to {@code true}.
- */
- public static final class XShmAttachHandler extends XErrorHandlerWithFlag {
- private XShmAttachHandler() {}
-
- @Override
- public int handleError(long display, XErrorEvent err) {
- if (err.get_minor_code() == XConstants.X_ShmAttach) {
- setErrorOccurredFlag(true);
- return 0;
- }
- return super.handleError(display, err);
- }
-
- // Shared instance
- private static XShmAttachHandler theInstance = new XShmAttachHandler();
- public static XShmAttachHandler getInstance() {
- return theInstance;
- }
- }
-
- /**
- * This is a synthetic error handler for {@code BadAlloc} errors generated by the
- * native {@code glX*} functions. Its internal boolean flag is set to {@code true},
- * if an error is handled.
- */
- public static final class GLXBadAllocHandler extends XErrorHandlerWithFlag {
- private GLXBadAllocHandler() {}
-
- @Override
- public int handleError(long display, XErrorEvent err) {
- if (err.get_error_code() == XConstants.BadAlloc) {
- setErrorOccurredFlag(true);
- return 0;
- }
- return super.handleError(display, err);
- }
-
- private static GLXBadAllocHandler theInstance = new GLXBadAllocHandler();
- public static GLXBadAllocHandler getInstance() {
- return theInstance;
- }
- }
-
- /**
- * This is a synthetic error handler for errors generated by the native function
- * {@code XChangeWindowAttributes}. If an error is handled, an internal boolean
- * flag of the handler is set to {@code true}.
- */
- public static final class XChangeWindowAttributesHandler extends XErrorHandlerWithFlag {
- private XChangeWindowAttributesHandler() {}
-
- @Override
- public int handleError(long display, XErrorEvent err) {
- if ((err.get_request_code() == XProtocolConstants.X_ChangeWindowAttributes) &&
- (err.get_error_code() == XConstants.BadAccess)) {
- setErrorOccurredFlag(true);
- return 0;
- }
- return super.handleError(display, err);
- }
-
- private static XChangeWindowAttributesHandler theInstance = new XChangeWindowAttributesHandler();
- public static XChangeWindowAttributesHandler getInstance() {
- return theInstance;
- }
- }
}
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/native/common/deps/glib2/gio_fp.c
--- a/src/solaris/native/common/deps/glib2/gio_fp.c Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/native/common/deps/glib2/gio_fp.c Thu Jul 30 17:52:32 2015 +0100
@@ -55,6 +55,7 @@
if (gio_handle == NULL) {
gio_handle = dlopen("libgio-2.0.so.0", RTLD_LAZY);
if (gio_handle == NULL) {
+ NATDEBUG("Couldn't find libgio; returning false\n")
return JNI_FALSE;
}
}
@@ -124,7 +125,14 @@
jboolean gsettings_init()
{
- gio_init();
+ jboolean gio_init_result;
+
+ gio_init_result = gio_init();
+ if (gio_init_result == JNI_FALSE)
+ {
+ NATDEBUG("gio_init failed; returning false\n")
+ return JNI_FALSE;
+ }
if (settings_new != NULL &&
settings_get_boolean != NULL &&
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/native/common/deps/glib2/glib_fp.h
--- a/src/solaris/native/common/deps/glib2/glib_fp.h Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/native/common/deps/glib2/glib_fp.h Thu Jul 30 17:52:32 2015 +0100
@@ -54,12 +54,11 @@
} GError;
#endif
-#ifndef g_type_init
+#ifndef USE_SYSTEM_GIO
+#ifndef USE_SYSTEM_GCONF
#define g_type_init (*type_init)
+#define g_free (*gfree)
#endif
-
-#ifndef g_free
-#define g_free (*gfree)
#endif
typedef void (*type_init_func)(void);
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/native/sun/awt/awt_GraphicsEnv.h
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.h Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.h Thu Jul 30 17:52:32 2015 +0100
@@ -54,7 +54,7 @@
void TryInitMITShm(JNIEnv *env, jint *shmExt, jint *shmPixmaps);
void resetXShmAttachFailed();
-jboolean TryXShmAttach(JNIEnv *env, Display *display, XShmSegmentInfo *shminfo);
+jboolean isXShmAttachFailed();
#endif /* MITSHM */
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/native/sun/awt/awt_xembed_server.c
--- a/src/solaris/native/sun/awt/awt_xembed_server.c Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/native/sun/awt/awt_xembed_server.c Thu Jul 30 17:52:32 2015 +0100
@@ -644,19 +644,12 @@
return dim;
}
-Boolean isMapped(JNIEnv* env, Window w) {
+Boolean isMapped(Window w) {
XWindowAttributes attr;
Status status = 0;
- jboolean errorOccurredFlag;
- jobject errorHandlerRef;
- jobject savedError;
- unsigned char xerror_code;
-
- EXEC_WITH_XERROR_HANDLER(env, "sun/awt/X11/XErrorHandler$IgnoreBadWindowHandler",
- "()Lsun/awt/X11/XErrorHandler$IgnoreBadWindowHandler;", JNI_FALSE,
- errorHandlerRef, errorOccurredFlag,
- status = XGetWindowAttributes(awt_display, w, &attr));
- xerror_code = GET_XERROR_CODE(env, savedError);
+ WITH_XERROR_HANDLER(xerror_ignore_bad_window);
+ status = XGetWindowAttributes(awt_display, w, &attr);
+ RESTORE_XERROR_HANDLER;
if (status == 0 || xerror_code != Success) {
return False;
}
@@ -692,7 +685,7 @@
sdata->version = *data;
flags = *(data+1);
new_mapped = (flags & XEMBED_MAPPED) != 0;
- currently_mapped = isMapped(env, sdata->handle);
+ currently_mapped = isMapped(sdata->handle);
if (new_mapped != currently_mapped) {
if (new_mapped) {
XMapWindow(awt_display, sdata->handle);
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/native/sun/java2d/x11/X11SurfaceData.c
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c Thu Jul 30 17:52:32 2015 +0100
@@ -551,8 +551,6 @@
{
XImage *img = NULL;
XShmSegmentInfo *shminfo;
- JNIEnv* env;
- jboolean xShmAttachResult;
shminfo = malloc(sizeof(XShmSegmentInfo));
if (shminfo == NULL) {
@@ -603,7 +601,7 @@
*/
shmctl(shminfo->shmid, IPC_RMID, 0);
- if (xShmAttachResult == JNI_FALSE) {
+ if (isXShmAttachFailed() == JNI_TRUE) {
J2dRlsTraceLn1(J2D_TRACE_ERROR,
"X11SD_SetupSharedSegment XShmAttach has failed: %s",
strerror(errno));
diff -r ff3cd846027a -r a2334007f1a8 src/solaris/native/sun/net/spi/DefaultProxySelector.c
--- a/src/solaris/native/sun/net/spi/DefaultProxySelector.c Sun Jul 19 18:19:29 2015 +0100
+++ b/src/solaris/native/sun/net/spi/DefaultProxySelector.c Thu Jul 30 17:52:32 2015 +0100
@@ -231,6 +231,9 @@
}
} else {
if (gconf_client == NULL) {
+#ifdef NATIVE_SUPPORT_DEBUG
+ printf("g_type_init=%p\n", g_type_init);
+#endif
g_type_init();
gconf_client = gconf_client_get_default();
}
diff -r ff3cd846027a -r a2334007f1a8 test/com/sun/jdi/GetUninitializedStringValue.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jdi/GetUninitializedStringValue.java Thu Jul 30 17:52:32 2015 +0100
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2013, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8021897
+ * @summary Test getting the value for an uninitialized String object
+ *
+ * @author Staffan Larsen
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetUninitializedStringValue.java
+ * @run main GetUninitializedStringValue
+ */
+import com.sun.jdi.ReferenceType;
+import com.sun.jdi.StackFrame;
+import com.sun.jdi.StringReference;
+import com.sun.jdi.ThreadReference;
+import com.sun.jdi.event.BreakpointEvent;
+
+ /********** target program **********/
+
+class GetUninitializedStringValueTarg {
+ public static void main(String[] args) {
+ new String("foo");
+ System.out.println("Goodbye from GetUninitializedStringValueTarg!");
+ }
+}
+
+ /********** test program **********/
+
+public class GetUninitializedStringValue extends TestScaffold {
+ ReferenceType targetClass;
+ ThreadReference mainThread;
+
+ GetUninitializedStringValue (String args[]) {
+ super(args);
+ }
+
+ public static void main(String[] args)
+ throws Exception
+ {
+ new GetUninitializedStringValue (args).startTests();
+ }
+
+ /********** test core **********/
+
+ protected void runTests()
+ throws Exception
+ {
+ /*
+ * Run to String.<init>
+ */
+ startUp("GetUninitializedStringValueTarg");
+ BreakpointEvent bpe = resumeTo("java.lang.String", "<init>", "(Ljava/lang/String;)V");
+
+ /*
+ * We've arrived. Look at 'this' - it will be uninitialized (the value field will not be set yet).
+ */
+ StackFrame frame = bpe.thread().frame(0);
+ StringReference sr = (StringReference)frame.thisObject();
+ if (!sr.value().equals("")) {
+ throw new Exception("Unexpected value for the uninitialized String");
+ }
+
+ /*
+ * resume the target listening for events
+ */
+ listenUntilVMDisconnect();
+ }
+}
diff -r ff3cd846027a -r a2334007f1a8 test/com/sun/jdi/NullThreadGroupNameTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jdi/NullThreadGroupNameTest.java Thu Jul 30 17:52:32 2015 +0100
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 7105883
+ * @summary Ensure that JDWP doesn't crash with a null thread group name
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run main NullThreadGroupNameTest
+ */
+import com.sun.jdi.*;
+import com.sun.jdi.connect.*;
+import com.sun.jdi.event.*;
+import com.sun.jdi.request.*;
+import com.sun.jdi.VMDisconnectedException;
+import java.util.concurrent.CountDownLatch;
+import java.util.*;
+
+class DebugTarget {
+ public final static String DEBUG_THREAD_NAME = "DebugThread";
+
+ public static void main(String[] args) throws Exception {
+ DebugThread thread = new DebugThread();
+ thread.start();
+ thread.runningLatch.await();
+ breakpointHere();
+ thread.breakpointLatch.countDown();
+ }
+
+ public static void breakpointHere() {
+ System.out.println("Breakpoint finished!");
+ }
+
+ static class DebugThread extends Thread {
+ final CountDownLatch runningLatch = new CountDownLatch(1);
+ final CountDownLatch breakpointLatch = new CountDownLatch(1);
+
+ public DebugThread() {
+ super(new ThreadGroup(null), DEBUG_THREAD_NAME);
+ }
+
+ public void run() {
+ runningLatch.countDown();
+ try {
+ breakpointLatch.await();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
+ }
+ }
+ }
+}
+
More information about the distro-pkg-dev
mailing list