Fix anr monitor
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 11 Jan 2021 08:27:30 +0000 (17:27 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 12 Jan 2021 00:32:28 +0000 (09:32 +0900)
When ANR occurs, AMD removes a process info from the hash table.

Change-Id: Ibc2bc2bf8e20b1060ccbb112fd536082a91d1d00
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_anr_monitor.c

index c49943c0d9926b94a58a8d4821f5a6b2e454325d..0eb38e99717898103d636b8a79607d3fa78a90ef 100644 (file)
@@ -110,17 +110,16 @@ static gboolean __timeout_handler(gpointer data)
                return G_SOURCE_REMOVE;
 
        ctx->timer = 0;
+       __remove_proc_info(pid);
 
        app_status = _app_status_find_v2(pid);
        if (!app_status) {
                _W("Failed to find app status. pid(%d)", pid);
-               __remove_proc_info(pid);
                return G_SOURCE_REMOVE;
        }
 
        if (_app_status_get_status(app_status) == STATUS_DYING) {
                _W("%d is dying", pid);
-               __remove_proc_info(pid);
                return G_SOURCE_REMOVE;
        }
 
@@ -135,7 +134,6 @@ static gboolean __timeout_handler(gpointer data)
                return G_SOURCE_REMOVE;
        }
 
-       __remove_proc_info(pid);
        _signal_send_watchdog(pid, SIGKILL);
 
        return G_SOURCE_REMOVE;