delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/31/01:45:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 31 Aug 2003 01:45:04 -0400
From: Christopher Faylor <cgf-rcm AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: ftp crash with latest inetutils and cygwin 1.5
Message-ID: <20030831054504.GA8020@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <3 DOT 0 DOT 5 DOT 32 DOT 20030830173651 DOT 0081a5f0 AT incoming DOT verizon DOT net>
Mime-Version: 1.0
In-Reply-To: <3.0.5.32.20030830173651.0081a5f0@incoming.verizon.net>
User-Agent: Mutt/1.4.1i

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019