On Sat, 2011-03-26 at 15:01 +0100, Karel Klic wrote:
Hi,
the attached patch splits a part of abrt-action-generate-backtrace to a
new tool abrt-action-analyze-backtrace, which is used by both LocalGDB
and RetraceServer analyzers.
Then new abrt-action-analyze-backtrace tool reads backtrace and
generates duplication hash, detects crash function, and provides
backtrace rating. These steps haven't been performed for remotely
analyzed crashes so far.
+ /* Read backtrace */
+ /* NB: get_backtrace() closes dd */
+ char *backtrace_str = dd_load_text(dd, FILENAME_BACKTRACE);
+ if (!backtrace_str)
+ {
+ backtrace_str = xstrdup("");
+ log("Backtrace file is missing");
+ }
(1) The "NB: get_backtrace() closes dd" comment is out of place.
(2) dd_load_text() never returns NULL. grep for
DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE to see how to do what you want.
+ /*
+ * The parser failed. Compute the UUID from the executable
+ * and package only. This is not supposed to happen often.
+ */
+ VERB1 log(_("Backtrace parsing failed for %s"), dump_dir_name);
+ VERB1 log("%d:%d: %s", location.line, location.column,
location.message);
Since it is not supposed to happen often, perhaps it's better
to log it *unconditionally*, that is, without VERB1?
--
vda