is inet:gethostbyname( IP ) correct?

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

is inet:gethostbyname( IP ) correct?

by Garry Hodgson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

recently, a bug in my code caused us to pass a string
representing a floating point number to inet:gethostbyname().
i would have expected it to return an error, but instead it
returned an ip address, but one that made no sense to me:

1> inet:gethostbyname( '12.27' ).
{ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}

so my question is, is this behavior correct, and if so, what
exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?

thanks

--
Garry Hodgson
Lead Member of Technical Staff
AT&T Chief Security Office (CSO)

"This e-mail and any files transmitted with it are AT&T property, are
confidential, and are intended solely for the use of the individual or
entity to whom this e-mail is addressed. If you are not one of the named
recipient(s) or otherwise have reason to believe that you have received
this message in error, please notify the sender and delete this message
immediately from your computer. Any other use, retention, dissemination,
forwarding, printing, or copying of this e-mail is strictly prohibited."

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: is inet:gethostbyname( IP ) correct?

by caio.ariede :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Interesting case.

The result doesn't appear to be an issue, but a feature of the gethostbyname
original implementation, in C code.

You get the same result, testing with PHP:

$ php -r 'var_dump(gethostbyname("12.27"));'
string(9) "12.0.0.27"

And other interesting results:

$ php -r 'var_dump(gethostbyname("255.2.256"));'
string(9) "255.2.1.0"

But I can't see where it's really useful.

Caio Ariede
http://caioariede.com/


On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson <garry@...>wrote:

> recently, a bug in my code caused us to pass a string
> representing a floating point number to inet:gethostbyname().
> i would have expected it to return an error, but instead it
> returned an ip address, but one that made no sense to me:
>
> 1> inet:gethostbyname( '12.27' ).
> {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
>
> so my question is, is this behavior correct, and if so, what
> exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
>
> thanks
>
> --
> Garry Hodgson
> Lead Member of Technical Staff
> AT&T Chief Security Office (CSO)
>
> "This e-mail and any files transmitted with it are AT&T property, are
> confidential, and are intended solely for the use of the individual or
> entity to whom this e-mail is addressed. If you are not one of the named
> recipient(s) or otherwise have reason to believe that you have received this
> message in error, please notify the sender and delete this message
> immediately from your computer. Any other use, retention, dissemination,
> forwarding, printing, or copying of this e-mail is strictly prohibited."
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>

Re: is inet:gethostbyname( IP ) correct?

by Roberto Aloi-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is due to the dot notation used in inet_addr().

Reading from the doc:
Values specified using the dot notation take one of the following forms:

*/a/*.*/b/*.*/c/*.*/d/*
*/a/*.*/b/*.*/c/*
*/a/*.*/b/*
*/a/*

Each of the four notation types are described below.

    * */a/*.*/b/*.*/c/*.*/d/* notation

      When four parts are specified, each is interpreted as a byte of
      data and assigned, from left to right, to the four bytes of an
      Internet address.

    * */a/*.*/b/*.*/c/* notation

      When a three-part address is specified, the last part is
      interpreted as a 16-bit quantity and placed in the right most two
      bytes of the network address. This makes the three-part address
      format convenient for specifying Class B network addresses as
      128.*/net/*.*/host/*.

    * */a/*.*/b/* notation

      When a two-part address is supplied, the last part is interpreted
      as a 24-bit quantity and placed in the right most three bytes of
      the network address. This makes the two-part address format
      convenient for specifying Class A network addresses as
      */net/*.*/host/*.

    * */a/* notation

      When only one part is given, the value is stored directly in the
      network address without any byte rearrangement.

All numbers supplied as parts in dot notation may be decimal, octal, or
hexadecimal, as specified in the C language (that is, a leading 0x or 0X
implies hexadecimal; otherwise, a leading 0 implies octal; otherwise,
the number is interpreted as decimal).

Sources:
http://www.ietf.org/rfc/rfc3493.txt
http://uw714doc.sco.com/en/man/html.3N/inet.3N.html

Best regards,

Roberto Aloi
Erlang Training and Consulting Ltd.
http://www.erlang-consulting.com
http://aloiroberto.wordpress.com

Garry Hodgson wrote:

> recently, a bug in my code caused us to pass a string
> representing a floating point number to inet:gethostbyname().
> i would have expected it to return an error, but instead it
> returned an ip address, but one that made no sense to me:
>
> 1> inet:gethostbyname( '12.27' ).
> {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
>
> so my question is, is this behavior correct, and if so, what
> exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
>
> thanks
>


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: is inet:gethostbyname( IP ) correct?

by Robert Raschke-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is part of the IP address spec (not sure where to look to find it,
though). I've seen addresses specified like this on and off in various
locations on a wide variety of OSes, for example in a /etc/hosts file you
can write:

localhost  127.1

Robby

On Tue, Oct 13, 2009 at 8:06 PM, caio ariede <caio.ariede@...> wrote:

> Interesting case.
>
> The result doesn't appear to be an issue, but a feature of the
> gethostbyname
> original implementation, in C code.
>
> You get the same result, testing with PHP:
>
> $ php -r 'var_dump(gethostbyname("12.27"));'
> string(9) "12.0.0.27"
>
> And other interesting results:
>
> $ php -r 'var_dump(gethostbyname("255.2.256"));'
> string(9) "255.2.1.0"
>
> But I can't see where it's really useful.
>
> Caio Ariede
> http://caioariede.com/
>
>
> On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson <garry@...
> >wrote:
>
> > recently, a bug in my code caused us to pass a string
> > representing a floating point number to inet:gethostbyname().
> > i would have expected it to return an error, but instead it
> > returned an ip address, but one that made no sense to me:
> >
> > 1> inet:gethostbyname( '12.27' ).
> > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
> >
> > so my question is, is this behavior correct, and if so, what
> > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
> >
> > thanks
> >
> > --
> > Garry Hodgson
> > Lead Member of Technical Staff
> > AT&T Chief Security Office (CSO)
> >
> > "This e-mail and any files transmitted with it are AT&T property, are
> > confidential, and are intended solely for the use of the individual or
> > entity to whom this e-mail is addressed. If you are not one of the named
> > recipient(s) or otherwise have reason to believe that you have received
> this
> > message in error, please notify the sender and delete this message
> > immediately from your computer. Any other use, retention, dissemination,
> > forwarding, printing, or copying of this e-mail is strictly prohibited."
> >
> > ________________________________________________________________
> > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > erlang-questions (at) erlang.org
> >
> >
>

Re: is inet:gethostbyname( IP ) correct?

by Roberto Aloi-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At the end of my last mail you have the references.
Regards,

Roberto Aloi
Erlang Training and Consulting Ltd.
http://www.erlang-consulting.com
http://aloiroberto.wordpress.com

Robert Raschke wrote:

> This is part of the IP address spec (not sure where to look to find it,
> though). I've seen addresses specified like this on and off in various
> locations on a wide variety of OSes, for example in a /etc/hosts file you
> can write:
>
> localhost  127.1
>
> Robby
>
> On Tue, Oct 13, 2009 at 8:06 PM, caio ariede <caio.ariede@...> wrote:
>
>  
>> Interesting case.
>>
>> The result doesn't appear to be an issue, but a feature of the
>> gethostbyname
>> original implementation, in C code.
>>
>> You get the same result, testing with PHP:
>>
>> $ php -r 'var_dump(gethostbyname("12.27"));'
>> string(9) "12.0.0.27"
>>
>> And other interesting results:
>>
>> $ php -r 'var_dump(gethostbyname("255.2.256"));'
>> string(9) "255.2.1.0"
>>
>> But I can't see where it's really useful.
>>
>> Caio Ariede
>> http://caioariede.com/
>>
>>
>> On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson <garry@...
>>    
>>> wrote:
>>>      
>>> recently, a bug in my code caused us to pass a string
>>> representing a floating point number to inet:gethostbyname().
>>> i would have expected it to return an error, but instead it
>>> returned an ip address, but one that made no sense to me:
>>>
>>> 1> inet:gethostbyname( '12.27' ).
>>> {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
>>>
>>> so my question is, is this behavior correct, and if so, what
>>> exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
>>>
>>> thanks
>>>
>>> --
>>> Garry Hodgson
>>> Lead Member of Technical Staff
>>> AT&T Chief Security Office (CSO)
>>>
>>> "This e-mail and any files transmitted with it are AT&T property, are
>>> confidential, and are intended solely for the use of the individual or
>>> entity to whom this e-mail is addressed. If you are not one of the named
>>> recipient(s) or otherwise have reason to believe that you have received
>>>      
>> this
>>    
>>> message in error, please notify the sender and delete this message
>>> immediately from your computer. Any other use, retention, dissemination,
>>> forwarding, printing, or copying of this e-mail is strictly prohibited."
>>>
>>> ________________________________________________________________
>>> erlang-questions mailing list. See http://www.erlang.org/faq.html
>>> erlang-questions (at) erlang.org
>>>
>>>
>>>      
>
>  


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: is inet:gethostbyname( IP ) correct?

by info-1679 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For me this function always returns {error,timeout} and I didn't find the reason even with the help of Raimo Niskanen !


At the end of my last mail you have the references.
Regards,

Roberto Aloi
Erlang Training and Consulting Ltd.
http://www.erlang-consulting.com
http://aloiroberto.wordpress.com

Robert Raschke wrote:

> This is part of the IP address spec (not sure where to look to find it,
> though). I've seen addresses specified like this on and off in various
> locations on a wide variety of OSes, for example in a /etc/hosts file you
> can write:
>
> localhost  127.1
>
> Robby
>
> On Tue, Oct 13, 2009 at 8:06 PM, caio ariede  <caio.ariede@... > wrote:
>
>  
> > Interesting case.
> >
> > The result doesn't appear to be an issue, but a feature of the
> > gethostbyname
> > original implementation, in C code.
> >
> > You get the same result, testing with PHP:
> >
> > $ php -r 'var_dump(gethostbyname("12.27"));'
> > string(9) "12.0.0.27"
> >
> > And other interesting results:
> >
> > $ php -r 'var_dump(gethostbyname("255.2.256"));'
> > string(9) "255.2.1.0"
> >
> > But I can't see where it's really useful.
> >
> > Caio Ariede
> > http://caioariede.com/
> >
> >
> > On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson  <garry@...
> >    
> > > wrote:
> > >      
> > > recently, a bug in my code caused us to pass a string
> > > representing a floating point number to inet:gethostbyname().
> > > i would have expected it to return an error, but instead it
> > > returned an ip address, but one that made no sense to me:
> > >
> > > 1 > inet:gethostbyname( '12.27' ).
> > > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
> > >
> > > so my question is, is this behavior correct, and if so, what
> > > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
> > >
> > > thanks
> > >
> > > --
> > > Garry Hodgson
> > > Lead Member of Technical Staff
> > > AT&T Chief Security Office (CSO)
> > >
> > > "This e-mail and any files transmitted with it are AT&T property, are
> > > confidential, and are intended solely for the use of the individual or
> > > entity to whom this e-mail is addressed. If you are not one of the named
> > > recipient(s) or otherwise have reason to believe that you have received
> > >      
> > this
> >    
> > > message in error, please notify the sender and delete this message
> > > immediately from your computer. Any other use, retention, dissemination,
> > > forwarding, printing, or copying of this e-mail is strictly prohibited."
> > >
> > > ________________________________________________________________
> > > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > > erlang-questions (at) erlang.org
> > >
> > >
> > >      
>
>  


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Re: is inet:gethostbyname( IP ) correct?

by Garry Hodgson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Roberto Aloi <roberto.aloi@...>Roberto Aloi wrote:
> This is due to the dot notation used in inet_addr().
>
> Reading from the doc:
> Values specified using the dot notation take one of the following forms:
>
> */a/*.*/b/*.*/c/*.*/d/*
> */a/*.*/b/*.*/c/*
> */a/*.*/b/*
> */a/*

thanks to roberto and all the others who clarified this for me.


--
Garry Hodgson
Lead Member of Technical Staff
AT&T Chief Security Office (CSO)

"This e-mail and any files transmitted with it are AT&T property, are
confidential, and are intended solely for the use of the individual or
entity to whom this e-mail is addressed. If you are not one of the named
recipient(s) or otherwise have reason to believe that you have received
this message in error, please notify the sender and delete this message
immediately from your computer. Any other use, retention, dissemination,
forwarding, printing, or copying of this e-mail is strictly prohibited."

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 14, 2009 at 03:34:12PM +0200, info wrote:
> For me this function always returns {error,timeout} and I didn't find the reason even with the help of Raimo Niskanen !

Sorry about that, but your problem became a just too spooky
Windows 2003 problem and that is not really my turf, and
you seemed to have a possible workaround through inet_res.
But it has been on my todo list to have a second look
at the whole conversation when I could find the time...

>
>
> At the end of my last mail you have the references.
> Regards,
>
> Roberto Aloi
> Erlang Training and Consulting Ltd.
> http://www.erlang-consulting.com
> http://aloiroberto.wordpress.com
>
> Robert Raschke wrote:
> > This is part of the IP address spec (not sure where to look to find it,
> > though). I've seen addresses specified like this on and off in various
> > locations on a wide variety of OSes, for example in a /etc/hosts file you
> > can write:
> >
> > localhost  127.1
> >
> > Robby
> >
> > On Tue, Oct 13, 2009 at 8:06 PM, caio ariede  <caio.ariede@... > wrote:
> >
> >  
> > > Interesting case.
> > >
> > > The result doesn't appear to be an issue, but a feature of the
> > > gethostbyname
> > > original implementation, in C code.
> > >
> > > You get the same result, testing with PHP:
> > >
> > > $ php -r 'var_dump(gethostbyname("12.27"));'
> > > string(9) "12.0.0.27"
> > >
> > > And other interesting results:
> > >
> > > $ php -r 'var_dump(gethostbyname("255.2.256"));'
> > > string(9) "255.2.1.0"
> > >
> > > But I can't see where it's really useful.
> > >
> > > Caio Ariede
> > > http://caioariede.com/
> > >
> > >
> > > On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson  <garry@...
> > >    
> > > > wrote:
> > > >      
> > > > recently, a bug in my code caused us to pass a string
> > > > representing a floating point number to inet:gethostbyname().
> > > > i would have expected it to return an error, but instead it
> > > > returned an ip address, but one that made no sense to me:
> > > >
> > > > 1 > inet:gethostbyname( '12.27' ).
> > > > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
> > > >
> > > > so my question is, is this behavior correct, and if so, what
> > > > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
> > > >
> > > > thanks
> > > >
> > > > --
> > > > Garry Hodgson
> > > > Lead Member of Technical Staff
> > > > AT&T Chief Security Office (CSO)
> > > >
> > > > "This e-mail and any files transmitted with it are AT&T property, are
> > > > confidential, and are intended solely for the use of the individual or
> > > > entity to whom this e-mail is addressed. If you are not one of the named
> > > > recipient(s) or otherwise have reason to believe that you have received
> > > >      
> > > this
> > >    
> > > > message in error, please notify the sender and delete this message
> > > > immediately from your computer. Any other use, retention, dissemination,
> > > > forwarding, printing, or copying of this e-mail is strictly prohibited."
> > > >
> > > > ________________________________________________________________
> > > > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > > > erlang-questions (at) erlang.org
> > > >
> > > >
> > > >      
> >
> >  
>
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: Re: is inet:gethostbyname( IP ) correct?

by info-1679 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Raimo,
I can resume: I discovered that gethostbyname call inet_gethost.c
I don't understand inet_gethost.c :-(
Where "goes" this problem for finding the information ?
If we know where and what, we could perhaps find what is missing in my windows 2003 ...
Hope to read you soon !
John

On Wed, Oct 14, 2009 at 03:34:12PM +0200, info wrote:
> For me this function always returns {error,timeout} and I didn't find the reason even with the help of Raimo Niskanen !

Sorry about that, but your problem became a just too spooky
Windows 2003 problem and that is not really my turf, and
you seemed to have a possible workaround through inet_res.
But it has been on my todo list to have a second look
at the whole conversation when I could find the time...

>
>
> At the end of my last mail you have the references.
> Regards,
>
> Roberto Aloi
> Erlang Training and Consulting Ltd.
> http://www.erlang-consulting.com
> http://aloiroberto.wordpress.com
>
> Robert Raschke wrote:
>  > This is part of the IP address spec (not sure where to look to find it,
>  > though). I've seen addresses specified like this on and off in various
>  > locations on a wide variety of OSes, for example in a /etc/hosts file you
>  > can write:
>  >
>  > localhost  127.1
>  >
>  > Robby
>  >
>  > On Tue, Oct 13, 2009 at 8:06 PM, caio ariede   <caio.ariede@...  > wrote:
>  >
>  >  
>  >  > Interesting case.
>  >  >
>  >  > The result doesn't appear to be an issue, but a feature of the
>  >  > gethostbyname
>  >  > original implementation, in C code.
>  >  >
>  >  > You get the same result, testing with PHP:
>  >  >
>  >  > $ php -r 'var_dump(gethostbyname("12.27"));'
>  >  > string(9) "12.0.0.27"
>  >  >
>  >  > And other interesting results:
>  >  >
>  >  > $ php -r 'var_dump(gethostbyname("255.2.256"));'
>  >  > string(9) "255.2.1.0"
>  >  >
>  >  > But I can't see where it's really useful.
>  >  >
>  >  > Caio Ariede
>  >  > http://caioariede.com/
>  >  >
>  >  >
>  >  > On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson   <garry@...
>  >  >    
>  >  >  > wrote:
>  >  >  >      
>  >  >  > recently, a bug in my code caused us to pass a string
>  >  >  > representing a floating point number to inet:gethostbyname().
>  >  >  > i would have expected it to return an error, but instead it
>  >  >  > returned an ip address, but one that made no sense to me:
>  >  >  >
>  >  >  > 1  > inet:gethostbyname( '12.27' ).
>  >  >  > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
>  >  >  >
>  >  >  > so my question is, is this behavior correct, and if so, what
>  >  >  > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
>  >  >  >
>  >  >  > thanks
>  >  >  >
>  >  >  > --
>  >  >  > Garry Hodgson
>  >  >  > Lead Member of Technical Staff
>  >  >  > AT&T Chief Security Office (CSO)
>  >  >  >
>  >  >  > "This e-mail and any files transmitted with it are AT&T property, are
>  >  >  > confidential, and are intended solely for the use of the individual or
>  >  >  > entity to whom this e-mail is addressed. If you are not one of the named
>  >  >  > recipient(s) or otherwise have reason to believe that you have received
>  >  >  >      
>  >  > this
>  >  >    
>  >  >  > message in error, please notify the sender and delete this message
>  >  >  > immediately from your computer. Any other use, retention, dissemination,
>  >  >  > forwarding, printing, or copying of this e-mail is strictly prohibited."
>  >  >  >
>  >  >  > ________________________________________________________________
>  >  >  > erlang-questions mailing list. See http://www.erlang.org/faq.html
>  >  >  > erlang-questions (at) erlang.org
>  >  >  >
>  >  >  >
>  >  >  >      
>  >
>  >  
>
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> Dear Raimo,
> I can resume: I discovered that gethostbyname call inet_gethost.c
> I don't understand inet_gethost.c :-(
> Where "goes" this problem for finding the information ?
> If we know where and what, we could perhaps find what is missing in my windows 2003 ...
> Hope to read you soon !
> John

Well, there is not much more to say. inet_gethost.c calls
struct hostent *gethostbyname(const char *name) in the
winsock2 library:
  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx
It never returns.
It is deprecated but that does not mean broken.
I have a Windows 2003 server that it works on.
We have not found the reason it differs between
my server and your server.
And that is about it.


>
> On Wed, Oct 14, 2009 at 03:34:12PM +0200, info wrote:
> > For me this function always returns {error,timeout} and I didn't find the reason even with the help of Raimo Niskanen !
>
> Sorry about that, but your problem became a just too spooky
> Windows 2003 problem and that is not really my turf, and
> you seemed to have a possible workaround through inet_res.
> But it has been on my todo list to have a second look
> at the whole conversation when I could find the time...
>
> >
> >
> > At the end of my last mail you have the references.
> > Regards,
> >
> > Roberto Aloi
> > Erlang Training and Consulting Ltd.
> > http://www.erlang-consulting.com
> > http://aloiroberto.wordpress.com
> >
> > Robert Raschke wrote:
> >  > This is part of the IP address spec (not sure where to look to find it,
> >  > though). I've seen addresses specified like this on and off in various
> >  > locations on a wide variety of OSes, for example in a /etc/hosts file you
> >  > can write:
> >  >
> >  > localhost  127.1
> >  >
> >  > Robby
> >  >
> >  > On Tue, Oct 13, 2009 at 8:06 PM, caio ariede   <caio.ariede@...  > wrote:
> >  >
> >  >  
> >  >  > Interesting case.
> >  >  >
> >  >  > The result doesn't appear to be an issue, but a feature of the
> >  >  > gethostbyname
> >  >  > original implementation, in C code.
> >  >  >
> >  >  > You get the same result, testing with PHP:
> >  >  >
> >  >  > $ php -r 'var_dump(gethostbyname("12.27"));'
> >  >  > string(9) "12.0.0.27"
> >  >  >
> >  >  > And other interesting results:
> >  >  >
> >  >  > $ php -r 'var_dump(gethostbyname("255.2.256"));'
> >  >  > string(9) "255.2.1.0"
> >  >  >
> >  >  > But I can't see where it's really useful.
> >  >  >
> >  >  > Caio Ariede
> >  >  > http://caioariede.com/
> >  >  >
> >  >  >
> >  >  > On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson   <garry@...
> >  >  >    
> >  >  >  > wrote:
> >  >  >  >      
> >  >  >  > recently, a bug in my code caused us to pass a string
> >  >  >  > representing a floating point number to inet:gethostbyname().
> >  >  >  > i would have expected it to return an error, but instead it
> >  >  >  > returned an ip address, but one that made no sense to me:
> >  >  >  >
> >  >  >  > 1  > inet:gethostbyname( '12.27' ).
> >  >  >  > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
> >  >  >  >
> >  >  >  > so my question is, is this behavior correct, and if so, what
> >  >  >  > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
> >  >  >  >
> >  >  >  > thanks
> >  >  >  >
> >  >  >  > --
> >  >  >  > Garry Hodgson
> >  >  >  > Lead Member of Technical Staff
> >  >  >  > AT&T Chief Security Office (CSO)
> >  >  >  >
> >  >  >  > "This e-mail and any files transmitted with it are AT&T property, are
> >  >  >  > confidential, and are intended solely for the use of the individual or
> >  >  >  > entity to whom this e-mail is addressed. If you are not one of the named
> >  >  >  > recipient(s) or otherwise have reason to believe that you have received
> >  >  >  >      
> >  >  > this
> >  >  >    
> >  >  >  > message in error, please notify the sender and delete this message
> >  >  >  > immediately from your computer. Any other use, retention, dissemination,
> >  >  >  > forwarding, printing, or copying of this e-mail is strictly prohibited."
> >  >  >  >
> >  >  >  > ________________________________________________________________
> >  >  >  > erlang-questions mailing list. See http://www.erlang.org/faq.html
> >  >  >  > erlang-questions (at) erlang.org
> >  >  >  >
> >  >  >  >
> >  >  >  >      
> >  >
> >  >  
> >
> >
> > ________________________________________________________________
> > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > erlang-questions (at) erlang.org
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Robert Raschke-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen <
raimo+erlang-questions@...<raimo%2Berlang-questions@...>
> wrote:

> On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> > Dear Raimo,
> > I can resume: I discovered that gethostbyname call inet_gethost.c
> > I don't understand inet_gethost.c :-(
> > Where "goes" this problem for finding the information ?
> > If we know where and what, we could perhaps find what is missing in my
> windows 2003 ...
> > Hope to read you soon !
> > John
>
> Well, there is not much more to say. inet_gethost.c calls
> struct hostent *gethostbyname(const char *name) in the
> winsock2 library:
>  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx>
> It never returns.
> It is deprecated but that does not mean broken.
> I have a Windows 2003 server that it works on.
> We have not found the reason it differs between
> my server and your server.
> And that is about it.
>
>
>
I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
Version 4.0' installed. This is a specific add-on, nothing to do with
Microsoft Firewall in your Network Properties.

If I remove it, it works fine, if I add it it hangs. Apart from that the
W2003 build is as vanilla as it gets.

Nothing much to go on, but I would not be surprised if some system DLL is
getting in the way. This is very hard to diagnose.

One day I'll get around to compiling inet_gethost.exe in my setup, just to
rule out poor linkage due to the VC++ setup used to build the shipping
executables. If I compile up a trivial gethostbyname() example from MSDN, it
works OK in all circumstances.

There are a few strange dependencies in other shipped Windows files, for
example beam.dll seems to depend on a particular MSVCR80.DLL with the
version 8.0.50727.1433 . And if you have an older Windows machine, you get
the completely unhelpful popup box telling you that your program could not
be run. This has something to do with Windows Side-by-Side DLL deployment,
and I completely fail to grasp what that's all about.

Robby

Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 15, 2009 at 04:48:38PM +0100, Robert Raschke wrote:

> On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen <
> raimo+erlang-questions@...<raimo%2Berlang-questions@...>
> > wrote:
>
> > On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> > > Dear Raimo,
> > > I can resume: I discovered that gethostbyname call inet_gethost.c
> > > I don't understand inet_gethost.c :-(
> > > Where "goes" this problem for finding the information ?
> > > If we know where and what, we could perhaps find what is missing in my
> > windows 2003 ...
> > > Hope to read you soon !
> > > John
> >
> > Well, there is not much more to say. inet_gethost.c calls
> > struct hostent *gethostbyname(const char *name) in the
> > winsock2 library:
> >  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx>
> > It never returns.
> > It is deprecated but that does not mean broken.
> > I have a Windows 2003 server that it works on.
> > We have not found the reason it differs between
> > my server and your server.
> > And that is about it.
> >
> >
> >
> I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
> on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
> Version 4.0' installed. This is a specific add-on, nothing to do with
> Microsoft Firewall in your Network Properties.
>
> If I remove it, it works fine, if I add it it hangs. Apart from that the
> W2003 build is as vanilla as it gets.
>

This rings a bell for our Windows guys.

Firewall software on Windows do nasty things. They e.g replace
the Winsock API for other applications so things you had to do
before suddenly breaks. Especially since inet_gethost.exe
does calls from worker threads the API replacement may mess up.
We have had hanging gethostbyname() for certain firewalls.

We will install virtual a Windows 2003 server machine,
the Microsoft Firewall Client for ISA Server seems to be
downloadable
http://www.microsoft.com/DownLoads/details.aspx?FamilyID=05c2c932-b15a-4990-b525-66380743da89&displaylang=en
from Microsoft, but where to find, if we need, the Microsoft ISA Server
I do not know...

Then we will try to reproduce the problem.


> Nothing much to go on, but I would not be surprised if some system DLL is
> getting in the way. This is very hard to diagnose.
>
> One day I'll get around to compiling inet_gethost.exe in my setup, just to
> rule out poor linkage due to the VC++ setup used to build the shipping
> executables. If I compile up a trivial gethostbyname() example from MSDN, it
> works OK in all circumstances.
>
> There are a few strange dependencies in other shipped Windows files, for
> example beam.dll seems to depend on a particular MSVCR80.DLL with the
> version 8.0.50727.1433 . And if you have an older Windows machine, you get
> the completely unhelpful popup box telling you that your program could not
> be run. This has something to do with Windows Side-by-Side DLL deployment,
> and I completely fail to grasp what that's all about.
>
> Robby

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: Re: is inet:gethostbyname( IP ) correct?

by info-1679 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My idea was to analyse the return parameters because gethostbyname doesn't return "timeout".
Who and where decides to transform an error code in timeout code ?
I hope to escalade the problem like this ...
John
On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> Dear Raimo,
> I can resume: I discovered that gethostbyname call inet_gethost.c
> I don't understand inet_gethost.c :-(
> Where "goes" this problem for finding the information ?
> If we know where and what, we could perhaps find what is missing in my windows 2003 ...
> Hope to read you soon !
> John

Well, there is not much more to say. inet_gethost.c calls
struct hostent *gethostbyname(const char *name) in the
winsock2 library:
  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx
It never returns.
It is deprecated but that does not mean broken.
I have a Windows 2003 server that it works on.
We have not found the reason it differs between
my server and your server.
And that is about it.


>
> On Wed, Oct 14, 2009 at 03:34:12PM +0200, info wrote:
>  > For me this function always returns {error,timeout} and I didn't find the reason even with the help of Raimo Niskanen !
>
> Sorry about that, but your problem became a just too spooky
> Windows 2003 problem and that is not really my turf, and
> you seemed to have a possible workaround through inet_res.
> But it has been on my todo list to have a second look
> at the whole conversation when I could find the time...
>
>  >
>  >
>  > At the end of my last mail you have the references.
>  > Regards,
>  >
>  > Roberto Aloi
>  > Erlang Training and Consulting Ltd.
>  > http://www.erlang-consulting.com
>  > http://aloiroberto.wordpress.com
>  >
>  > Robert Raschke wrote:
>  >   > This is part of the IP address spec (not sure where to look to find it,
>  >   > though). I've seen addresses specified like this on and off in various
>  >   > locations on a wide variety of OSes, for example in a /etc/hosts file you
>  >   > can write:
>  >   >
>  >   > localhost  127.1
>  >   >
>  >   > Robby
>  >   >
>  >   > On Tue, Oct 13, 2009 at 8:06 PM, caio ariede    <caio.ariede@...   > wrote:
>  >   >
>  >   >  
>  >   >   > Interesting case.
>  >   >   >
>  >   >   > The result doesn't appear to be an issue, but a feature of the
>  >   >   > gethostbyname
>  >   >   > original implementation, in C code.
>  >   >   >
>  >   >   > You get the same result, testing with PHP:
>  >   >   >
>  >   >   > $ php -r 'var_dump(gethostbyname("12.27"));'
>  >   >   > string(9) "12.0.0.27"
>  >   >   >
>  >   >   > And other interesting results:
>  >   >   >
>  >   >   > $ php -r 'var_dump(gethostbyname("255.2.256"));'
>  >   >   > string(9) "255.2.1.0"
>  >   >   >
>  >   >   > But I can't see where it's really useful.
>  >   >   >
>  >   >   > Caio Ariede
>  >   >   > http://caioariede.com/
>  >   >   >
>  >   >   >
>  >   >   > On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson    <garry@...
>  >   >   >    
>  >   >   >   > wrote:
>  >   >   >   >      
>  >   >   >   > recently, a bug in my code caused us to pass a string
>  >   >   >   > representing a floating point number to inet:gethostbyname().
>  >   >   >   > i would have expected it to return an error, but instead it
>  >   >   >   > returned an ip address, but one that made no sense to me:
>  >   >   >   >
>  >   >   >   > 1   > inet:gethostbyname( '12.27' ).
>  >   >   >   > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
>  >   >   >   >
>  >   >   >   > so my question is, is this behavior correct, and if so, what
>  >   >   >   > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
>  >   >   >   >
>  >   >   >   > thanks
>  >   >   >   >
>  >   >   >   > --
>  >   >   >   > Garry Hodgson
>  >   >   >   > Lead Member of Technical Staff
>  >   >   >   > AT&T Chief Security Office (CSO)
>  >   >   >   >
>  >   >   >   > "This e-mail and any files transmitted with it are AT&T property, are
>  >   >   >   > confidential, and are intended solely for the use of the individual or
>  >   >   >   > entity to whom this e-mail is addressed. If you are not one of the named
>  >   >   >   > recipient(s) or otherwise have reason to believe that you have received
>  >   >   >   >      
>  >   >   > this
>  >   >   >    
>  >   >   >   > message in error, please notify the sender and delete this message
>  >   >   >   > immediately from your computer. Any other use, retention, dissemination,
>  >   >   >   > forwarding, printing, or copying of this e-mail is strictly prohibited."
>  >   >   >   >
>  >   >   >   > ________________________________________________________________
>  >   >   >   > erlang-questions mailing list. See http://www.erlang.org/faq.html
>  >   >   >   > erlang-questions (at) erlang.org
>  >   >   >   >
>  >   >   >   >
>  >   >   >   >      
>  >   >
>  >   >  
>  >
>  >
>  > ________________________________________________________________
>  > erlang-questions mailing list. See http://www.erlang.org/faq.html
>  > erlang-questions (at) erlang.org
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Re: Re: Re: is inet:gethostbyname( IP ) correct?

by info-1679 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen  <
raimo+erlang-questions@... <raimo%2Berlang-questions@... >
> wrote:

> On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
>  > Dear Raimo,
>  > I can resume: I discovered that gethostbyname call inet_gethost.c
>  > I don't understand inet_gethost.c :-(
>  > Where "goes" this problem for finding the information ?
>  > If we know where and what, we could perhaps find what is missing in my
> windows 2003 ...
>  > Hope to read you soon !
>  > John
>
> Well, there is not much more to say. inet_gethost.c calls
> struct hostent *gethostbyname(const char *name) in the
> winsock2 library:
>  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx <http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx >
> It never returns.
> It is deprecated but that does not mean broken.
> I have a Windows 2003 server that it works on.
> We have not found the reason it differs between
> my server and your server.
> And that is about it.
>
>
>
I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
Version 4.0' installed. This is a specific add-on, nothing to do with
Microsoft Firewall in your Network Properties.

but I don't use ISA server !!!

If I remove it, it works fine, if I add it it hangs. Apart from that the
W2003 build is as vanilla as it gets.

Nothing much to go on, but I would not be surprised if some system DLL is
getting in the way. This is very hard to diagnose.

One day I'll get around to compiling inet_gethost.exe in my setup, just to
rule out poor linkage due to the VC++ setup used to build the shipping
executables. If I compile up a trivial gethostbyname() example from MSDN, it
works OK in all circumstances.

There are a few strange dependencies in other shipped Windows files, for
example beam.dll seems to depend on a particular MSVCR80.DLL with the
version 8.0.50727.1433 . And if you have an older Windows machine, you get
the completely unhelpful popup box telling you that your program could not
be run. This has something to do with Windows Side-by-Side DLL deployment,
and I completely fail to grasp what that's all about.

but I don't have msvcr80.dll !!!

Robby

Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 04:24:53PM +0200, info wrote:
> My idea was to analyse the return parameters because gethostbyname doesn't return "timeout".
> Who and where decides to transform an error code in timeout code ?
> I hope to escalade the problem like this ...
> John

The debug trick I showed earlier (inet_gethost_native:control({debug_level,99}))
would show the return value, but as I understood it it never
returns; it gets interrupted from inet_gethost.erl, even
if you set the timeout ridiculously high, so we have
no return value to go on...

> On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> > Dear Raimo,
> > I can resume: I discovered that gethostbyname call inet_gethost.c
> > I don't understand inet_gethost.c :-(
> > Where "goes" this problem for finding the information ?
> > If we know where and what, we could perhaps find what is missing in my windows 2003 ...
> > Hope to read you soon !
> > John
>
> Well, there is not much more to say. inet_gethost.c calls
> struct hostent *gethostbyname(const char *name) in the
> winsock2 library:
>   http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx
> It never returns.
> It is deprecated but that does not mean broken.
> I have a Windows 2003 server that it works on.
> We have not found the reason it differs between
> my server and your server.
> And that is about it.
>
>
> >
> > On Wed, Oct 14, 2009 at 03:34:12PM +0200, info wrote:
> >  > For me this function always returns {error,timeout} and I didn't find the reason even with the help of Raimo Niskanen !
> >
> > Sorry about that, but your problem became a just too spooky
> > Windows 2003 problem and that is not really my turf, and
> > you seemed to have a possible workaround through inet_res.
> > But it has been on my todo list to have a second look
> > at the whole conversation when I could find the time...
> >
> >  >
> >  >
> >  > At the end of my last mail you have the references.
> >  > Regards,
> >  >
> >  > Roberto Aloi
> >  > Erlang Training and Consulting Ltd.
> >  > http://www.erlang-consulting.com
> >  > http://aloiroberto.wordpress.com
> >  >
> >  > Robert Raschke wrote:
> >  >   > This is part of the IP address spec (not sure where to look to find it,
> >  >   > though). I've seen addresses specified like this on and off in various
> >  >   > locations on a wide variety of OSes, for example in a /etc/hosts file you
> >  >   > can write:
> >  >   >
> >  >   > localhost  127.1
> >  >   >
> >  >   > Robby
> >  >   >
> >  >   > On Tue, Oct 13, 2009 at 8:06 PM, caio ariede    <caio.ariede@...   > wrote:
> >  >   >
> >  >   >  
> >  >   >   > Interesting case.
> >  >   >   >
> >  >   >   > The result doesn't appear to be an issue, but a feature of the
> >  >   >   > gethostbyname
> >  >   >   > original implementation, in C code.
> >  >   >   >
> >  >   >   > You get the same result, testing with PHP:
> >  >   >   >
> >  >   >   > $ php -r 'var_dump(gethostbyname("12.27"));'
> >  >   >   > string(9) "12.0.0.27"
> >  >   >   >
> >  >   >   > And other interesting results:
> >  >   >   >
> >  >   >   > $ php -r 'var_dump(gethostbyname("255.2.256"));'
> >  >   >   > string(9) "255.2.1.0"
> >  >   >   >
> >  >   >   > But I can't see where it's really useful.
> >  >   >   >
> >  >   >   > Caio Ariede
> >  >   >   > http://caioariede.com/
> >  >   >   >
> >  >   >   >
> >  >   >   > On Tue, Oct 13, 2009 at 3:15 PM, Garry Hodgson    <garry@...
> >  >   >   >    
> >  >   >   >   > wrote:
> >  >   >   >   >      
> >  >   >   >   > recently, a bug in my code caused us to pass a string
> >  >   >   >   > representing a floating point number to inet:gethostbyname().
> >  >   >   >   > i would have expected it to return an error, but instead it
> >  >   >   >   > returned an ip address, but one that made no sense to me:
> >  >   >   >   >
> >  >   >   >   > 1   > inet:gethostbyname( '12.27' ).
> >  >   >   >   > {ok,{hostent,"12.27",[],inet,4,[{12,0,0,27}]}}
> >  >   >   >   >
> >  >   >   >   > so my question is, is this behavior correct, and if so, what
> >  >   >   >   > exactly does it mean that a lookup of '12.27' maps to '12.0.0.27'?
> >  >   >   >   >
> >  >   >   >   > thanks
> >  >   >   >   >
> >  >   >   >   > --
> >  >   >   >   > Garry Hodgson
> >  >   >   >   > Lead Member of Technical Staff
> >  >   >   >   > AT&T Chief Security Office (CSO)
> >  >   >   >   >
> >  >   >   >   > "This e-mail and any files transmitted with it are AT&T property, are
> >  >   >   >   > confidential, and are intended solely for the use of the individual or
> >  >   >   >   > entity to whom this e-mail is addressed. If you are not one of the named
> >  >   >   >   > recipient(s) or otherwise have reason to believe that you have received
> >  >   >   >   >      
> >  >   >   > this
> >  >   >   >    
> >  >   >   >   > message in error, please notify the sender and delete this message
> >  >   >   >   > immediately from your computer. Any other use, retention, dissemination,
> >  >   >   >   > forwarding, printing, or copying of this e-mail is strictly prohibited."
> >  >   >   >   >
> >  >   >   >   > ________________________________________________________________
> >  >   >   >   > erlang-questions mailing list. See http://www.erlang.org/faq.html
> >  >   >   >   > erlang-questions (at) erlang.org
> >  >   >   >   >
> >  >   >   >   >
> >  >   >   >   >      
> >  >   >
> >  >   >  
> >  >
> >  >
> >  > ________________________________________________________________
> >  > erlang-questions mailing list. See http://www.erlang.org/faq.html
> >  > erlang-questions (at) erlang.org
> >
> > --
> >
> > / Raimo Niskanen, Erlang/OTP, Ericsson AB
> >
> > ________________________________________________________________
> > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > erlang-questions (at) erlang.org
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 04:29:20PM +0200, info wrote:
I guess Robby wrote:

> On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen  <
> raimo+erlang-questions@... <raimo%2Berlang-questions@... >
> > wrote:
>
> > On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> >  > Dear Raimo,
> >  > I can resume: I discovered that gethostbyname call inet_gethost.c
> >  > I don't understand inet_gethost.c :-(
> >  > Where "goes" this problem for finding the information ?
> >  > If we know where and what, we could perhaps find what is missing in my
> > windows 2003 ...
> >  > Hope to read you soon !
> >  > John
> >
> > Well, there is not much more to say. inet_gethost.c calls
> > struct hostent *gethostbyname(const char *name) in the
> > winsock2 library:
> >  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx <http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx >
> > It never returns.
> > It is deprecated but that does not mean broken.
> > I have a Windows 2003 server that it works on.
> > We have not found the reason it differs between
> > my server and your server.
> > And that is about it.
> >
> >
> >
> I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
> on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
> Version 4.0' installed. This is a specific add-on, nothing to do with
> Microsoft Firewall in your Network Properties.
>

I guess info wrote:
> but I don't use ISA server !!!
>

No other interesting firewall software?


I guess Robby wrote:

> If I remove it, it works fine, if I add it it hangs. Apart from that the
> W2003 build is as vanilla as it gets.
>
> Nothing much to go on, but I would not be surprised if some system DLL is
> getting in the way. This is very hard to diagnose.
>
> One day I'll get around to compiling inet_gethost.exe in my setup, just to
> rule out poor linkage due to the VC++ setup used to build the shipping
> executables. If I compile up a trivial gethostbyname() example from MSDN, it
> works OK in all circumstances.
>
> There are a few strange dependencies in other shipped Windows files, for
> example beam.dll seems to depend on a particular MSVCR80.DLL with the
> version 8.0.50727.1433 . And if you have an older Windows machine, you get
> the completely unhelpful popup box telling you that your program could not
> be run. This has something to do with Windows Side-by-Side DLL deployment,
> and I completely fail to grasp what that's all about.
>

I guess info wrote:
> but I don't have msvcr80.dll !!!

I guess you do, actually, since Erlang/OTP's installer is supposed
to install that DLL, if it does not exist already.

I guess Robby wrote:
>
> Robby

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Re: Re: Re: is inet:gethostbyname( IP ) correct?

by info-1679 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 04:29:20PM +0200, info wrote:
I guess Robby wrote:

> On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen   <
> raimo+erlang-questions@...  <raimo%2Berlang-questions@...  >
>  > wrote:
>
>  > On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
>  >   > Dear Raimo,
>  >   > I can resume: I discovered that gethostbyname call inet_gethost.c
>  >   > I don't understand inet_gethost.c :-(
>  >   > Where "goes" this problem for finding the information ?
>  >   > If we know where and what, we could perhaps find what is missing in my
>  > windows 2003 ...
>  >   > Hope to read you soon !
>  >   > John
>  >
>  > Well, there is not much more to say. inet_gethost.c calls
>  > struct hostent *gethostbyname(const char *name) in the
>  > winsock2 library:
>  >  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx  <http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx  >
>  > It never returns.
>  > It is deprecated but that does not mean broken.
>  > I have a Windows 2003 server that it works on.
>  > We have not found the reason it differs between
>  > my server and your server.
>  > And that is about it.
>  >
>  >
>  >
> I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
> on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
> Version 4.0' installed. This is a specific add-on, nothing to do with
> Microsoft Firewall in your Network Properties.
>

I guess info wrote:
> but I don't use ISA server !!!
>

No other interesting firewall software?
Yes: I am using Comodo.

I guess Robby wrote:

> If I remove it, it works fine, if I add it it hangs. Apart from that the
> W2003 build is as vanilla as it gets.
>
> Nothing much to go on, but I would not be surprised if some system DLL is
> getting in the way. This is very hard to diagnose.
>
> One day I'll get around to compiling inet_gethost.exe in my setup, just to
> rule out poor linkage due to the VC++ setup used to build the shipping
> executables. If I compile up a trivial gethostbyname() example from MSDN, it
> works OK in all circumstances.
>
> There are a few strange dependencies in other shipped Windows files, for
> example beam.dll seems to depend on a particular MSVCR80.DLL with the
> version 8.0.50727.1433 . And if you have an older Windows machine, you get
> the completely unhelpful popup box telling you that your program could not
> be run. This has something to do with Windows Side-by-Side DLL deployment,
> and I completely fail to grasp what that's all about.
>

I guess info wrote:
> but I don't have msvcr80.dll !!!

I guess you do, actually, since Erlang/OTP's installer is supposed
to install that DLL, if it does not exist already.

I guess Robby wrote:
>
> Robby

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Re: Re: Re: is inet:gethostbyname( IP ) correct?

by info-1679 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 04:29:20PM +0200, info wrote:
I guess Robby wrote:

> On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen   <
> raimo+erlang-questions@...  <raimo%2Berlang-questions@...  >
>  > wrote:
>
>  > On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
>  >   > Dear Raimo,
>  >   > I can resume: I discovered that gethostbyname call inet_gethost.c
>  >   > I don't understand inet_gethost.c :-(
>  >   > Where "goes" this problem for finding the information ?
>  >   > If we know where and what, we could perhaps find what is missing in my
>  > windows 2003 ...
>  >   > Hope to read you soon !
>  >   > John
>  >
>  > Well, there is not much more to say. inet_gethost.c calls
>  > struct hostent *gethostbyname(const char *name) in the
>  > winsock2 library:
>  >  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx  <http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx  >
>  > It never returns.
>  > It is deprecated but that does not mean broken.
>  > I have a Windows 2003 server that it works on.
>  > We have not found the reason it differs between
>  > my server and your server.
>  > And that is about it.
>  >
>  >
>  >
> I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
> on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
> Version 4.0' installed. This is a specific add-on, nothing to do with
> Microsoft Firewall in your Network Properties.
>

I guess info wrote:
> but I don't use ISA server !!!
>

No other interesting firewall software?


I guess Robby wrote:

> If I remove it, it works fine, if I add it it hangs. Apart from that the
> W2003 build is as vanilla as it gets.
>
> Nothing much to go on, but I would not be surprised if some system DLL is
> getting in the way. This is very hard to diagnose.
>
> One day I'll get around to compiling inet_gethost.exe in my setup, just to
> rule out poor linkage due to the VC++ setup used to build the shipping
> executables. If I compile up a trivial gethostbyname() example from MSDN, it
> works OK in all circumstances.
>
> There are a few strange dependencies in other shipped Windows files, for
> example beam.dll seems to depend on a particular MSVCR80.DLL with the
> version 8.0.50727.1433 . And if you have an older Windows machine, you get
> the completely unhelpful popup box telling you that your program could not
> be run. This has something to do with Windows Side-by-Side DLL deployment,
> and I completely fail to grasp what that's all about.
>

I guess info wrote:
> but I don't have msvcr80.dll !!!

I guess you do, actually, since Erlang/OTP's installer is supposed
to install that DLL, if it does not exist already.


Unfortunately msvcr80.dll is neither in system32 nor in erlang directory !!
(I found it with other applications but in their directory).


I guess Robby wrote:
>
> Robby

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 17, 2009 at 12:46:50AM +0100, info wrote:

> On Fri, Oct 16, 2009 at 04:29:20PM +0200, info wrote:
> I guess Robby wrote:
> > On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen   <
> > raimo+erlang-questions@...  <raimo%2Berlang-questions@...  >
> >  > wrote:
> >
> >  > On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> >  >   > Dear Raimo,
> >  >   > I can resume: I discovered that gethostbyname call inet_gethost.c
> >  >   > I don't understand inet_gethost.c :-(
> >  >   > Where "goes" this problem for finding the information ?
> >  >   > If we know where and what, we could perhaps find what is missing in my
> >  > windows 2003 ...
> >  >   > Hope to read you soon !
> >  >   > John
> >  >
> >  > Well, there is not much more to say. inet_gethost.c calls
> >  > struct hostent *gethostbyname(const char *name) in the
> >  > winsock2 library:
> >  >  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx  <http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx  >
> >  > It never returns.
> >  > It is deprecated but that does not mean broken.
> >  > I have a Windows 2003 server that it works on.
> >  > We have not found the reason it differs between
> >  > my server and your server.
> >  > And that is about it.
> >  >
> >  >
> >  >
> > I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
> > on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
> > Version 4.0' installed. This is a specific add-on, nothing to do with
> > Microsoft Firewall in your Network Properties.
> >
>
> I guess info wrote:
> > but I don't use ISA server !!!
> >
>
> No other interesting firewall software?
> Yes: I am using Comodo.

Can you try to uninstall Comodo and see if the problem disappears.
If so we know where to look for the problem.
(We have installed a 2003 server with Comodo and got no problems,
 other than the possibility to do configuration errors that
 would cause your symptoms)

>
> I guess Robby wrote:
> > If I remove it, it works fine, if I add it it hangs. Apart from that the
> > W2003 build is as vanilla as it gets.
> >
> > Nothing much to go on, but I would not be surprised if some system DLL is
> > getting in the way. This is very hard to diagnose.
> >
> > One day I'll get around to compiling inet_gethost.exe in my setup, just to
> > rule out poor linkage due to the VC++ setup used to build the shipping
> > executables. If I compile up a trivial gethostbyname() example from MSDN, it
> > works OK in all circumstances.
> >
> > There are a few strange dependencies in other shipped Windows files, for
> > example beam.dll seems to depend on a particular MSVCR80.DLL with the
> > version 8.0.50727.1433 . And if you have an older Windows machine, you get
> > the completely unhelpful popup box telling you that your program could not
> > be run. This has something to do with Windows Side-by-Side DLL deployment,
> > and I completely fail to grasp what that's all about.
> >
>
> I guess info wrote:
> > but I don't have msvcr80.dll !!!
>
> I guess you do, actually, since Erlang/OTP's installer is supposed
> to install that DLL, if it does not exist already.
>
> I guess Robby wrote:
> >
> > Robby
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


Parent Message unknown Re: Re: Re: is inet:gethostbyname( IP ) correct?

by Raimo Niskanen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try searching from C:/WINDOWS. It may be under
C:/WINDOWS/System32 or hide under C:/WINDOWS/WinSxS/*/
somewhere.

It may also be so that the installer thought it did not
need to install msvcr80.dll, and is wrong about that.
Try re-installing Erlang and select the checkbox
about installing Microsoft Runtime. That way it is
certain Erlang uses the distributed runtime library.

On Mon, Oct 19, 2009 at 11:53:07PM +0200, info wrote:

> And what about msvcr80.dll which is missing in my server ?
>
> On Sat, Oct 17, 2009 at 12:46:50AM +0100, info wrote:
> > On Fri, Oct 16, 2009 at 04:29:20PM +0200, info wrote:
> > I guess Robby wrote:
> >  > On Thu, Oct 15, 2009 at 4:28 PM, Raimo Niskanen    <
> >  > raimo+erlang-questions@...   <raimo%2Berlang-questions@...   >
> >  >   > wrote:
> >  >
> >  >   > On Thu, Oct 15, 2009 at 03:02:40PM +0200, info wrote:
> >  >   >    > Dear Raimo,
> >  >   >    > I can resume: I discovered that gethostbyname call inet_gethost.c
> >  >   >    > I don't understand inet_gethost.c :-(
> >  >   >    > Where "goes" this problem for finding the information ?
> >  >   >    > If we know where and what, we could perhaps find what is missing in my
> >  >   > windows 2003 ...
> >  >   >    > Hope to read you soon !
> >  >   >    > John
> >  >   >
> >  >   > Well, there is not much more to say. inet_gethost.c calls
> >  >   > struct hostent *gethostbyname(const char *name) in the
> >  >   > winsock2 library:
> >  >   >  http://msdn.microsoft.com/en-us/library/ms738524(VS.85).aspx   <http://msdn.microsoft.com/en-us/library/ms738524%28VS.85%29.aspx   >
> >  >   > It never returns.
> >  >   > It is deprecated but that does not mean broken.
> >  >   > I have a Windows 2003 server that it works on.
> >  >   > We have not found the reason it differs between
> >  >   > my server and your server.
> >  >   > And that is about it.
> >  >   >
> >  >   >
> >  >   >
> >  > I can consistently reproduce the hanging gethostbyname() in inet_gethost.exe
> >  > on Windows 2003 when I have the 'Microsoft Firewall Client for ISA Server
> >  > Version 4.0' installed. This is a specific add-on, nothing to do with
> >  > Microsoft Firewall in your Network Properties.
> >  >
> >
> > I guess info wrote:
> >  > but I don't use ISA server !!!
> >  >
> >
> > No other interesting firewall software?
> > Yes: I am using Comodo.
>
> Can you try to uninstall Comodo and see if the problem disappears.
> If so we know where to look for the problem.
> (We have installed a 2003 server with Comodo and got no problems,
>  other than the possibility to do configuration errors that
>  would cause your symptoms)
>
> >
> > I guess Robby wrote:
> >  > If I remove it, it works fine, if I add it it hangs. Apart from that the
> >  > W2003 build is as vanilla as it gets.
> >  >
> >  > Nothing much to go on, but I would not be surprised if some system DLL is
> >  > getting in the way. This is very hard to diagnose.
> >  >
> >  > One day I'll get around to compiling inet_gethost.exe in my setup, just to
> >  > rule out poor linkage due to the VC++ setup used to build the shipping
> >  > executables. If I compile up a trivial gethostbyname() example from MSDN, it
> >  > works OK in all circumstances.
> >  >
> >  > There are a few strange dependencies in other shipped Windows files, for
> >  > example beam.dll seems to depend on a particular MSVCR80.DLL with the
> >  > version 8.0.50727.1433 . And if you have an older Windows machine, you get
> >  > the completely unhelpful popup box telling you that your program could not
> >  > be run. This has something to do with Windows Side-by-Side DLL deployment,
> >  > and I completely fail to grasp what that's all about.
> >  >
> >
> > I guess info wrote:
> >  > but I don't have msvcr80.dll !!!
> >
> > I guess you do, actually, since Erlang/OTP's installer is supposed
> > to install that DLL, if it does not exist already.
> >
> > I guess Robby wrote:
> >  >
> >  > Robby
> >
> > --
> >
> > / Raimo Niskanen, Erlang/OTP, Ericsson AB
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

< Prev | 1 - 2 | Next >