ftp crash with latest inetutils and cygwin 1.5

Christopher Faylor cgf-rcm@cygwin.com
Sun Aug 31 15:05:00 GMT 2003


On Sat, Aug 30, 2003 at 05:36:51PM -0400, Pierre A. Humblet wrote:
>The following is 100% reproducible with ftp from inetutils
>1.3.2-23 and -24, and any Cygwin 1.5.X.
>I have not tried other combinations.
>Note the mispelling of the site in the initial command. 
>
>~: ftp mysite.verzion.net
>ftp: connect to address 208.38.59.182: Connection refused
>Trying 208.38.59.183...
>ftp: connect to address 208.38.59.183: Connection refused
>Trying 208.38.61.25...
>ftp: connect to address 208.38.61.25: Connection refused
>Trying 199.72.44.116...
>ftp: connect to address 199.72.44.116: Connection refused
>Trying 208.38.59.181...
>ftp: connect: Connection refused
>ftp> open mysite.verizon.net
>Segmentation fault (core dumped)
>
>Here is the stack
>
>#1  0x61043c54 in dlfree (mem=0x980828) at
>../../../../src/winsup/cygwin/malloc.cc:3781
>#2  0x6104c20a in free_hostent_ptr(hostent*&) (p=@0x610fd62c) at
>../../../../src/winsup/cygwin/net.cc:972
>#3  0x6104c57b in cygwin_gethostbyname (name=0x413ef5 "mysite.verizon.net")
>at ../../../../src/winsup/cygwin/net.cc:1048
>
>CYGWIN_ME-4.90 hpn5170x 1.5.3(0.90/3/2) 2003-08-30 14:50 i686 unknown
>unknown Cygwin

Ok.  I finally duplicated the problem and tracked this down.  It looks
like inetutils is incrementing the h_addr_list structure in a static
hostent structure and then cygwin tries to free that incremented
address, causing malloc to become confused.

I know how to fix it but it's too late to do it right now.

My plan is to allocate the memory for these char ** arrays
contiguously and avoid using the internal structure pointers
directly.  If this makes sense to anyone and you want to submit
a patch or check in a fix, feel free.  Othewise, I'll get to this
tomorrow.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list