* Fwd: gdb on Cygwin cannot give correct call stacks for segment faults [not found] <CALX7UOgBuWzx_8dO+Aev=1MfLLSma6CQdcQqi6iURCA1HR7snA@mail.gmail.com> @ 2013-10-28 4:00 ` Pan ruochen 2013-10-28 16:12 ` Eli Zaretskii 2013-10-28 18:00 ` Christopher Faylor 0 siblings, 2 replies; 3+ messages in thread From: Pan ruochen @ 2013-10-28 4:00 UTC (permalink / raw) To: gdb Hi All, I find that my gdb on Cygwin cannot dump correct call stacks while segment faults arise. Test code is as follows: -------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fwd: gdb on Cygwin cannot give correct call stacks for segment faults 2013-10-28 4:00 ` Fwd: gdb on Cygwin cannot give correct call stacks for segment faults Pan ruochen @ 2013-10-28 16:12 ` Eli Zaretskii 2013-10-28 18:00 ` Christopher Faylor 1 sibling, 0 replies; 3+ messages in thread From: Eli Zaretskii @ 2013-10-28 16:12 UTC (permalink / raw) To: Pan ruochen; +Cc: gdb > Date: Mon, 28 Oct 2013 12:00:17 +0800 > From: Pan ruochen <panruochen@gmail.com> > > 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? My crystal ball says you are looking at the wrong thread. Try "thread apply all backtrace". ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fwd: gdb on Cygwin cannot give correct call stacks for segment faults 2013-10-28 4:00 ` Fwd: gdb on Cygwin cannot give correct call stacks for segment faults Pan ruochen 2013-10-28 16:12 ` Eli Zaretskii @ 2013-10-28 18:00 ` Christopher Faylor 1 sibling, 0 replies; 3+ messages in thread From: Christopher Faylor @ 2013-10-28 18:00 UTC (permalink / raw) To: Pan ruochen, gdb; +Cc: cygwin 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 <stdio.h> >#include <stdlib.h> > >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 > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-28 18:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CALX7UOgBuWzx_8dO+Aev=1MfLLSma6CQdcQqi6iURCA1HR7snA@mail.gmail.com>
2013-10-28 4:00 ` Fwd: gdb on Cygwin cannot give correct call stacks for segment faults Pan ruochen
2013-10-28 16:12 ` Eli Zaretskii
2013-10-28 18:00 ` Christopher Faylor
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox