CrashReporter: fix deadlocks by making it mostly async-signal-safe (#5771)
`CrashReporter::createAndSaveCrash()` is not async-signal-safe, resulting in random deadlocks/double-crashes during Hyprland crashes. This changes the function to be (mostly) async-signal-safe.
This commit is contained in:
parent
55490637aa
commit
90a53aed59
6 changed files with 351 additions and 70 deletions
|
|
@ -36,6 +36,14 @@ void handleUnrecoverableSignal(int sig) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Kill the program if the crash-reporter is caught in a deadlock.
|
||||
signal(SIGALRM, [](int _) {
|
||||
char const* msg = "\nCrashReporter exceeded timeout, forcefully exiting\n";
|
||||
write(2, msg, strlen(msg));
|
||||
abort();
|
||||
});
|
||||
alarm(15);
|
||||
|
||||
CrashReporter::createAndSaveCrash(sig);
|
||||
|
||||
abort();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue