This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug backtrace/23134] gdb attached to a crashed process shows a different call stack than when running directly


https://sourceware.org/bugzilla/show_bug.cgi?id=23134

--- Comment #2 from Ralf Habacker <ralf.habacker at freenet dot de> ---
(In reply to Pedro Alves from comment #1)
> > 3. Run test.exe directly and attach with gdb after crash happened 
> > 
> > F:\>gdb --pid=1316
> 
> If the crash already happened, how come you can still attach to the process?
> 
> Is it showing some dialog box?  
There is a a default crash handler - showing a message box that the application
has been crashed

> If something like that, then the difference
> should be expected -- thread #1 appears to be waiting for something, while
> inside some GetApplicationRecoveryCallback function, after a SEH exception
> was raised (UnhandledExceptionFilter).
> 
> When running under gdb, gdb intercepts the exception/crash _before_ any of
> that has a chance to run.

If I start a KDE application on Linux, a crash handler (drkonqi) is installed
by default.
In case of an unhandled exception the crash handler is started 
(https://cgit.kde.org/kdelibs.git/tree/kdeui/util/kcrash.cpp?h=KDE/4.14#n481)
similar to the default crash handler on Windows. This crash handler starts gdb
in background to collect the back trace, which contains the same callstack for
the crashing thread if the related application was started from gdb and crashed
inside gdb.

On windows drkonqi does not use gdb, but a back trace generator named kdbgwin
(https://cgit.kde.org/drkonqi.git/tree/src/kdbgwin) with broken mingw symbol
support,  although there is also support to use gdb on windows (which have
working mingw symbol support). Unfortunally gdb on Windows does not perform as
on linux for this use case, which would be required to replace kdbgwin to
reduce the maintenance burden and have up to date mingw symbol support (and may
be pdb symbol support too)

>> GNU gdb (GDB) 7.8.1
> Note that that's old by now.
Has the mentioned behavior been changed in newer gdb versions ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]