Skip to content

Commit 44cb1e0

Browse files
[GR-55691] Fixed a crash in InheritedChannel.inetPeerAddress0().
PullRequest: graal/18375
2 parents 9e1ae96 + bf74c97 commit 44cb1e0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationJavaNet.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ class JNIRegistrationJavaNet extends JNIRegistrationUtil implements InternalFeat
5050
public void duringSetup(DuringSetupAccess a) {
5151
/* jdk.net.ExtendedSocketOptions is only available if the jdk.net module is loaded. */
5252
this.hasPlatformSocketOptions = a.findClassByName("jdk.net.ExtendedSocketOptions$PlatformSocketOptions") != null;
53-
initializeAtRunTime(a, "java.net.DatagramPacket", "java.net.InetAddress", "java.net.NetworkInterface",
53+
initializeAtRunTime(a, "java.net.DatagramPacket", "java.net.NetworkInterface",
54+
/*
55+
* InetAddress would be enough ("initialized-at-runtime" is propagated to
56+
* subclasses) but for documentation purposes we mention all subclasses
57+
* anyway (each subclass has its own static constructor that calls native
58+
* code).
59+
*/
60+
"java.net.InetAddress", "java.net.Inet4Address", "java.net.Inet6Address",
5461
/* Stores a default SSLContext in a static field. */
5562
"javax.net.ssl.SSLContext");
5663

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationJavaNio.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public void duringSetup(DuringSetupAccess a) {
7575
initializeAtRunTime(a, "sun.nio.ch.FileDispatcherImpl", "sun.nio.ch.FileChannelImpl$Unmapper");
7676

7777
if (isPosix()) {
78+
initializeAtRunTime(a, "sun.nio.ch.InheritedChannel");
7879
initializeAtRunTime(a, "sun.nio.ch.SimpleAsynchronousFileChannelImpl", "sun.nio.ch.SimpleAsynchronousFileChannelImpl$DefaultExecutorHolder",
7980
"sun.nio.ch.SinkChannelImpl", "sun.nio.ch.SourceChannelImpl");
8081
initializeAtRunTime(a, "sun.nio.fs.UnixNativeDispatcher", "sun.nio.ch.UnixAsynchronousServerSocketChannelImpl");

0 commit comments

Comments
 (0)