Suggestion: Crash watch utility

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Tue May 2 11:56:46 CEST 2006


Stefan Stuhr wrote:
> Hi,
> 
> This e-mail contains a suggestion. If you don't want to (or doesn't have
> time to) implement it, I'm fine with that, but I won't know if I doesn't
> try to suggest it.
> 
> *** The problem ***
> Applications crashes. It happens. Sometimes, on some installations, it
> happens with xfce4-panel, or xfdesktop, or some other core application
> which is important for users.
> It shouldn't happen. When it does, it's a bug, and it should be fixed.
> But sometimes, it does.
> 
> Then novices often tries to log out and in again, or restart their
> computer, with the expectation that everything will be all right again.
> And then, in the process, they often happens to save their session,
> without said core application. As such, when they log in to Xfce again,
> said core application won't start with their session.
> Then they often have to search or ask for help, e.g. on the Xfce mailing
> list.
> 
> *** Example case ***
> http://foo-projects.org/pipermail/xfce/2006-May/017281.html
> 
> *** Suggested solution ***
> When one of the core applications considered an integrated part of the
> desktop (xfce4-panel, xfdesktop, xfwm4, xfce-mcs-manager) crashes, a
> message dialog could pop up with some text explaining that said
> application appears to have crashed (and maybe even encourage to submit
> a bug report, if it is indeed the case - eventually add a link button
> linking to bugzilla.xfce.org), with two buttons: "Close" and "Start
> again". "Close" should close the dialog; "Start again" should try to
> start the application again.
> 
> *** Suggested implementation ***
> A lightweight utility, named xfce4-crashwatch, could be written. Then,
> xfce4-session could start xfce4-panel, xfdesktop, xfwm4 and
> xfce-mcs-manager with commands like this:
>     xfce4-crashwatch xfce4-panel --sm-client-id [SM_CLIENT_ID]
> --display :0.0
> where [SM_CLIENT_ID] is the sm client id.
> 
> A list, containing said core applications, could be implemented in
> xfce4-session, and be used to deside when to use xfce4-crashwatch, in
> order to ensure that it will always be used for said core applications.
> 
> xfce4-crashwatch could run it's first argument as a child process, with
> the second and following arguments of xfce4-crashwatch as arguments for
> the child process, and wait for the child process to exit.
> Then it could use the return code of the child process to decide whether
> it appeared to have crashed, and in that case, run another utility (in
> order to keep xfce4-crashwatch as lightweight as possible) which showed
> the message dialog described in the "Suggested solution" section above.
> Then, depending on the return code of said another utility, it could
> either start over again (i.e. run it's first argument as a child
> process, etc.) or exit.

Just add a signal handler to xfce4-panel, xfdesktop, etc. for SIGSEGV,
and once the signal handler is called, invoke xfce4-crashwatch, that way
you are also able to provide a backtrace on-the-fly on certain platforms.

> Thanks,
> Stefan

Benedikt



More information about the Xfce4-dev mailing list