cinfo->lock_fd = -1;
}
+static void release_crashed_process()
+{
+ /* 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);
+ _I("Released crashed process lock");
+}
+
static bool run(struct crash_info *cinfo)
{
/* Execute processes in parallel */
return false;
}
+ if (!cinfo->livedump && config.release_early)
+ release_crashed_process();
+
char *temp_report;
if (config.report_type >= REP_TYPE_FULL) {
/* Save shared objects info (file names, bulid IDs, rpm package names) */
printf("REPORT_PATH=%s\n", cinfo->result_path);
if (!cinfo->livedump) {
- /* 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);
+ if (!config.release_early)
+ release_crashed_process();
launch_dbus_notify(cinfo);
MaxCrashDump=0
AllowZip=yes
+# Release process before report completion (default - no)
+# This option determines whether the crashing process should be released
+# immediately after reading the necessary data from /proc/<PID>/ to allow the
+# process to be cleaned up. This is important for VIP processes because if they
+# are cleaned up too early, the device will be rebooted before the full report
+# is written.
+# ReleaseProcessLockEarly=no
+
# Crash report path must exist for the reports to be created
# CrashRootPath=/usr/opt/share/crash/
UPDATE(c->dump_so_info, boolean, "DumpSharedObjectInfo");
UPDATE(c->allow_zip, boolean, "AllowZip");
UPDATE(c->legacy_notification, boolean, "UseLegacyNotification");
+ UPDATE(c->release_early, boolean, "ReleaseProcessLockEarly");
#undef UPDATE
c->dump_so_info = DUMP_SO_INFO;
c->allow_zip = ALLOW_ZIP;
c->legacy_notification = LEGACY_NOTIFICATION;
+ c->release_early = RELEASE_EARLY;
return c->crash_root_path != NULL;
}
"config: dump_core = %d\n"
"config: dump_so_info = %d\n"
"config: allow_zip = %d\n"
- "config: legacy_notification = %d\n",
+ "config: legacy_notification = %d\n"
+ "config: release_early = %d\n",
c->crash_root_path,
c->extra_script,
report_type_to_str(c->report_type),
c->dump_core,
c->dump_so_info,
c->allow_zip,
- c->legacy_notification);
+ c->legacy_notification,
+ c->release_early);
}
bool config_init(config_t *c, const char *const path)
#define DUMP_SO_INFO 1
#define ALLOW_ZIP 1
#define LEGACY_NOTIFICATION 0
+#define RELEASE_EARLY 0
#define CRASH_SECTION "CrashManager"
#define EXCLUDEPATHS_SECTION "ExcludePaths"
bool dump_core;
bool dump_so_info;
bool legacy_notification;
+ bool release_early;
enum ReportType report_type;
int system_max_use;
int system_keep_free;