Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i On Wed, Aug 04, 2004 at 02:28:10PM -0500, Pawel Slusarz wrote: >"Sam Steingold" 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 >2 #include >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/