From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11156 invoked by alias); 28 Oct 2013 04:00:21 -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 11140 invoked by uid 89); 28 Oct 2013 04:00:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f51.google.com Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 04:00:19 +0000 Received: by mail-pa0-f51.google.com with SMTP id ld10so6627261pab.10 for ; Sun, 27 Oct 2013 21:00:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.118.129 with SMTP id km1mr5178577pab.127.1382932817358; Sun, 27 Oct 2013 21:00:17 -0700 (PDT) Received: by 10.68.46.234 with HTTP; Sun, 27 Oct 2013 21:00:17 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Oct 2013 04:00:00 -0000 Message-ID: Subject: Fwd: gdb on Cygwin cannot give correct call stacks for segment faults From: Pan ruochen To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-10/txt/msg00162.txt.bz2 Hi All, I find that my gdb on Cygwin cannot dump correct call stacks while segment faults arise. 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