From 90533436899d8fb09cd880facb1fe6c61cba50bb Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Thu, 22 Nov 2018 20:34:17 +0100 Subject: [PATCH] crash-manager: Do not force system to wait for crash-popup to complete Calling crash-popup is synchronous, meaning that call has to complete for crash-manager to complete, releasing core pipe descriptor - which allows another crash to be handled. This commit releases the core pipe descriptor allowing another crash to be handled before popup is shown. Change-Id: Iea08efc6318960ee43bb5494eaff42636529ec17 --- src/crash-manager/crash-manager.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c index c48e29a..7768284 100644 --- a/src/crash-manager/crash-manager.c +++ b/src/crash-manager/crash-manager.c @@ -1286,9 +1286,6 @@ int main(int argc, char *argv[]) } move_dump_data(cinfo.info_path, &cinfo); } - /* launch crash-popup only if the .debugmode file is exist*/ - if (debug_mode) - launch_crash_popup(&cinfo); struct NotifyParams notify_params = { .prstatus_fd = cinfo.prstatus_fd, @@ -1303,6 +1300,23 @@ int main(int argc, char *argv[]) send_notify(¬ify_params); + /* Release the core pipe as passed by kernel, allowing another + * coredump to be handled. + * + * Due to usage of core_pipe_limit there is limited number of + * crash-manager processes that kernel is going to invoke + * concurrently. As the next and last step is a _synchronous_ + * call to crash-popup we close the descriptor here. + * + * Note: for VIP processes this will likely cause the system + * to reboot without showing popup. + */ + close(STDIN_FILENO); + + /* launch crash-popup only if the .debugmode file exists */ + if (debug_mode) + launch_crash_popup(&cinfo); + exit: close(cinfo.prstatus_fd); free(crash_temp_path); -- 2.7.4