Bug 431561 - Discard backtraces with "The Wayland connection broke. Did the Wayland compositor die?" and substitute the latest one from KWin instead
Summary: Discard backtraces with "The Wayland connection broke. Did the Wayland compo...
Status: RESOLVED FIXED
Alias: None
Product: drkonqi
Classification: Applications
Component: backtraceparsing (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2021-01-13 18:38 UTC by Nate Graham
Modified: 2021-01-22 14:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-01-13 18:38:34 UTC
We see a lot of apps crashing on Wayland with this in the backtrace:

"The Wayland connection broke. Did the Wayland compositor die?"

0% of these backtraces are actionable because, due to https://codereview.qt-project.org/c/qt/qtwayland/+/308984 not having been merged, the real problem is the fact that kwin_wayland crashed. But the backtrace attached to the bug report comes from app, not from KWin. So the bug report is not actionable and everyone is frustrated.

Maybe we could add some intelligence to drkonqi so that if it sees that string in the backtrace, it can silently discard it, grab and substitute the latest kwin backtrace instead, and then re-target the bug report against kwin | wayland-generic instead of the app.
Comment 1 Harald Sitter 2021-01-14 11:49:15 UTC
Drkonqi can't trace any other process than the one that started it because of ptrace scoping. It also cannot attach to a process in a random undefined state, I mean it could generally speaking, it'd not make sense though. By the point drkonqi tried to attach kwin may be already gone, or have had a thread continue running so now it's no longer in the state that actually prompted the crash. So that's kinda out of the question.

Drkonqi could however prevent filing issues to do with compositor death.
Comment 2 Harald Sitter 2021-01-14 15:22:32 UTC
It's not trivial I should add.

From a bit of browsing through the source there isn't a good architecture in place to implement this. Problem #1 is that traces aren't fetched until the user either goes to the developer tab or clicks report bug meaning we can't tell the user right away that the crash is unfortunate but out of the hands of the application. Then 'report bug' has the additional complication that it wants to ask the user questions before getting the trace meaning the user will get annoyed because the provided ultimately useless info. And to top it all off there is no notion that a trace/report might be entirely discard based anything so there's also no UI backing.

Realistically I guess we could get away with solving this in the UI exclusively by checking the combined trace output against the '...connection broke...' string and if applicable inject a final dialog page explaining that the crash is caused elsewhere and cannot be filed. This will only be possible once the trace is fetched on the tracing page though.
Comment 3 Bug Janitor Service 2021-01-18 16:55:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/drkonqi/-/merge_requests/13
Comment 4 Harald Sitter 2021-01-22 14:29:59 UTC
Git commit 08e204a45f5dad8bcfdec79740434b36991c020f by Harald Sitter.
Committed on 22/01/2021 at 11:24.
Pushed by sitter into branch 'master'.

discard wayland client crashes following compositor crash

when the compositor goes down Qt will abort the clients causing kind of
erroneous crashes that the client can't do anything about. as such we
don't want to allow these reports from going through and instead
shortcut the report dialog to a final conclusion page where we inform
the user about the unfortunate circumstance surrounding this crash.

compositor crash detection is based on a simple check for the relevant
qfatalizing string resulting in a persistent state on the parser

M  +8    -1    src/bugzillaintegration/reportassistantdialog.cpp
M  +25   -0    src/bugzillaintegration/reportassistantpages_base.cpp
M  +18   -0    src/parser/backtraceparser.cpp
M  +6    -0    src/parser/backtraceparser.h
M  +2    -0    src/parser/backtraceparser_p.h
M  +23   -1    src/tests/backtraceparsertest/backtraceparsertest.cpp
M  +3    -0    src/tests/backtraceparsertest/backtraceparsertest.h
M  +5    -0    src/tests/backtraceparsertest/backtraceparsertest_data/data.ini
A  +100  -0    src/tests/backtraceparsertest/backtraceparsertest_data/test_compositorCrashBug431561

https://invent.kde.org/plasma/drkonqi/commit/08e204a45f5dad8bcfdec79740434b36991c020f
Comment 5 Harald Sitter 2021-01-22 14:30:30 UTC
Git commit 3ef54a31bd6a2e440ac563703012864a8e35be4d by Harald Sitter.
Committed on 22/01/2021 at 14:30.
Pushed by sitter into branch 'Plasma/5.21'.

discard wayland client crashes following compositor crash

when the compositor goes down Qt will abort the clients causing kind of
erroneous crashes that the client can't do anything about. as such we
don't want to allow these reports from going through and instead
shortcut the report dialog to a final conclusion page where we inform
the user about the unfortunate circumstance surrounding this crash.

compositor crash detection is based on a simple check for the relevant
qfatalizing string resulting in a persistent state on the parser


(cherry picked from commit 08e204a45f5dad8bcfdec79740434b36991c020f)

M  +8    -1    src/bugzillaintegration/reportassistantdialog.cpp
M  +25   -0    src/bugzillaintegration/reportassistantpages_base.cpp
M  +18   -0    src/parser/backtraceparser.cpp
M  +6    -0    src/parser/backtraceparser.h
M  +2    -0    src/parser/backtraceparser_p.h
M  +23   -1    src/tests/backtraceparsertest/backtraceparsertest.cpp
M  +3    -0    src/tests/backtraceparsertest/backtraceparsertest.h
M  +5    -0    src/tests/backtraceparsertest/backtraceparsertest_data/data.ini
A  +100  -0    src/tests/backtraceparsertest/backtraceparsertest_data/test_compositorCrashBug431561

https://invent.kde.org/plasma/drkonqi/commit/3ef54a31bd6a2e440ac563703012864a8e35be4d