RFR: 8337143: (fc, fs) Move filesystem-related native objects from libnio to libjava [v4]
Brian Burkhalter
bpb at openjdk.org
Fri Aug 9 15:11:32 UTC 2024
On Fri, 9 Aug 2024 09:05:49 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Without loading libnet in Inet6AddressImpl, the test java/net/InetAddress/NullCharInHostnameDriver.java fails with UnsatisfiedLinkError:
>>
>> java.lang.UnsatisfiedLinkError: 'java.net.InetAddress[] java.net.Inet6AddressImpl.lookupAllHostAddr(java.lang.String, int)'
>> at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
>> at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
>> at java.base/java.net.NullCharInHostname.main(NullCharInHostname.java:37)
>>
>> This is on Unix (Linux, macOS) only, not on Windows.
>
> OK, this test uses a private API to create an instance of Inet6AddressImpl; This explain why in this test Inet6AddressImpl gets loaded before InetAddress.
>
> var impl = new Inet6AddressImpl();
>
> It should never happen outside of this test. Now the tricky question: what in your proposed changes caused "net" not to be loaded before the test created new Inet6AddressImpl(); ?
Loading "net" was removed from IOUtil so I am thinking that IOUtil must have been initialized somewhere before constructing Inet6AddressImpl, but I've not identified where just yet.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20317#discussion_r1711648714
More information about the nio-dev
mailing list