Bug 287458

Summary: Add support for "catch throw" in backtrace generation
Product: [Applications] drkonqi Reporter: Christoph Feck <cfeck>
Component: backtraceparsingAssignee: George Kiagiadakis <mail>
Status: RESOLVED FIXED    
Severity: wishlist CC: andresbajotierra, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Christoph Feck 2011-11-24 12:15:43 UTC
As indicated in bug 287331 comment #2 it is possible to instruct gdb to actually generate a meaningful backtrace when an exception has been thrown. We get a lot of crash reports for those, but the backtrace is useless, because it only shows a thrown exception, but not from where.
Comment 1 Jekyll Wu 2013-01-06 21:53:23 UTC
I also would like to have it,  but is that really possible for drkonqi,  which asks gdb to attach that process only after the crash/exception has happen?  I think that is only possible when the applicaition is run by gdb and the those extra instructions are given before the crash/exception happens.
Comment 2 Jekyll Wu 2013-09-19 10:46:58 UTC
The best that can be done, I think, is Dr.Konqi should detect that the backtrace implies uncaught exception, then instead of telling users to report the crash it should inform users :

"Unfortunately, this backtrace is basically of no use due to uncaught exception in the code (not your fault). If you can reproduce the crash every time, please follow the guide at http://techbase.kde.org/some-guiding-page  and use gdb to get a better backtrace, then report it to bugs.kde.org manually.  Thanks for your help . "
Comment 3 Christoph Feck 2013-10-02 21:06:51 UTC
I was rather thinking about the "Restart Application" button. Maybe it could be possible to restart it with said option, then on next crash, gdb could show a better backtrace.
Comment 4 Justin Zobel 2021-03-09 05:38:52 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 5 Bug Janitor Service 2023-12-06 01:13:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcrash/-/merge_requests/53
Comment 6 Bug Janitor Service 2023-12-06 01:17:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/drkonqi/-/merge_requests/205
Comment 7 Harald Sitter 2023-12-08 05:43:30 UTC
Git commit 1cfbe46675cb5e5cab18ac70b3c09edd14e22445 by Harald Sitter.
Committed on 08/12/2023 at 05:59.
Pushed by sitter into branch 'master'.

detect active exceptions and put them in the metadata

technically very straight forward except for a needed refactor of how
the INI writing works: instead of snprintfing into a preallocated string
we now write out the line on the fly. this allows us to make sure value
doesn't contain \n that would break the ini format. when a \n appears
we'll write it out as string rather than escape sequence.

M  +3    -3    autotests/metadatatest.cpp
M  +3    -0    src/CMakeLists.txt
A  +57   -0    src/exception.cpp     [License: LGPL(v2.0+)]
A  +19   -0    src/exception_p.h     [License: LGPL(v2.0+)]
M  +10   -0    src/kcrash.cpp
M  +19   -9    src/metadata.cpp
M  +1    -2    src/metadata_p.h

https://invent.kde.org/frameworks/kcrash/-/commit/1cfbe46675cb5e5cab18ac70b3c09edd14e22445
Comment 8 Harald Sitter 2023-12-08 05:48:21 UTC
Git commit 02c03ee13f6bb27e15d82cd363c9f83bbbc566b8 by Harald Sitter.
Committed on 08/12/2023 at 06:46.
Pushed by sitter into branch 'master'.

handle exception data

kcrash can now forward exception metadata, let's handle them.

we route the name through c++filt since it will likely be mangled

M  +20   -0    src/bugzillaintegration/reportinterface.cpp
M  +2    -0    src/drkonqi.h
M  +19   -1    src/main.cpp

https://invent.kde.org/plasma/drkonqi/-/commit/02c03ee13f6bb27e15d82cd363c9f83bbbc566b8