Fix signal handling 02/223102/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 23 Jan 2020 01:28:55 +0000 (10:28 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 23 Jan 2020 01:28:55 +0000 (10:28 +0900)
if old sa_sigaction exists, AUL invokes the old sig_saction.

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

index ae31ef1..d34dfef 100644 (file)
                 break;                                                         \
         }                                                                      \
                                                                                \
-        i = (nptrs > 2) ? 2 : 0;                                               \
         dlog_print(DLOG_ERROR, "AUL_BACKTRACE",                                \
                         "%s backtrace() returns %d address",                   \
-                        strings[i], nptrs - i);                                \
+                        strings[0], nptrs);                                    \
                                                                                \
         for (i = 0; i < nptrs; i++) {                                          \
                 dladdr(buffer[i], &info);                                      \
-                if (i > 1) {                                                   \
-                        dlog_print(DLOG_ERROR, "AUL_BACKTRACE",                \
-                                        "[%2d] %s %s\n",                       \
-                                        i - 2,                                 \
-                                        info.dli_sname ? info.dli_sname : "?", \
-                                        strings[i]);                           \
-                }                                                              \
+                dlog_print(DLOG_ERROR, "AUL_BACKTRACE",                        \
+                                "[%2d] %s %s\n",                               \
+                                i,                                             \
+                                info.dli_sname ? info.dli_sname : "?",         \
+                                strings[i]);                                   \
         }                                                                      \
 } while (0)
 
@@ -153,8 +150,12 @@ static void __aul_unix_signal_handler(int signo, siginfo_t *info, void *arg)
 
        aul_signo = __get_aul_signo(signo);
        if (aul_signo != -1) {
-               sigaction(signo, &__old_action[aul_signo], NULL);
-               raise(signo);
+               if (__old_action[aul_signo].sa_sigaction) {
+                       __old_action[aul_signo].sa_sigaction(signo, info, arg);
+               } else {
+                       sigaction(signo, &__old_action[aul_signo], NULL);
+                       raise(signo);
+               }
        }
 }
 #endif /* TIZEN_FEATURE_DEBUG_MODE */