Convert crash-manager into c code 21/97521/13
authorSunmin Lee <sunm.lee@samsung.com>
Fri, 11 Nov 2016 02:01:27 +0000 (11:01 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Tue, 6 Dec 2016 10:20:23 +0000 (19:20 +0900)
For ease of adding features, crash-manager is converted to c code.

* Minor changes
 - unused library headers removed (log_dump)
 - change date format (epoch -> local)

Change-Id: I6f27547469769b2ba3c01027cf53bc0d17d82c5e
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
packaging/crash-worker.manifest
packaging/crash-worker.spec
src/crash-manager/99-crash-manager.conf.in
src/crash-manager/CMakeLists.txt
src/crash-manager/crash-manager.c [new file with mode: 0644]
src/crash-manager/crash-manager.h.in [new file with mode: 0644]
src/crash-manager/crash-manager.sh.in [deleted file]
src/log_dump/CMakeLists.txt
src/log_dump/dbus-handler.c

index 61052fb..8e0f4fd 100644 (file)
@@ -4,6 +4,6 @@
        </request>
        <assign>
                <filesystem path="/usr/bin/dump_systemstate" label="System" exec_label="System"/>
-               <filesystem path="/usr/bin/crash-manager.sh" label="System" exec_label="System"/>
+               <filesystem path="/usr/bin/crash-manager" label="System" exec_label="System::Privileged"/>
        </assign>
 </manifest>
index 8b511ff..2d7c68f 100644 (file)
@@ -9,6 +9,7 @@ License:    Apache-2.0 and PD
 Source0:    %{name}-%{version}.tar.gz
 Source1001:    crash-worker.manifest
 BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(libsmack)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(glib-2.0)
@@ -82,7 +83,9 @@ export CFLAGS+=" -Werror"
           -DCRASH_TEMP=%{crash_temp} \
           -DCRASH_PIPE_PATH=%{_libexecdir}/crash-pipe \
           -DCRASH_STACK_PATH=%{_libexecdir}/crash-stack \
+%if "%{?sys_assert}" == "on"
           -DSYS_ASSERT=%{sys_assert} \
+%endif
           -DUPGRADE_SCRIPT_PATH=%{upgrade_script_path}
 # to add support for core dump files add backslash at the end of above line
 # and uncomment below line:
@@ -145,9 +148,7 @@ sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload
 %dir %{crash_temp}
 %dir %{crash_all_log}
 %{crash_dump_gen}/*
-%attr(0755,system,system) %{_bindir}/dump_systemstate
-%attr(0755,system,system) %{_bindir}/crash-manager.sh
-%attr(0755,system,system) %{_bindir}/log_dump
+%attr(0755,root,root) %{_bindir}/*
 %attr(0644,root,system) %{_unitdir}/tizen-debug-on.service
 %attr(0644,root,system) %{_unitdir}/tizen-debug-off.service
 %{_prefix}/lib/sysctl.d/99-crash-manager.conf
index 505bc20..481362f 100644 (file)
@@ -1,3 +1,3 @@
 # Tizen crash-manager
-kernel.core_pattern=|/usr/bin/crash-manager.sh %p %u %g %s %t %e %E
+kernel.core_pattern=|/usr/bin/crash-manager %p %u %g %s %t %e %E
 kernel.core_pipe_limit=10
index cf115ef..23f7570 100644 (file)
@@ -1,21 +1,42 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(crash-manager C)
 
-SET(CRASH_MANAGER "crash-manager")
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+SET(CRASH_MANAGER_SRCS
+       crash-manager.c
+       ${CMAKE_SOURCE_DIR}/src/shared/util.c
+   )
 
-CONFIGURE_FILE(${CRASH_MANAGER}.sh.in ${CRASH_MANAGER}.sh @ONLY)
-CONFIGURE_FILE(99-${CRASH_MANAGER}.conf.in 99-${CRASH_MANAGER}.conf @ONLY)
-CONFIGURE_FILE(500.${CRASH_MANAGER}-upgrade.sh.in 500.${CRASH_MANAGER}-upgrade.sh @ONLY)
+INCLUDE(FindPkgConfig)
+pkg_check_modules(crash-manager_pkgs REQUIRED
+       dlog
+       libsmack
+       libtzplatform-config
+       gio-2.0
+       )
 
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${CRASH_MANAGER}/${CRASH_MANAGER}.sh
-               DESTINATION ${TZ_SYS_BIN}
+FOREACH(flag ${crash-manager_pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+
+CONFIGURE_FILE(crash-manager.h.in crash-manager.h @ONLY)
+ADD_EXECUTABLE(${PROJECT_NAME} ${CRASH_MANAGER_SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${crash-manager_pkgs_LDFLAGS} -pie)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin
                PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
                GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${CRASH_MANAGER}/99-${CRASH_MANAGER}.conf
+CONFIGURE_FILE(99-${PROJECT_NAME}.conf.in 99-${PROJECT_NAME}.conf @ONLY)
+CONFIGURE_FILE(500.${PROJECT_NAME}-upgrade.sh.in 500.${PROJECT_NAME}-upgrade.sh @ONLY)
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}/99-${PROJECT_NAME}.conf
                DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/sysctl.d
                PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${CRASH_MANAGER}/500.${CRASH_MANAGER}-upgrade.sh
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/${PROJECT_NAME}/500.${PROJECT_NAME}-upgrade.sh
                DESTINATION ${UPGRADE_SCRIPT_PATH}
                PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
                GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c
new file mode 100644 (file)
index 0000000..35f8fb6
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ * crash-manager
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/prctl.h>
+#include <sys/smack.h>
+#include <gio/gio.h>
+#include <tzplatform_config.h>
+#include <dlog.h>
+#include "crash-manager.h"
+#include "shared/util.h"
+
+#undef LOG_TAG
+#define LOG_TAG "CRASH_MANAGER"
+
+#define DEBUGMODE_FILE   tzplatform_mkpath(TZ_SYS_ETC, ".debugmode")
+
+/* Crash-popup dbus */
+#define POPUP_BUS_NAME       "org.tizen.system.popup"
+#define POPUP_OBJECT_PATH    "/Org/Tizen/System/Popup/Crash"
+#define POPUP_INTERFACE_NAME POPUP_BUS_NAME".Crash"
+#define POPUP_METHOD         "PopupLaunch"
+
+/* Paths and variables */
+static struct crash_info {
+       char *cmd_info;
+       char *pid_info;
+       char time_info[80];
+       char temp_dir[PATH_MAX];
+       char name[FILENAME_MAX];
+       char result_path[PATH_MAX];
+       char pfx[PATH_MAX];
+       char info_path[PATH_MAX];
+       char core_path[PATH_MAX];
+       char log_path[PATH_MAX];
+#ifdef SYS_ASSERT
+       char sysassert_cs_path[PATH_MAX];
+#endif
+} crash_info;
+
+static int make_dump_dir(void)
+{
+       struct stat st;
+
+       if (!stat(CRASH_PATH, &st)) {
+               if (!(st.st_mode & S_IFDIR)) {
+                       LOGE("%s (not DIR) is already exist", CRASH_PATH);
+                       return -1;
+               }
+       } else {
+               if (mkdir(CRASH_PATH, 0775) < 0) {
+                       LOGE("Failed to mkdir for %s", CRASH_PATH);
+                       return -1;
+               }
+               smack_setlabel(CRASH_PATH, "System::Shared",
+                               SMACK_LABEL_ACCESS);
+               smack_setlabel(CRASH_PATH, "1", SMACK_LABEL_TRANSMUTE);
+       }
+
+       if (!stat(CRASH_TEMP, &st)) {
+               if (!(st.st_mode & S_IFDIR)) {
+                       LOGE("%s (not DIR) is already exist", CRASH_TEMP);
+                       return -1;
+               }
+       } else {
+               if (mkdir(CRASH_TEMP, 0775) < 0) {
+                       LOGE("Failed to mkdir for %s", CRASH_TEMP);
+                       return -1;
+               }
+               smack_setlabel(CRASH_TEMP, "System::Shared",
+                               SMACK_LABEL_ACCESS);
+               smack_setlabel(CRASH_TEMP, "1", SMACK_LABEL_TRANSMUTE);
+       }
+
+       return 0;
+}
+
+static int set_crash_info(char *argv[])
+{
+       int ret;
+       char *temp_dir_ret;
+       time_t time_val;
+       struct tm loc_tm;
+
+       crash_info.cmd_info = argv[6];
+       crash_info.pid_info = argv[1];
+
+       time_val = atoll(argv[5]);
+       localtime_r(&time_val, &loc_tm);
+       strftime(crash_info.time_info, sizeof(crash_info.time_info),
+                       "%Y%m%d%H%M%S", &loc_tm);
+
+       ret = snprintf(crash_info.temp_dir, sizeof(crash_info.temp_dir),
+                       "%s/crash.XXXXXX", CRASH_TEMP);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for temp_dir");
+               return -1;
+       }
+       temp_dir_ret = mkdtemp(crash_info.temp_dir);
+       if (access(temp_dir_ret, F_OK)) {
+               LOGE("Failed to mkdtemp for temp_dir");
+               return -1;
+       }
+
+       ret = snprintf(crash_info.name, sizeof(crash_info.name), "%s_%s_%s",
+                       crash_info.cmd_info,
+                       crash_info.pid_info,
+                       crash_info.time_info);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for name");
+               goto rm_temp;
+       }
+
+       ret = snprintf(crash_info.result_path, sizeof(crash_info.result_path),
+                       "%s/%s.tar.gz", CRASH_PATH, crash_info.name);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for result path");
+               goto rm_temp;
+       }
+
+       ret = snprintf(crash_info.pfx, sizeof(crash_info.pfx), "%s/%s",
+                       crash_info.temp_dir, crash_info.name);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for pfx");
+               goto rm_temp;
+       }
+       ret = mkdir(crash_info.pfx, 0775);
+       if (ret < 0) {
+               LOGE("Failed to mkdir for %s", crash_info.pfx);
+               goto rm_temp;
+       }
+
+       ret = snprintf(crash_info.info_path, sizeof(crash_info.info_path),
+                       "%s/%s.info", crash_info.pfx, crash_info.name);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for info path");
+               goto rm_temp;
+       }
+
+       ret = snprintf(crash_info.core_path, sizeof(crash_info.core_path),
+                       "%s/%s.coredump", crash_info.pfx, crash_info.name);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for core path");
+               goto rm_temp;
+       }
+
+       ret = snprintf(crash_info.log_path, sizeof(crash_info.log_path),
+                       "%s/%s.log", crash_info.pfx, crash_info.name);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for log path");
+               goto rm_temp;
+       }
+
+#ifdef SYS_ASSERT
+       ret = snprintf(crash_info.sysassert_cs_path,
+                       sizeof(crash_info.sysassert_cs_path),
+                      "/tmp/crash_stack/%s_%s.info",
+                      crash_info.cmd_info, crash_info.pid_info);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for sys-assert callstack path");
+               goto rm_temp;
+       }
+#endif
+
+       return 0;
+
+rm_temp:
+       remove_dir(crash_info.temp_dir, 1);
+       return -1;
+}
+
+#ifdef SYS_ASSERT
+static int get_sysassert_cs(void)
+{
+       int ret;
+       char move_path[PATH_MAX];
+
+       if (access(crash_info.sysassert_cs_path, F_OK)) {
+               LOGE("The sys-assert cs file not found: %s",
+                       crash_info.sysassert_cs_path);
+               return -1;
+       }
+
+       ret = snprintf(move_path, sizeof(move_path), "%s/%s",
+                       crash_info.pfx, basename(crash_info.sysassert_cs_path));
+       if (ret < 0) {
+               LOGE("Failed to snprintf for move path");
+               return -1;
+       }
+
+       if (move_file(crash_info.sysassert_cs_path, move_path) < 0) {
+               LOGE("Failed to move %s to %s",
+                               crash_info.sysassert_cs_path, move_path);
+               return -1;
+       }
+
+       return 0;
+}
+#endif
+
+static int convert_path(char *path, char *core_exepath)
+{
+       int i;
+
+       for (i = 0; core_exepath[i]; i++)
+               path[i] = (core_exepath[i] == '!' ? '/' : core_exepath[i]);
+       path[i] = '\0';
+
+       return i;
+}
+
+static void launch_crash_popup(char *core_exepath)
+{
+       GDBusConnection *conn;
+       GVariantBuilder *builder;
+       GVariant *parameters = NULL;
+       GVariant *reply = NULL;
+       GError *error = NULL;
+       int ret;
+       char exepath[PATH_MAX] = "\0";
+
+       if (convert_path(exepath, core_exepath) <= 0) {
+               LOGE("Failed to parsing exepath");
+               return;
+       }
+
+       conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
+       if (error) {
+               LOGE("Failed to get dbus: %s", error->message);
+               g_error_free(error);
+               return;
+       }
+
+       builder = g_variant_builder_new(G_VARIANT_TYPE("a{ss}"));
+       g_variant_builder_add(builder, "{ss}", "_SYSPOPUP_CONTENT_", "crash");
+       g_variant_builder_add(builder, "{ss}", "_PROCESS_NAME_",
+                       crash_info.cmd_info);
+       g_variant_builder_add(builder, "{ss}", "_EXEPATH_", exepath);
+       parameters = g_variant_new("(a{ss})", builder);
+       g_variant_builder_unref(builder);
+
+       reply = g_dbus_connection_call_sync(conn,
+                                           POPUP_BUS_NAME,
+                                           POPUP_OBJECT_PATH,
+                                           POPUP_INTERFACE_NAME,
+                                           POPUP_METHOD,
+                                           parameters,
+                                           G_VARIANT_TYPE("(i)"),
+                                           G_DBUS_CALL_FLAGS_NONE,
+                                           120000,
+                                           NULL,
+                                           &error);
+       if (error) {
+               LOGE("Failed to get reply: %s", error->message);
+               g_error_free(error);
+               goto exit;
+       }
+
+       g_variant_get(reply, "(i)", &ret);
+       LOGI("Crash_popup is launched: (%d)", ret);
+
+exit:
+       if (reply)
+               g_variant_unref(reply);
+       if (parameters)
+               g_variant_unref(parameters);
+}
+
+static void dump_system_state(void)
+{
+       int ret;
+       char command[PATH_MAX];
+
+       ret = snprintf(command, sizeof(command),
+                       "/usr/bin/dump_systemstate -d -k -f %s",
+                       crash_info.log_path);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for dump_systemstate command");
+               return;
+       }
+       system_command(command);
+}
+
+static void execute_crash_modules(int argc, char *argv[], int debug)
+{
+       int ret, i;
+       char arg_append[PATH_MAX];
+       char command[PATH_MAX];
+
+       arg_append[0] = '\0';
+       for (i = 1; i < argc; i++) {
+               strcat(arg_append, argv[i]);
+               strcat(arg_append, " ");
+       }
+
+       /* Execute crash-pipe */
+       if (debug)
+               ret = snprintf(command, sizeof(command),
+                               "%s --save-core %s --report %s > %s",
+                               CRASH_PIPE_PATH,
+                               crash_info.core_path, arg_append,
+                               crash_info.info_path);
+       else
+               ret = snprintf(command, sizeof(command),
+                               "%s --report %s > %s",
+                               CRASH_PIPE_PATH,
+                               arg_append,
+                               crash_info.info_path);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for crash-pipe command");
+               return;
+       }
+       system_command(command);
+
+       /* Execute crash-stack */
+       /*
+       ret = snprintf(command, sizeof(command),
+                       "%s --pid %s >> %s",
+                       CRASH_STACK_PATH,
+                       crash_info.pid_info, crash_info.info_path);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for crash-stack command");
+               return;
+       }
+       system_command(command);
+       */
+}
+
+static void compress(void)
+{
+       int ret;
+       char tar_path[PATH_MAX];
+       char command[PATH_MAX];
+
+       ret = snprintf(tar_path, sizeof(tar_path), "%s/report.tar.gz",
+                       crash_info.temp_dir);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for tar path");
+               return;
+       }
+
+       ret = snprintf(command, sizeof(command),
+                       "/bin/tar -czf %s -C %s %s",
+                       tar_path, crash_info.temp_dir, crash_info.name);
+       if (ret < 0) {
+               LOGE("Failed to snprintf for tar command");
+               return;
+       }
+       system_command(command);
+
+       if (move_file(tar_path, crash_info.result_path) < 0)
+               LOGE("Failed to move %s to %s",
+                               tar_path, crash_info.result_path);
+
+       ret = remove_dir(crash_info.temp_dir, 1);
+       if (ret < 0)
+               LOGE("Failed to delete temp directory");
+}
+
+int main(int argc, char *argv[])
+{
+       prctl(PR_SET_DUMPABLE, 0);
+
+       /* Create crash directories */
+       if (make_dump_dir() < 0)
+               exit(EXIT_FAILURE);
+
+       /* Set crash info */
+       if (set_crash_info(argv) < 0)
+               exit(EXIT_FAILURE);
+
+#ifdef SYS_ASSERT
+       /* Fetch callstack of sys-assert */
+       get_sysassert_cs();
+#endif
+
+       /* .dbugmode: launch crash-popup */
+       if (access(DEBUGMODE_FILE, F_OK) == 0)
+               launch_crash_popup(argv[7]);
+
+       /* Exec dump_systemstate */
+       dump_system_state();
+
+       /* Exec crash modules */
+       execute_crash_modules(argc, argv, DEBUG);
+
+       /* Tar compression */
+       compress();
+
+       return 0;
+}
diff --git a/src/crash-manager/crash-manager.h.in b/src/crash-manager/crash-manager.h.in
new file mode 100644 (file)
index 0000000..90de995
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * crash-manager
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CRASH_MANAGER_H__
+#define __CRASH_MANAGER_H__
+
+/* Make build variables to string */
+#define CRASH_PATH       "@CRASH_PATH@"
+#define CRASH_TEMP       "@CRASH_TEMP@"
+#define SYS_ASSERT       "@SYS_ASSERT@"
+#define CRASH_STACK_PATH "@CRASH_STACK_PATH@"
+#define CRASH_PIPE_PATH  "@CRASH_PIPE_PATH@"
+
+#define DEBUG 1
+
+#endif
diff --git a/src/crash-manager/crash-manager.sh.in b/src/crash-manager/crash-manager.sh.in
deleted file mode 100644 (file)
index 93e1e6a..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-source /etc/tizen-platform.conf
-
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-exec >/dev/null 2>&1
-
-PATH=/bin:/usr/bin
-CRASH_PATH="@CRASH_PATH@"
-CRASH_TEMP="@CRASH_TEMP@"
-
-if [ ! -d "${CRASH_PATH}" ]
-then
-  mkdir -p "${CRASH_PATH}"
-  /usr/bin/chsmack -a "System::Shared" -t "${CRASH_PATH}"
-fi
-
-if [ ! -d "${CRASH_TEMP}" ]
-then
-  mkdir -p "${CRASH_TEMP}"
-  /usr/bin/chsmack -a "System::Shared" -t "${CRASH_TEMP}"
-fi
-
-DEBUG=1
-
-# Expected invocation from kernel:
-#
-#   argv0 PID UID GID SIGNAL TIME CMD EXEPATH
-pid="$1"
-time="$5"
-cmd="$6"
-
-temp_dir="$(mktemp -d "${CRASH_TEMP}/crash.XXXXXX")"
-
-name="${cmd}_${pid}_${time}"
-result_path="${CRASH_PATH}/${name}.tar.gz"
-pfx="${temp_dir}/${name}"
-info_path="${pfx}/${name}.info"
-core_path="${pfx}/${name}.coredump"
-log_path="${pfx}/${name}.log"
-tmp_callstack_path="${pfx}/${name}.callstack"
-sysassert_cs_path="/tmp/crash_stack/${cmd}_${pid}.info"
-
-mkdir -p "$pfx"
-if [ "@SYS_ASSERT@" = "on" ]
-then
-  mv "$sysassert_cs_path" "$pfx/"
-fi
-
-if [ -e $TZ_SYS_ETC/.debugmode ]
-then
-#Find the full path of executable. The path is used to find appid in the crash-popup
-       exepath="$(echo $7 | sed 's/!/\//g')"
-
-#Call dbus method to launch the crash-popup
-       /usr/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=120000 --dest=org.tizen.system.popup /Org/Tizen/System/Popup/Crash org.tizen.system.popup.Crash.PopupLaunch dict:string:string:"_SYSPOPUP_CONTENT_","crash","_PROCESS_NAME_","${cmd}","_EXEPATH_","${exepath}"
-
-fi
-
-dump_systemstate -d -k -f "$log_path" || true
-
-if [ $DEBUG -eq 1 ]
-then
-  @CRASH_PIPE_PATH@ --save-core "$core_path" --report "$@" > "$info_path"
-#  @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
-else
-  @CRASH_PIPE_PATH@ --report "$@" > "$info_path"
-#  @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
-fi
-
-tar czf "${temp_dir}/report.tar.gz" -C "$temp_dir" "$name"
-mv "${temp_dir}/report.tar.gz" "$result_path"
-
-[ "$temp_dir" ] && rm -rf "$temp_dir"
index 1d6d220..7fa6891 100644 (file)
@@ -13,7 +13,6 @@ pkg_check_modules(log_dump_pkgs REQUIRED
        dlog
        capi-system-info
        libtzplatform-config
-       glib-2.0
        gio-2.0
        )
 
index 16274cb..f283c40 100644 (file)
@@ -17,7 +17,6 @@
  */
 
 #include <stdbool.h>
-#include <glib.h>
 #include <gio/gio.h>
 #include "log_dump.h"
 #include "dbus-handler.h"