delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/04/15:31:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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: Wed, 4 Aug 2004 15:31:27 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: gethostbyname() crashes
Message-ID: <20040804193127.GA21888@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <usmb2zyt5 DOT fsf AT gnu DOT org> <cerdcb$100$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
In-Reply-To: <cerdcb$100$1@sea.gmane.org>
User-Agent: Mutt/1.4.1i

On Wed, Aug 04, 2004 at 02:28:10PM -0500, Pawel Slusarz wrote:
>"Sam Steingold" <sds AT gnu DOT org> wrote in message
>news:usmb2zyt5 DOT fsf AT gnu DOT org...
>> CYGWIN_NT-5.0 1.5.10(0.116/4/2) 2004-05-25 22:07 i686
>>
>> (gdb) p gethostbyname("ftp.gnu.org")
>
>
>I get the same. Maybe a bug that was introduced recently?
>
>(gdb) list
>1       #include <stdio.h>
>2       #include <netdb.h>
>3
>4       int main(int argc, char *argv[])
>5       {
>6               char name[] = "localhost\0";
>7               gethostbyname(name);
>8               printf("Hello, world\n");
>9
>10              return 0;
>(gdb) break 7
>Breakpoint 1 at 0x4010bc: file test.c, line 7.
>(gdb) run
>Starting program: /cygdrive/c/shared/test/a.exe
>
>Breakpoint 1, main (argc=1, argv=0xa0521d0) at test.c:7
>7               gethostbyname(name);
>(gdb) step
>
>Program received signal SIGSEGV, Segmentation fault.
>0x7c5746b9 in KERNEL32!IsBadWritePtr ()
>   from /cygdrive/c/WINNT/system32/KERNEL32.DLL

Nope.  Not a bug.  Search the archives for IsBadWritePtr.  I'm sure it
will be instructive.

Try actually running the program, and you're see "Hello World".

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