Skip to content

Commit

Permalink
Merging latest master from level jdk-12+21
Browse files Browse the repository at this point in the history
  • Loading branch information
j9build committed Nov 25, 2018
2 parents 6714f36 + ee2a512 commit 598ca65
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 31 deletions.
26 changes: 14 additions & 12 deletions src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,19 +684,21 @@ Java_java_net_PlainDatagramSocketImpl_peekData(JNIEnv *env, jobject this,
packetAddress = NULL;
}
}
if (packetAddress == NULL) {
packetAddress = NET_SockaddrToInetAddress(env, &rmtaddr, &port);
/* stuff the new Inetaddress in the packet */
(*env)->SetObjectField(env, packet, dp_addressID, packetAddress);
} else {
/* only get the new port number */
port = NET_GetPortFromSockaddr(&rmtaddr);
if (!(*env)->ExceptionCheck(env)){
if (packetAddress == NULL ) {
packetAddress = NET_SockaddrToInetAddress(env, &rmtaddr, &port);
/* stuff the new InetAddress in the packet */
(*env)->SetObjectField(env, packet, dp_addressID, packetAddress);
} else {
/* only get the new port number */
port = NET_GetPortFromSockaddr(&rmtaddr);
}
/* and fill in the data, remote address/port and such */
(*env)->SetByteArrayRegion(env, packetBuffer, packetBufferOffset, n,
(jbyte *)fullPacket);
(*env)->SetIntField(env, packet, dp_portID, port);
(*env)->SetIntField(env, packet, dp_lengthID, n);
}
/* and fill in the data, remote address/port and such */
(*env)->SetByteArrayRegion(env, packetBuffer, packetBufferOffset, n,
(jbyte *)fullPacket);
(*env)->SetIntField(env, packet, dp_portID, port);
(*env)->SetIntField(env, packet, dp_lengthID, n);
}

if (mallocedPacket) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,14 @@ JNIEXPORT jint JNICALL Java_java_net_DualStackPlainDatagramSocketImpl_socketRece
packetAddress = NULL;
}
}
if (packetAddress == NULL) {
packetAddress = NET_SockaddrToInetAddress(env, &sa, &port);
if (packetAddress != NULL) {
/* stuff the new Inetaddress into the packet */
(*env)->SetObjectField(env, dpObj, dp_addressID, packetAddress);
if (!(*env)->ExceptionCheck(env)){
if (packetAddress == NULL ) {
packetAddress = NET_SockaddrToInetAddress(env, &sa, &port);
if (packetAddress != NULL) {
/* stuff the new InetAddress into the packet */
(*env)->SetObjectField(env, dpObj, dp_addressID, packetAddress);
}
}
}

if (!(*env)->ExceptionCheck(env)) {
/* populate the packet */
(*env)->SetByteArrayRegion(env, packetBuffer, packetBufferOffset, rv,
(jbyte *)fullPacket);
Expand Down
4 changes: 4 additions & 0 deletions src/java.base/windows/native/libnet/PlainSocketImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ JNIEXPORT jint JNICALL Java_java_net_PlainSocketImpl_accept0
SetHandleInformation((HANDLE)(UINT_PTR)newfd, HANDLE_FLAG_INHERIT, 0);

ia = NET_SockaddrToInetAddress(env, &sa, &port);
if (ia == NULL){
closesocket(newfd);
return -1;
}
isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
if (isa == NULL) {
closesocket(newfd);
Expand Down
2 changes: 2 additions & 0 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all

compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x

compiler/intrinsics/mathexact/MulExactLConstantTest.java 8214189 windows-all

#############################################################################

# :hotspot_gc
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ sun/tools/jhsdb/HeapDumpTest.java 8193639 solaris-

com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 8169942 linux-i586,macosx-all,windows-x64

com/sun/jndi/ldap/LdapTimeoutTest.java 8151678 linux-all
com/sun/jndi/ldap/LdapTimeoutTest.java 8151678 generic-all

com/sun/jndi/dns/ConfigTests/PortUnreachable.java 7164518 macosx-all

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ class MyLock {};
List<RecordedEvent> events = Events.fromRecording(recording);

// Determine which safepoints included single and bulk revocation VM operations
Set<Integer> vmOperationsSingle = new HashSet<>();
Set<Integer> vmOperationsBulk = new HashSet<>();
Set<Long> vmOperationsSingle = new HashSet<>();
Set<Long> vmOperationsBulk = new HashSet<>();

for (RecordedEvent event : events) {
if (event.getEventType().getName().equals(EventNames.ExecuteVMOperation)) {
String operation = event.getValue("operation");
Integer safepointId = event.getValue("safepointId");
Long safepointId = event.getValue("safepointId");

if (operation.equals("RevokeBias")) {
vmOperationsSingle.add(safepointId);
Expand All @@ -297,14 +297,14 @@ class MyLock {};
// Match all revoke events to a corresponding VMOperation event
for (RecordedEvent event : events) {
if (event.getEventType().getName().equals(EventNames.BiasedLockRevocation)) {
Integer safepointId = event.getValue("safepointId");
Long safepointId = event.getValue("safepointId");
String lockClass = ((RecordedClass)event.getValue("lockClass")).getName();
if (lockClass.equals(MyLock.class.getName())) {
Asserts.assertTrue(vmOperationsSingle.contains(safepointId));
revokeCount++;
}
} else if (event.getEventType().getName().equals(EventNames.BiasedLockClassRevocation)) {
Integer safepointId = event.getValue("safepointId");
Long safepointId = event.getValue("safepointId");
String lockClass = ((RecordedClass)event.getValue("revokedClass")).getName();
if (lockClass.toString().equals(MyLock.class.getName())) {
Asserts.assertTrue(vmOperationsBulk.contains(safepointId));
Expand Down
4 changes: 2 additions & 2 deletions test/jdk/jdk/jfr/event/runtime/TestSafepointEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public static void main(String[] args) throws Exception {
}

// Collect all events grouped by safepoint id
SortedMap<Integer, Set<String>> safepointIds = new TreeMap<>();
SortedMap<Long, Set<String>> safepointIds = new TreeMap<>();
for (RecordedEvent event : Events.fromRecording(recording)) {
Integer safepointId = event.getValue("safepointId");
Long safepointId = event.getValue("safepointId");
if (!safepointIds.containsKey(safepointId)) {
safepointIds.put(safepointId, new HashSet<>());
}
Expand Down
4 changes: 1 addition & 3 deletions test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ private static void test(String configName, Object value) {

private static void testNegative(String configName, Object value) {
try {
// Syntactically invalid arguments are catched by the JCMD framework where an error code of 1 is returned.
// Syntactically valid arguments that are semantically invalid (invalid value ranges for example) are handled by JFR code, it will always return a value of 0.
JcmdHelper.jcmd(configName.equals(UNSUPPORTED_OPTION) ? 1 : 0, "JFR.configure", configName + "=" + value);
JcmdHelper.jcmd(1, "JFR.configure", configName + "=" + value);
} catch(Exception e) {
testExceptions.add(e);
}
Expand Down

0 comments on commit 598ca65

Please sign in to comment.