From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32591 invoked by alias); 28 Oct 2013 18:00:10 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 32569 invoked by uid 89); 28 Oct 2013 18:00:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-50.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mho-02-ewr.mailhop.org Received: from mho-02-ewr.mailhop.org (HELO mho-02-ewr.mailhop.org) (204.13.248.72) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 18:00:08 +0000 Received: from pool-98-110-183-69.bstnma.fios.verizon.net ([98.110.183.69] helo=cgf.cx) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1Var6k-000IsC-Cb; Mon, 28 Oct 2013 18:00:06 +0000 Received: from cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 7A4CB60009; Mon, 28 Oct 2013 14:00:05 -0400 (EDT) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/5wnz4/JKBgC1M9K1PscTa Date: Mon, 28 Oct 2013 18:00:00 -0000 From: Christopher Faylor To: Pan ruochen , gdb@sourceware.org Cc: cygwin@cygwin.com Subject: Re: Fwd: gdb on Cygwin cannot give correct call stacks for segment faults Message-ID: <20131028180005.GA5542@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: Pan ruochen , gdb@sourceware.org, cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-10/txt/msg00167.txt.bz2 On Mon, Oct 28, 2013 at 12:00:17PM +0800, Pan ruochen wrote: >Hi All, > >I find that my gdb on Cygwin cannot dump correct call stacks while >segment faults arise. This isn't a failing of gdb. It's a Cygwin problem. It can't reliably show backtraces when a SEGV happens in Cygwin DLL code. This is a known issue. cgf >Test code is as follows: >-------------------------------------------------------------- >#include >#include > >void foo() >{ > FILE * volatile dev =NULL; > fprintf(dev, "Hello World!\n"); >} > >int main() >{ > foo(); > return 0; >} >-------------------------------------------------------------- > >And backtrace information is as follows: >Program received signal SIGSEGV, Segmentation fault. >0x61138b61 in _fwrite_r () from /usr/bin/cygwin1.dll >(gdb) backtrace >#0 0x61138b61 in _fwrite_r () from /usr/bin/cygwin1.dll >#1 0x76bd1194 in WaitForSingleObjectEx () > from /cygdrive/c/windows/syswow64/kernel32.dll >#2 0x76bd1148 in WaitForSingleObject () > from /cygdrive/c/windows/syswow64/kernel32.dll >#3 0x610dd558 in sig_send(_pinfo*, siginfo_t&, _cygtls*) () > from /usr/bin/cygwin1.dll >#4 0x610303b4 in exception::handle(_EXCEPTION_RECORD*, >_exception_list*, _CONTEXT*, void*) () from /usr/bin/cygwin1.dll >#5 0x77a5b499 in ntdll!LdrRemoveLoadAsDataTable () > from /cygdrive/c/windows/system32/ntdll.dll >#6 0x0028a6ac in ?? () >#7 0x77a5b46b in ntdll!LdrRemoveLoadAsDataTable () > from /cygdrive/c/windows/system32/ntdll.dll >#8 0x0028a6ac in ?? () >#9 0x77a10133 in ntdll!KiUserExceptionDispatcher () > from /cygdrive/c/windows/system32/ntdll.dll >#10 0x0028a6ac in ?? () >#11 0x61138c75 in fwrite () from /usr/bin/cygwin1.dll >#12 0x610d75e5 in _sigfe () from /usr/bin/cygwin1.dll >#13 0x0000000d in ?? () >#14 0x00000000 in ?? () > >does not give any useful clues where the segment faults arise. >So what is wrong? > >-- BR, Ruochen >