RFR: JDK-8305993: Add handleSocketErrorWithMessage to extend nio Net.c exception message
Alan Bateman
alanb at openjdk.org
Fri Apr 14 14:05:35 UTC 2023
On Fri, 14 Apr 2023 08:19:36 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> 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. .
src/java.base/unix/native/libnio/ch/Net.c line 574:
> 572: }
> 573:
> 574: jint handleSocketErrorWithMessage(JNIEnv *env, jint errorValue, const char* message);
This looks okay but we should probably put the function prototype at the top rather in the middle of the JNI functions. I guess it can be static too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13472#discussion_r1166875277
More information about the nio-dev
mailing list