kcrash, fork, and stdout/stderr
Thiago Macieira
thiago at kde.org
Mon Dec 4 16:04:25 UTC 2017
On Monday, 4 December 2017 00:26:55 PST David Faure wrote:
> > Or do you fork a child at that point? fork from inside a signal handler is
> > an incredibly bad idea, don't do it.
>
> Well, I guess that's why it's the fallback from the main strategy which is
> "ask kdeinit to restart that application" (even if it doesn't provide a
> kdeinit module). But kdeinit might not be running, outside plasma workspace.
>
> This has always been like that, it goes back to 2006 (Luboš), it was
> discussed with you
> https://marc.info/?l=kde-core-devel&m=113699766611213&w=2 ("There's still a
> fallback to use fork() in case using kdeinit fails for any reason.")
Well, I've learnt a lot in the last 11 years.
forking inside a signal handler is a bad idea because it may deadlock. If the
crash happens while glibc holds some mutexes relating to pthread_atfork, then
you'll have a problem.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
More information about the Kde-frameworks-devel
mailing list