diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-14 14:45:55 +0200 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-14 14:45:55 +0200 |
| commit | d75496e3e1bc3461c5a43fd622bdc5f097613972 (patch) | |
| tree | 2c66464361182cc785104d17d290c7a4354278ad /lib/plugins/CCpp.cpp | |
| parent | e91273875bcb8774042c9950b45145ebc000f07c (diff) | |
| download | abrt-d75496e3e1bc3461c5a43fd622bdc5f097613972.tar.gz abrt-d75496e3e1bc3461c5a43fd622bdc5f097613972.tar.xz abrt-d75496e3e1bc3461c5a43fd622bdc5f097613972.zip | |
CCpp: skip bt generation earlier
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/plugins/CCpp.cpp')
| -rw-r--r-- | lib/plugins/CCpp.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/plugins/CCpp.cpp b/lib/plugins/CCpp.cpp index b5181832..dd12d83f 100644 --- a/lib/plugins/CCpp.cpp +++ b/lib/plugins/CCpp.cpp @@ -121,7 +121,7 @@ static char* exec_vp(char **args, uid_t uid, int redirect_stderr, unsigned timeo if (timeout < 0) { kill(child, SIGKILL); - strbuf_append_strf(buf_out, "\nTimeout exceeded: 60 second, killing %s\n", args[0]); + strbuf_append_strf(buf_out, "\nTimeout exceeded: %u seconds, killing %s\n", timeout_sec, args[0]); break; } @@ -245,12 +245,13 @@ static char *get_backtrace(const char *pDebugDumpDir, const char *pDebugInfoDirs { args[9] = xasprintf("%s backtrace %u%s", thread_apply_all, bt_depth, full); bt = exec_vp(args, xatoi_u(uid), /*redirect_stderr:*/ 1, timeout_sec, NULL); + free(args[9]); if (bt && (bt_depth <= 64 || strlen(bt) < 256*1024)) { - free(args[9]); break; } + free(bt); bt_depth /= 2; if (bt_depth <= 64 && thread_apply_all[0] != '\0') { @@ -726,6 +727,11 @@ static bool DebuginfoCheckPolkit(uid_t uid) void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force) { + if (!m_bBacktrace) + { + return; + } + dump_dir_t *dd = dd_init(); if (!dd_opendir(dd, pDebugDumpDir)) { @@ -734,6 +740,16 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force) return; } + if (!force) + { + int bt_exists = dd_exist(dd, FILENAME_BACKTRACE); + if (bt_exists) + { + dd_close(dd); + return; /* backtrace already exists */ + } + } + /* Skip remote crashes. */ if (dd_exist(dd, FILENAME_REMOTE)) { @@ -747,22 +763,6 @@ void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force) } } - if (!m_bBacktrace) - { - dd_close(dd); - return; - } - - if (!force) - { - int bt_exists = dd_exist(dd, FILENAME_BACKTRACE); - if (bt_exists) - { - dd_close(dd); - return; /* backtrace already exists */ - } - } - char *package = dd_load_text(dd, FILENAME_PACKAGE); char *executable = dd_load_text(dd, FILENAME_EXECUTABLE); char *uid = dd_load_text(dd, CD_UID); |
