ui: avoid crashing when restart command is unavailable#624
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #624 +/- ##
==========================================
+ Coverage 84.54% 84.58% +0.03%
==========================================
Files 104 104
Lines 21028 21061 +33
Branches 3219 3221 +2
==========================================
+ Hits 17779 17815 +36
+ Misses 2809 2805 -4
- Partials 440 441 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bdrung
left a comment
There was a problem hiding this comment.
Instead of making restart a no-op, could we change the UI instead to not allow restarting in case ProcCmdline is missing?
|
Subsidiary question: how did we get an empty field in the first place? Is
it a normal occurrence or an actual bug further up the data stream?
…On Tue, 5 May 2026, 21:15 Benjamin Drung, ***@***.***> wrote:
***@***.**** commented on this pull request.
Instead of making restart a no-op, could we change the UI instead to not
allow restarting in case ProcCmdline is missing?
—
Reply to this email directly, view it on GitHub
<#624 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUXZP7PFDMRTMLZ6XEV2VW34ZI4T7AVCNFSM6AAAAACYQPNINCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DEMZQHE2DEOJUHE>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
cdf3184 to
967b976
Compare
bdrung
left a comment
There was a problem hiding this comment.
We need the same kind of change to kde/apport-kde.
| self.w("ignore_future_problems").hide() | ||
| self.w("relaunch_app").set_active(True) | ||
| self.w("relaunch_app").show() | ||
| if "ProcCmdline" in self.report: |
There was a problem hiding this comment.
Could we extent the UI object with an can_restart method that does this check?
The GTK Hang dialog showed "Relaunch this application" whenever restart was offered, even if the report did not contain ProcCmdline. If selected, this reached UserInterface.restart(), which asserts that ProcCmdline is available. The regular crash path already checks for ProcCmdline before offering relaunch. Apply the same rule to the Hang path, and keep the same guard when translating the dialog state into response.restart. Add a GTK system test for a Hang report without ProcCmdline.
967b976 to
5f699c8
Compare
|
I wasn't aware that we have |
Summary
Fix the GTK Hang dialog so it does not offer "Relaunch this application"
when the report has no
ProcCmdline.The regular crash dialog already has this guard, but the Hang-specific
path did not. If the checkbox was selected, apport later called
UserInterface.restart(), which asserts thatProcCmdlineexists.Notes
Report.add_proc_info()normally setsProcCmdline, but reports can stilllack it if the field is removed by hooks or if the report was generated
outside the normal collection path. In that case the UI should not offer a
restart.
Changes
ProcCmdlineis present.ProcCmdlinebefore settingresponse.restart.ProcCmdline.UserInterface.restart()'s assertion unchanged.Test
python3 -m unittest tests.unit.test_uipython3 -m unittest tests.system.test_ui_gtkgit diff --check