Re: [RFR] 8219640: UnresolvedAddressException not thrown for incorrect hostname

2019-09-03 Thread Rob McKenna
Thanks for the pointer to the passing host Alan. With that I was able to
track down:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=108bc4049f8ae82710aec26a92ffdb4b439c83fd

So it looks like this has recently been fixed in glibc.

-Rob

On 03/09/19 17:47, Alan Bateman wrote:
> On 03/09/2019 17:35, Chris Hegarty wrote:
> > :
> > 
> >  From the same Linux system:
> > 
> > $ ldd --version
> > ldd (Ubuntu GLIBC 2.23-0ubuntu11) 2.23
> > Copyright (C) 2016 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions.  There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > Written by Roland McGrath and Ulrich Drepper.
> > 
> I just checked a system with OEL 7.6 and glibc 2.17 and it doesn't
> duplicate. Would be interesting to know if this issue is tracked in
> somewhere so we have a more complete picture on the issue.
> 
> -Alan


Re: [RFR] 8219640: UnresolvedAddressException not thrown for incorrect hostname

2019-09-03 Thread Alan Bateman

On 03/09/2019 17:35, Chris Hegarty wrote:

:

 From the same Linux system:

$ ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu11) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

I just checked a system with OEL 7.6 and glibc 2.17 and it doesn't 
duplicate. Would be interesting to know if this issue is tracked in 
somewhere so we have a more complete picture on the issue.


-Alan


Re: [RFR] 8219640: UnresolvedAddressException not thrown for incorrect hostname

2019-09-03 Thread Chris Hegarty



> On 3 Sep 2019, at 17:29, Chris Hegarty  wrote:
> ... 
> Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-54-generic x86_64)
> 
> * Documentation:  https://help.ubuntu.com
> * Management: https://landscape.canonical.com
> * Support:https://ubuntu.com/advantage
> ...
> $ uname -a
> Linux chegar 4.15.0-54-generic #58~16.04.1-Ubuntu SMP Mon Jun 24 13:21:41 UTC 
> 2019 x86_64 x86_64 x86_64 GNU/Linux
> 
> $ ~/binaries/jdk-11/bin/jshell 
> |  Welcome to JShell -- Version 11
> |  For an introduction type: /help intro
> 
> jshell> java.net.InetAddress.getByName("127.0.0.1 ")
> $1 ==> 127.0.0.1 /127.0.0.1
> 

From the same Linux system:

$ ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu11) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

$ lsof -p $$ | grep libc
bash23087 chhegar  memREG  253,0  1868984 1443412 
/lib/x86_64-linux-gnu/libc-2.23.so

$  /lib/x86_64-linux-gnu/libc-2.23.so --version
GNU C Library (Ubuntu GLIBC 2.23-0ubuntu11) stable release version 2.23, by 
Roland McGrath et al.
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 5.4.0 20160609.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
.


-Chris.



Re: [RFR] 8219640: UnresolvedAddressException not thrown for incorrect hostname

2019-09-03 Thread Chris Hegarty
On 3 Sep 2019, at 16:49, Alan Bateman  wrote:
> 
> On 03/09/2019 15:59, Rob McKenna wrote:
>> Hi folks,
>> 
>> Assuming the premise of this bug is correct, could I get a review for
>> the following:
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8219640
>> http://cr.openjdk.java.net/~robm/8219640/webrev.01/
>> 
>> Windows rejects a lookup for "127.0.0.1 test" where getaddrinfo on
>> non-Windows platforms resolves to 127.0.0.1. Note: this only happens
>> when the set of characters before the space corresponds to an IP
>> address. Both sets of platforms will reject "somehost name".
> Can you say more about which operating systems / versions where this occurs?

Results from two systems I have locally:

$ uname -a
Darwin dhcp-x 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 
2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

$ ~/binaries/jdk-11.0.1.jdk/Contents/Home/bin/jshell 
|  Welcome to JShell -- Version 11.0.1
|  For an introduction type: /help intro

jshell> java.net.InetAddress.getByName("127.0.0.1 ")
|  Exception java.net.UnknownHostException: 127.0.0.1 : nodename nor 
servname provided, or not known
|at Inet6AddressImpl.lookupAllHostAddr (Native Method)
|at InetAddress$PlatformNameService.lookupAllHostAddr 
(InetAddress.java:929)
|at InetAddress.getAddressesFromNameService (InetAddress.java:1515)
|at InetAddress$NameServiceAddresses.get (InetAddress.java:848)
|at InetAddress.getAllByName0 (InetAddress.java:1505)
|at InetAddress.getAllByName (InetAddress.java:1364)
|at InetAddress.getAllByName (InetAddress.java:1298)
|at InetAddress.getByName (InetAddress.java:1248)
|at (#1:1)

---
... 
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-54-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support:https://ubuntu.com/advantage
...
$ uname -a
Linux chegar 4.15.0-54-generic #58~16.04.1-Ubuntu SMP Mon Jun 24 13:21:41 UTC 
2019 x86_64 x86_64 x86_64 GNU/Linux

$ ~/binaries/jdk-11/bin/jshell 
|  Welcome to JShell -- Version 11
|  For an introduction type: /help intro

jshell> java.net.InetAddress.getByName("127.0.0.1 ")
$1 ==> 127.0.0.1 /127.0.0.1


-Chris.




Re: [RFR] 8219640: UnresolvedAddressException not thrown for incorrect hostname

2019-09-03 Thread Alan Bateman

On 03/09/2019 15:59, Rob McKenna wrote:

Hi folks,

Assuming the premise of this bug is correct, could I get a review for
the following:

https://bugs.openjdk.java.net/browse/JDK-8219640
http://cr.openjdk.java.net/~robm/8219640/webrev.01/

Windows rejects a lookup for "127.0.0.1 test" where getaddrinfo on
non-Windows platforms resolves to 127.0.0.1. Note: this only happens
when the set of characters before the space corresponds to an IP
address. Both sets of platforms will reject "somehost name".

Can you say more about which operating systems / versions where this occurs?

-Alan


[RFR] 8219640: UnresolvedAddressException not thrown for incorrect hostname

2019-09-03 Thread Rob McKenna
Hi folks,

Assuming the premise of this bug is correct, could I get a review for
the following:

https://bugs.openjdk.java.net/browse/JDK-8219640
http://cr.openjdk.java.net/~robm/8219640/webrev.01/

Windows rejects a lookup for "127.0.0.1 test" where getaddrinfo on
non-Windows platforms resolves to 127.0.0.1. Note: this only happens
when the set of characters before the space corresponds to an IP
address. Both sets of platforms will reject "somehost name".

-Rob