crash-manager: Do not force system to wait for crash-popup to complete 46/193646/5
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 22 Nov 2018 19:34:17 +0000 (20:34 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Tue, 4 Dec 2018 10:49:29 +0000 (10:49 +0000)
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

index c48e29a..7768284 100644 (file)
@@ -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);