Release 5.5.35 68/228368/1 accepted/tizen/5.5/unified/20200321.004529 submit/tizen_5.5/20200320.153547
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 20 Mar 2020 15:15:21 +0000 (16:15 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 20 Mar 2020 15:15:21 +0000 (16:15 +0100)
Change-Id: I35106646c5221c853aedae6cf2c53b4895a8d318

packaging/crash-worker.spec
src/crash-manager/crash-manager.c
src/crash-manager/crash-manager.conf
src/shared/config.c
src/shared/config.h
tests/system/CMakeLists.txt
tests/system/without_so_info_file/without_so_info_file.sh.template [new file with mode: 0644]

index 4a3ebb2..62445d6 100644 (file)
@@ -13,7 +13,7 @@
 
 Name:           crash-worker
 Summary:        Coredump handler and report generator for Tizen
-Version:        5.5.34
+Version:        5.5.35
 Release:        1
 Group:          Framework/system
 License:        Apache-2.0 and BSD-2-Clause and MIT
@@ -268,6 +268,7 @@ mkdir -p %{buildroot}%{crash_temp}
 %{_libdir}/crash-worker/system-tests/utils/libcrash-servicetest
 %{_libdir}/crash-worker/system-tests/utils/minicore-utils.sh
 %{_libdir}/crash-worker/system-tests/wait_for_opt_usr/wait_for_opt_usr.sh
+%{_libdir}/crash-worker/system-tests/without_so_info_file/without_so_info_file.sh
 %{_libdir}/crash-worker/system-tests/without_core/without_core.sh
 
 %if %{with livedumper}
index 7e88660..0f4cdae 100644 (file)
@@ -1066,7 +1066,10 @@ static bool run(struct crash_info *cinfo)
        char *temp_report;
        if (config.report_type >= REP_TYPE_FULL) {
                /* Save shared objects info (file names, bulid IDs, rpm package names) */
-               save_so_info(cinfo);
+               if (config.dump_so_info)
+                       save_so_info(cinfo);
+               else
+                       _I("Not saving .so_info (disabled in configuration)");
 
                /* Wait misc. pids */
                wait_for_pid(dump_state_pid, NULL);
index dfa2d1b..09f3926 100644 (file)
@@ -15,6 +15,15 @@ AllowZip=yes
 # This option applies to ReportType=FULL only!
 # DumpCore=1
 
+# DumpSharedObjectInfo - 1 to enable (default), 0 to disable
+# This option controls creation of .so_info file
+#
+# Note! When set to 0 report will not include information about packages that were
+# mapped into process memory. This information is normally needed to re-create
+# sysroot for the use with debugger.
+#
+# DumpSharedObjectInfo=1
+
 # Use Legacy ProcessCrashed DBus signal
 #   When '0' (default), crash worker emits new-style signal with extensive data:
 #     1. cmd name,
index 27f2f4d..285c4a8 100644 (file)
@@ -151,6 +151,7 @@ static bool config_load_from_dict(config_t *c, dictionary *ini)
        UPDATE(c->max_retention_sec, int, "MaxRetentionSec");
        UPDATE(c->max_crash_dump, int, "MaxCrashDump");
        UPDATE(c->dump_core, boolean, "DumpCore");
+       UPDATE(c->dump_so_info, boolean, "DumpSharedObjectInfo");
        UPDATE(c->allow_zip, boolean, "AllowZip");
        UPDATE(c->legacy_notification, boolean, "UseLegacyNotification");
 
@@ -247,6 +248,7 @@ static bool config_apply_defaults(config_t *c)
        c->max_retention_sec = MAX_RETENTION_SEC;
        c->max_crash_dump = MAX_CRASH_DUMP;
        c->dump_core = DUMP_CORE;
+       c->dump_so_info = DUMP_SO_INFO;
        c->allow_zip = ALLOW_ZIP;
        c->legacy_notification = LEGACY_NOTIFICATION;
 
@@ -265,6 +267,7 @@ static void config_dump(config_t *c)
           "config: max_retention_sec = %d\n"
           "config: max_crash_dump = %d\n"
           "config: dump_core = %d\n"
+          "config: dump_so_info = %d\n"
           "config: allow_zip = %d\n"
           "config: legacy_notification = %d\n",
           c->crash_root_path,
@@ -275,6 +278,7 @@ static void config_dump(config_t *c)
           c->max_retention_sec,
           c->max_crash_dump,
           c->dump_core,
+          c->dump_so_info,
           c->allow_zip,
           c->legacy_notification);
 }
index 0448944..e209dfb 100644 (file)
@@ -26,6 +26,7 @@
 #define MAX_RETENTION_SEC    0
 #define MAX_CRASH_DUMP       0
 #define DUMP_CORE            1
+#define DUMP_SO_INFO         1
 #define ALLOW_ZIP            1
 #define LEGACY_NOTIFICATION  0
 
@@ -49,6 +50,7 @@ enum ReportType {
 typedef struct config {
        bool allow_zip;
        bool dump_core;
+       bool dump_so_info;
        bool legacy_notification;
        enum ReportType report_type;
        int system_max_use;
index eace3ef..c17c517 100644 (file)
@@ -18,26 +18,27 @@ macro(CONFIGURE_TEST test_name)
 endmacro()
 
 configure_test("check_minicore_mem")
-configure_test("time_test")
 configure_test("cmp_backtraces" "cp")
+configure_test("crash_root_path")
 configure_test("critical_process")
-configure_test("wait_for_opt_usr")
+configure_test("dbus_notify")
+configure_test("dbus_notify_legacy")
+configure_test("dump_systemstate_extras")
+configure_test("exclude_paths")
+configure_test("extra_script")
+configure_test("full_core")
 configure_test("info_file")
+configure_test("libcrash-service")
+configure_test("livedumper")
 configure_test("log_file")
-configure_test("so_info_file")
+configure_test("output_param")
 configure_test("report_basic")
 configure_test("report_type_info")
+configure_test("so_info_file")
+configure_test("time_test")
+configure_test("wait_for_opt_usr")
 configure_test("without_core")
-configure_test("crash_root_path")
-configure_test("dump_systemstate_extras")
-configure_test("livedumper")
-configure_test("exclude_paths")
-configure_test("extra_script")
-configure_test("dbus_notify")
-configure_test("dbus_notify_legacy")
-configure_test("output_param")
-configure_test("libcrash-service")
-configure_test("full_core")
+configure_test("without_so_info_file")
 
 configure_file("run.sh.template" "run.sh" @ONLY)
 INSTALL(FILES "run.sh" DESTINATION bin RENAME crash-worker-system-tests-run
diff --git a/tests/system/without_so_info_file/without_so_info_file.sh.template b/tests/system/without_so_info_file/without_so_info_file.sh.template
new file mode 100644 (file)
index 0000000..038e773
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Checks ability to disable .so_info
+
+if [ -z "${CRASH_WORKER_SYSTEM_TESTS}" ]; then
+    CRASH_WORKER_SYSTEM_TESTS="@CRASH_SYSTEM_TESTS_PATH@"
+fi
+
+. ${CRASH_WORKER_SYSTEM_TESTS}/utils/minicore-utils.sh
+
+CONF_DIR=/etc/crash-manager.conf.d
+CONF_FILE=${CONF_DIR}/crash-worker-without-so-info.conf
+
+mount -o rw,remount /
+
+mkdir -p $CONF_DIR
+rm -f $CONF_FILE || :
+cat <<EOF >$CONF_FILE
+[CrashManager]
+DumpSharedObjectInfo=0
+EOF
+
+clean_crash_dump
+
+{
+    ${CRASH_WORKER_SYSTEM_TESTS}/utils/kenny &
+    sleep 1
+    kill -6 $!
+} 1> /dev/null 2>&1
+
+sleep 2
+
+wait_for_app crash-manager
+
+rm -f ${CONF_FILE} || :
+
+test -f ${CRASH_DUMP_PATH}/kenny*zip || fail "crash report not created"
+unzip -l ${CRASH_DUMP_PATH}/kenny*zip | egrep 'kenny*/kenny*.so_info$' && fail ".so_info file found despite being disabled in config"
+
+exit_ok