summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Lewandowski <k.lewandowsk@samsung.com>2018-11-22 20:34:17 +0100
committerMichal Bloch <m.bloch@samsung.com>2018-12-04 10:49:29 +0000
commit90533436899d8fb09cd880facb1fe6c61cba50bb (patch)
treedbb97a35af206100062b12b75f427012579616c4
parent93bfd1fea3fe36feead530837c1e305ce0af505b (diff)
downloadcrash-worker-90533436899d8fb09cd880facb1fe6c61cba50bb.tar.gz
crash-worker-90533436899d8fb09cd880facb1fe6c61cba50bb.tar.bz2
crash-worker-90533436899d8fb09cd880facb1fe6c61cba50bb.zip
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
-rw-r--r--src/crash-manager/crash-manager.c20
1 files 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(&notify_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);