RFR: JDK-8305993: Add handleSocketErrorWithMessage to extend nio Net.c exception message

Matthias Baesken mbaesken at openjdk.org
Fri Apr 14 08:26:38 UTC 2023


Currently we get a rather strange exception in our jtreg tests :

java/nio/channels/DatagramChannel/AdaptorMulticasting.java

java.net.SocketException: Exec format error
at java.base/sun.nio.ch.Net.joinOrDrop4(Native Method)
at java.base/sun.nio.ch.Net.join4(Net.java:708)
at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1606)
at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1624)
at Promiscuous.test(Promiscuous.java:176)
at Promiscuous.main(Promiscuous.java:223)

The message could at least be improved, saying that setsockopt failed (plus providing the errno related text).
Example is seen on macOS btw. .

-------------

Commit messages:
 - JDK-8305993

Changes: https://git.openjdk.org/jdk/pull/13472/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13472&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8305993
  Stats: 15 lines in 1 file changed: 11 ins; 1 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/13472.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13472/head:pull/13472

PR: https://git.openjdk.org/jdk/pull/13472


More information about the nio-dev mailing list