Install a signal handler for SIGABRT and SIGSEGV for kwin_wayland
Summary: kwin_wayland disables ptrace on itself. This has the side effect of core dumps no longer be created - which we want as DrKonqi doesn't work for kwin_wayland. This change introduces a dedicated signal handler for abort and segfault. The signal handler enables ptrace again, unsets itself as signal handler and raises the signal again, so that the proper crash, abort handling can be performed. Test Plan: Added a crash, added an abort and verified that coredumpctl shows the expected coredump. Reviewers: #plasma_on_wayland, #kwin, bshah Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D2003
This commit is contained in:
parent
c240755dee
commit
b487da02cd
1 changed files with 12 additions and 0 deletions
|
@ -419,6 +419,16 @@ static void disablePtrace()
|
|||
|
||||
}
|
||||
|
||||
static void unsetDumpable(int sig)
|
||||
{
|
||||
#if HAVE_PR_SET_DUMPABLE
|
||||
prctl(PR_SET_DUMPABLE, 1);
|
||||
#endif
|
||||
signal(sig, SIG_IGN);
|
||||
raise(sig);
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
|
@ -433,6 +443,8 @@ int main(int argc, char * argv[])
|
|||
signal(SIGINT, SIG_IGN);
|
||||
if (signal(SIGHUP, KWin::sighandler) == SIG_IGN)
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
signal(SIGABRT, KWin::unsetDumpable);
|
||||
signal(SIGSEGV, KWin::unsetDumpable);
|
||||
// ensure that no thread takes SIGUSR
|
||||
sigset_t userSignals;
|
||||
sigemptyset(&userSignals);
|
||||
|
|
Loading…
Reference in a new issue