Store crash report automatically if shutting down
ClosedPublic

Authored by tcanabrava on Jul 8 2019, 10:09 AM.

Details

Summary

Save the backtrace when shutting down the DE.
to finish: Load the backtraces again in a nice UI.

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tcanabrava created this revision.Jul 8 2019, 10:09 AM
Restricted Application added a project: Plasma. Β· View Herald TranscriptJul 8 2019, 10:09 AM
Restricted Application added a subscriber: plasma-devel. Β· View Herald Transcript
tcanabrava requested review of this revision.Jul 8 2019, 10:09 AM

Concept: +1

One question, when do we create a DBusInterfaceLauncher instance. Is it in time here?

Without this startkde won't know there's a drkonqi it should be waiting for and then whether you finish saving or not becomes racey.

src/drkonqi.cpp
215

Can we avoid littering the home directory. Somewhere in .cache might make sense, as if it gets lost it's not too important.

I've also been told it's more correct to use "/" instead of QDir::separator.

sitter added a subscriber: sitter.Jul 8 2019, 10:29 AM

As mentioned in D22323 the stuff in main.cpp needs putting in a class.

What's the rationale behind this change? Isn't this use case covered by coredumpd and the like?

What's the rationale behind this change? Isn't this use case covered by coredumpd and the like?

Well, by that logic we wouldn't have any drkonqi...

  1. crashes on shutdown are currently weird.

A dialog appears and blocks on logout, on shutdown it's a random race. The crash dialog sometimes appears as an SNI which will get missed, sometimes a window on a different VD or different activity.

  1. with a tiny bit of work kwin_wayland crashes will get a bug reporter, which would be an amazing leap forward.
tcanabrava updated this revision to Diff 61338.Jul 8 2019, 1:14 PM

Store in the cache folder

sitter added a comment.Jul 8 2019, 1:43 PM

What's the rationale behind this change? Isn't this use case covered by coredumpd and the like?

Well, by that logic we wouldn't have any drkonqi...

I don't see how.

Drkonqi is and interactive crash reporter, coredumpd is a non-interactive crash catcher. What the diff is doing is taking away the interactivity of drkonqi in certain cases, and that looks to me like we are simply replicating coredumpd at this point. Specifically the diff adds nothing on top of what coredumpd already does, in fact it's worse because we currently don't capture cores, so you couldn't retrace our saved trace with possibly missing debug symbols.

The interactive way of handling a crash on logout would be to show drkonqi and let the user file a bug report. Now I understand this isn't all that reliable, so I would discard the crash and just exit under the assumption that a kernel core pattern (e.g. coredumpd) will deal with the crash.

If you are adamant about this diff I think we need at least a cleanup system to enforce a hard limit on how many traces we keep around, and/or traces of how many logins ago, and/or how many MiB they may consume. Otherwise people are going to get annoyed when there disk is full in a year because the ffmpegthumbnailer crashed a gazillion times ^^

And perhaps more ideally, albeit not blocking this diff, we should look at reshuffling the architecture so on next login drkonqi auto starts with a list of crashes and the ability to file reports for them.

src/drkonqi.cpp
225

Needs to include pid. I can have multiple kwrites running and they could all be crashing.

tcanabrava marked an inline comment as done.Jul 8 2019, 3:23 PM

And perhaps more ideally, albeit not blocking this diff, we should look at reshuffling the architecture so on next login drkonqi auto starts with a list of crashes and the ability to file reports for them.

That second part is in the works. I had a working version but I did not like the outcome. Still, they can be separate reviews.

tcanabrava updated this revision to Diff 61360.Jul 8 2019, 5:21 PM
  • Add pid information to the log files
tcanabrava edited the summary of this revision. (Show Details)Jul 8 2019, 7:05 PM
tcanabrava added reviewers: sitter, davidedmundson.
tcanabrava updated this revision to Diff 61371.Jul 8 2019, 7:05 PM
  • Add pid information to the log files
  • rebase
sitter accepted this revision.Jul 9 2019, 10:52 AM

some style annoyances. fix it then ship it πŸ‘

src/drkonqi.cpp
253

I think three-argument connects are considered bad form, you may want to add a scoping object for the slot.

src/main.cpp
37

these two includes look unused

56

these 2 includes look unused

This revision is now accepted and ready to land.Jul 9 2019, 10:52 AM
tcanabrava updated this revision to Diff 61518.Jul 10 2019, 3:16 PM
  • Add pid information to the log files
  • Store only the last 10 files in the cache directory
sitter accepted this revision.Jul 11 2019, 9:08 AM

some style fixes then ship it plz πŸ‘

src/drkonqi.cpp
214

& goes to the right of the space; curly brace goes on next line for multi-line function bodies

217

This doesn't necessarily need changing, but I want to point out that this and the following two lines are convoluted, they are simply for (int i = fileList.size(); i <= 10; --i) {} if I am reading this right.

219

space between while and brace

232

space between if and brace

This revision was automatically updated to reflect the committed changes.
tcanabrava marked 2 inline comments as done.