Blame SOURCES/0030-Add-an-utility-for-stack-trace-analysis.patch

78a2f7
From d2578295a953ced07371eedc885c032951b11297 Mon Sep 17 00:00:00 2001
78a2f7
From: Jakub Filak <jfilak@redhat.com>
78a2f7
Date: Mon, 13 Jan 2014 16:38:17 +0100
78a2f7
Subject: [PATCH 30/39] Add an utility for stack trace analysis
78a2f7
78a2f7
The tool is supposed to find all remote class paths and create a file
78a2f7
named "not-reportale" containing a short explanation why the examined
78a2f7
stack trace is not reportable via ABRT.
78a2f7
78a2f7
The tool is designed for usage in post-create event.
78a2f7
78a2f7
Related to #29
78a2f7
Related to rhbz#1054737
78a2f7
---
78a2f7
 CMakeLists.txt                   |  19 ++-
78a2f7
 po/CMakeLists.txt                |  64 ++++++++++
78a2f7
 po/LINGUAS                       |   0
78a2f7
 po/POTFILES.in                   |   1 +
78a2f7
 src/CMakeLists.txt               |   7 +-
78a2f7
 utils/CMakeLists.txt             |  34 ++++++
78a2f7
 utils/abrt-action-analyze-java.c | 258 +++++++++++++++++++++++++++++++++++++++
78a2f7
 utils/config.h.in                |   2 +
78a2f7
 8 files changed, 379 insertions(+), 6 deletions(-)
78a2f7
 create mode 100644 po/CMakeLists.txt
78a2f7
 create mode 100644 po/LINGUAS
78a2f7
 create mode 100644 po/POTFILES.in
78a2f7
 create mode 100644 utils/CMakeLists.txt
78a2f7
 create mode 100644 utils/abrt-action-analyze-java.c
78a2f7
 create mode 100644 utils/config.h.in
78a2f7
78a2f7
diff --git a/CMakeLists.txt b/CMakeLists.txt
78a2f7
index 1504461..33a5e03 100644
78a2f7
--- a/CMakeLists.txt
78a2f7
+++ b/CMakeLists.txt
78a2f7
@@ -39,6 +39,10 @@ endif()
78a2f7
 
78a2f7
 set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
78a2f7
 
78a2f7
+if(NOT BIN_INSTALL_DIR)
78a2f7
+    set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
78a2f7
+endif()
78a2f7
+
78a2f7
 if(NOT LIB_INSTALL_DIR)
78a2f7
     set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
78a2f7
 endif()
78a2f7
@@ -55,10 +59,23 @@ if(NOT MAN_INSTALL_DIR)
78a2f7
     set(MAN_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/man)
78a2f7
 endif()
78a2f7
 
78a2f7
+if(NOT LOCALE_INSTALL_DIR)
78a2f7
+    set(LOCALE_INSTALL_DIR ${SHARE_INSTALL_PREFIX}/locale)
78a2f7
+endif()
78a2f7
+
78a2f7
+
78a2f7
 add_custom_target(
78a2f7
     dist
78a2f7
     COMMAND git archive --prefix=${CMAKE_PROJECT_NAME}-${git_commit}/ HEAD | gzip > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
78a2f7
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
78a2f7
 )
78a2f7
 
78a2f7
-subdirs(src etc test)
78a2f7
+include(FindPkgConfig)
78a2f7
+pkg_check_modules(PC_SATYR REQUIRED satyr)
78a2f7
+pkg_check_modules(PC_LIBREPORT REQUIRED libreport)
78a2f7
+pkg_check_modules(PC_ABRT REQUIRED abrt)
78a2f7
+
78a2f7
+add_definitions(-D_GNU_SOURCE)
78a2f7
+set(AJC_ENABLE_NLS true)
78a2f7
+
78a2f7
+subdirs(src etc test utils po)
78a2f7
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
78a2f7
new file mode 100644
78a2f7
index 0000000..7c49772
78a2f7
--- /dev/null
78a2f7
+++ b/po/CMakeLists.txt
78a2f7
@@ -0,0 +1,64 @@
78a2f7
+project(po)
78a2f7
+
78a2f7
+if (AJC_ENABLE_NLS)
78a2f7
+    find_program(INTLTOOL_UPDATE_CMD intltool-update)
78a2f7
+    mark_as_advanced(INTLTOOL_UPDATE_CMD)
78a2f7
+
78a2f7
+    find_program(XGETTEXT_CMD xgettext)
78a2f7
+    mark_as_advanced(XGETTEXT_CMD)
78a2f7
+
78a2f7
+    find_program(MSGMERGE_CMD msgmerge)
78a2f7
+    mark_as_advanced(MSGMERGE_CMD)
78a2f7
+
78a2f7
+    find_program(MSGFMT_CMD msgfmt)
78a2f7
+    mark_as_advanced(MSGFMT_CMD)
78a2f7
+
78a2f7
+    find_program(MSGFMT_CMD cat)
78a2f7
+    mark_as_advanced(CAT_CMD)
78a2f7
+
78a2f7
+    file(STRINGS ${po_SOURCE_DIR}/LINGUAS AJC_LINGUAS)
78a2f7
+    set(AJC_LINGUAS_TARGETS)
78a2f7
+    set(AJC_POTFILE ${CMAKE_PROJECT_NAME}.pot)
78a2f7
+    set(AJC_POTFILE_OUTPUT ${po_BINARY_DIR}/${AJC_POTFILE})
78a2f7
+
78a2f7
+    add_custom_target(nls-update-sources
78a2f7
+            ${INTLTOOL_UPDATE_CMD} -m
78a2f7
+            WORKING_DIRECTORY ${po_SOURCE_DIR})
78a2f7
+
78a2f7
+    add_custom_command(OUTPUT ${AJC_POTFILE_OUTPUT}
78a2f7
+            COMMAND ${XGETTEXT_CMD} --files-from ${po_SOURCE_DIR}/POTFILES.in --keyword=_ -o ${AJC_POTFILE_OUTPUT} --copyright-holder="ABRT Team" --msgid-bugs-address="crash-catcher at lists.fedorahosted.org" --no-wrap --no-location
78a2f7
+            DEPENDS POTFILES.in
78a2f7
+            WORKING_DIRECTORY ${abrt-java-connector_SOURCE_DIR}
78a2f7
+            COMMENT "Extract translatable messages to ${AJC_POTFILE}"
78a2f7
+    )
78a2f7
+
78a2f7
+    foreach(language ${AJC_LINGUAS})
78a2f7
+        set(language_SOURCE ${po_SOURCE_DIR}/${language}.po)
78a2f7
+        set(language_OUTPUT ${po_BINARY_DIR}/${language}/LC_MESSAGES/${CMAKE_PROJECT_NAME}.mo)
78a2f7
+
78a2f7
+        add_custom_target(nls-update-${language}.po
78a2f7
+                ${MSGMERGE_CMD} ${language} ${AJC_POTFILE_OUTPUT} -o ${language_SOURCE} --no-wrap
78a2f7
+                DEPENDS ${language_SOURCE} ${AJC_POTFILE_OUTPUT}
78a2f7
+                WORKING_DIRECTORY ${po_SOURCE_DIR}
78a2f7
+        )
78a2f7
+
78a2f7
+        file(MAKE_DIRECTORY "${po_BINARY_DIR}/${language}/LC_MESSAGES")
78a2f7
+
78a2f7
+        add_custom_command(OUTPUT ${language_OUTPUT}
78a2f7
+                COMMAND ${MSGFMT_CMD} -c -o ${language_OUTPUT} ${language_SOURCE}
78a2f7
+                DEPENDS ${language_SOURCE}
78a2f7
+        )
78a2f7
+
78a2f7
+        install(FILES ${language_OUTPUT}
78a2f7
+                DESTINATION share/${CMAKE_PROJECT_NAME}/locale/${language}/LC_MESSAGES
78a2f7
+        )
78a2f7
+
78a2f7
+        set(AJC_LINGUAS_TARGETS ${AJC_CATALOG_TARGETS} ${language_OUTPUT})
78a2f7
+    endforeach(language)
78a2f7
+
78a2f7
+    add_custom_target(nls ALL
78a2f7
+                      DEPENDS ${AJC_POTFILE_OUTPUT} ${AJC_LINGUAS_TARGETS}
78a2f7
+    )
78a2f7
+else(AJC_ENABLE_NLS)
78a2f7
+    message("Native Language Support is disabled")
78a2f7
+endif (AJC_ENABLE_NLS)
78a2f7
diff --git a/po/LINGUAS b/po/LINGUAS
78a2f7
new file mode 100644
78a2f7
index 0000000..e69de29
78a2f7
diff --git a/po/POTFILES.in b/po/POTFILES.in
78a2f7
new file mode 100644
78a2f7
index 0000000..21aec67
78a2f7
--- /dev/null
78a2f7
+++ b/po/POTFILES.in
78a2f7
@@ -0,0 +1 @@
78a2f7
+utils/abrt-action-analyze-java.c
78a2f7
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
78a2f7
index a00fe77..d084401 100644
78a2f7
--- a/src/CMakeLists.txt
78a2f7
+++ b/src/CMakeLists.txt
78a2f7
@@ -1,13 +1,10 @@
78a2f7
 find_package(JNI REQUIRED)
78a2f7
 include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
78a2f7
 
78a2f7
-include(FindPkgConfig)
78a2f7
-pkg_check_modules(PC_ABRT REQUIRED libreport)
78a2f7
 pkg_check_modules(PC_JOURNALD REQUIRED libsystemd-journal)
78a2f7
-include_directories(${PC_ABRT_INCLUDE_DIRS})
78a2f7
+include_directories(${PC_LIBREPORT_INCLUDE_DIRS})
78a2f7
 include_directories(${PC_JOURNALD_INCLUDE_DIRS})
78a2f7
 
78a2f7
-add_definitions(-D_GNU_SOURCE)
78a2f7
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic")
78a2f7
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -DVERBOSE")
78a2f7
 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSILENT")
78a2f7
@@ -20,7 +17,7 @@ set_target_properties(
78a2f7
     PROPERTIES
78a2f7
         OUTPUT_NAME abrt-java-connector)
78a2f7
 
78a2f7
-target_link_libraries(AbrtChecker ${PC_ABRT_LIBRARIES})
78a2f7
+target_link_libraries(AbrtChecker ${PC_LIBREPORT_LIBRARIES})
78a2f7
 target_link_libraries(AbrtChecker ${PC_JOURNALD_LIBRARIES})
78a2f7
 
78a2f7
 install(TARGETS AbrtChecker DESTINATION ${LIB_INSTALL_DIR})
78a2f7
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
78a2f7
new file mode 100644
78a2f7
index 0000000..c358968
78a2f7
--- /dev/null
78a2f7
+++ b/utils/CMakeLists.txt
78a2f7
@@ -0,0 +1,34 @@
78a2f7
+project(utils)
78a2f7
+
78a2f7
+set(AbrtActionAnalyzeJava_SRCS abrt-action-analyze-java.c)
78a2f7
+
78a2f7
+include(CheckIncludeFiles)
78a2f7
+
78a2f7
+if (AJC_ENABLE_NLS)
78a2f7
+    check_include_files(locale.h HAVE_LOCALE_H)
78a2f7
+    if (HAVE_LOCALE_H)
78a2f7
+        set (ENABLE_NLS true)
78a2f7
+    endif (HAVE_LOCALE_H)
78a2f7
+endif (AJC_ENABLE_NLS)
78a2f7
+
78a2f7
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
78a2f7
+
78a2f7
+include_directories(${PC_SATYR_INCLUDE_DIRS})
78a2f7
+include_directories(${PC_LIBREPORT_INCLUDE_DIRS})
78a2f7
+include_directories(${PC_ABRT_INCLUDE_DIRS})
78a2f7
+
78a2f7
+add_definitions(-DHAVE_CONFIG_H)
78a2f7
+add_definitions(-DPACKAGE=\"${CMAKE_PROJECT_NAME}\")
78a2f7
+add_definitions(-DLOCALEDIR=\"${LOCALE_INSTALL_DIR}\")
78a2f7
+include_directories(${utils_BINARY_DIR})
78a2f7
+
78a2f7
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=gnu99 -pedantic")
78a2f7
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -DVERBOSE")
78a2f7
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSILENT")
78a2f7
+
78a2f7
+add_executable(abrt-action-analyze-java ${AbrtActionAnalyzeJava_SRCS})
78a2f7
+target_link_libraries(abrt-action-analyze-java ${PC_SATYR_LIBRARIES})
78a2f7
+target_link_libraries(abrt-action-analyze-java ${PC_LIBREPORT_LIBRARIES})
78a2f7
+target_link_libraries(abrt-action-analyze-java ${PC_ABRT_LIBRARIES})
78a2f7
+
78a2f7
+install(TARGETS abrt-action-analyze-java DESTINATION ${BIN_INSTALL_DIR})
78a2f7
diff --git a/utils/abrt-action-analyze-java.c b/utils/abrt-action-analyze-java.c
78a2f7
new file mode 100644
78a2f7
index 0000000..a4728b6
78a2f7
--- /dev/null
78a2f7
+++ b/utils/abrt-action-analyze-java.c
78a2f7
@@ -0,0 +1,258 @@
78a2f7
+/*
78a2f7
+    Copyright (C) 2014  Red Hat, Inc.
78a2f7
+
78a2f7
+    This program is free software; you can redistribute it and/or modify
78a2f7
+    it under the terms of the GNU General Public License as published by
78a2f7
+    the Free Software Foundation; either version 2 of the License, or
78a2f7
+    (at your option) any later version.
78a2f7
+
78a2f7
+    This program is distributed in the hope that it will be useful,
78a2f7
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
78a2f7
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
78a2f7
+    GNU General Public License for more details.
78a2f7
+
78a2f7
+    You should have received a copy of the GNU General Public License along
78a2f7
+    with this program; if not, write to the Free Software Foundation, Inc.,
78a2f7
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
78a2f7
+*/
78a2f7
+
78a2f7
+#include <satyr/location.h>
78a2f7
+#include <satyr/java/stacktrace.h>
78a2f7
+#include <satyr/java/thread.h>
78a2f7
+#include <satyr/java/frame.h>
78a2f7
+
78a2f7
+#include <abrt/libabrt.h>
78a2f7
+#include <stdlib.h>
78a2f7
+
78a2f7
+static char *
78a2f7
+backtrace_from_dump_dir(const char *dir_name)
78a2f7
+{
78a2f7
+    struct dump_dir *dd = dd_opendir(dir_name, DD_OPEN_READONLY);
78a2f7
+    if (NULL == dd)
78a2f7
+    {
78a2f7
+        return NULL;
78a2f7
+    }
78a2f7
+
78a2f7
+    /* Read backtrace */
78a2f7
+    /* Prints an error message if the file cannot be loaded */
78a2f7
+    char *backtrace_str = dd_load_text_ext(dd, FILENAME_BACKTRACE,
78a2f7
+                                           DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE);
78a2f7
+
78a2f7
+    dd_close(dd);
78a2f7
+
78a2f7
+    return backtrace_str;
78a2f7
+}
78a2f7
+
78a2f7
+static void
78a2f7
+write_not_reportable_message_to_dump_dir(const char *dir_name, const char *message)
78a2f7
+{
78a2f7
+    struct dump_dir *dd = dd_opendir(dir_name, /*Open for writing*/0);
78a2f7
+    if (NULL != dd)
78a2f7
+    {
78a2f7
+        dd_save_text(dd, FILENAME_NOT_REPORTABLE, message);
78a2f7
+        dd_close(dd);
78a2f7
+    }
78a2f7
+}
78a2f7
+
78a2f7
+static void
78a2f7
+write_not_reportable_message_to_fd(int fdout, const char *message)
78a2f7
+{
78a2f7
+    full_write(fdout, message, strlen(message));
78a2f7
+    full_write(fdout, "\n", 1);
78a2f7
+}
78a2f7
+
78a2f7
+static void
78a2f7
+write_not_reportable_message_to_file(const char *file_name, const char *message)
78a2f7
+{
78a2f7
+    int fdout = open(file_name,
78a2f7
+            O_WRONLY | O_TRUNC | O_CREAT | O_NOFOLLOW,
78a2f7
+            S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP );
78a2f7
+
78a2f7
+    if (0 > fdout)
78a2f7
+    {
78a2f7
+        perror_msg("Can't open file '%s' for writing", file_name);
78a2f7
+        return;
78a2f7
+    }
78a2f7
+    write_not_reportable_message_to_fd(fdout, message);
78a2f7
+    close(fdout);
78a2f7
+}
78a2f7
+
78a2f7
+static char *
78a2f7
+backtrace_from_fd(int fdin)
78a2f7
+{
78a2f7
+    return xmalloc_read(fdin, /*no size limit*/NULL);
78a2f7
+}
78a2f7
+
78a2f7
+static char *
78a2f7
+backtrace_from_file(const char *file_name)
78a2f7
+{
78a2f7
+    return xmalloc_xopen_read_close(file_name, /*no size limit*/NULL);
78a2f7
+}
78a2f7
+
78a2f7
+typedef void (*frame_cb)(struct sr_java_frame *frame, void *args);
78a2f7
+
78a2f7
+typedef struct {
78a2f7
+    frame_cb callback;
78a2f7
+    void *args;
78a2f7
+} frame_proc_t;
78a2f7
+
78a2f7
+static void
78a2f7
+iterate_trough_stacktrace(struct sr_java_stacktrace *stacktrace, frame_proc_t **fproc)
78a2f7
+{
78a2f7
+    struct sr_java_thread *thread = stacktrace->threads;
78a2f7
+    while (NULL != thread)
78a2f7
+    {
78a2f7
+        struct sr_java_frame *frame = thread->frames;
78a2f7
+        while (NULL != frame)
78a2f7
+        {
78a2f7
+            frame_proc_t **it = fproc;
78a2f7
+            while (NULL != *it)
78a2f7
+            {
78a2f7
+                (*it)->callback(frame, (*it)->args);
78a2f7
+                ++it;
78a2f7
+            }
78a2f7
+            frame = frame->next;
78a2f7
+        }
78a2f7
+        thread = thread->next;
78a2f7
+    }
78a2f7
+}
78a2f7
+
78a2f7
+static void
78a2f7
+work_out_list_of_remote_urls(struct sr_java_frame *frame, struct strbuf *remote_files_csv)
78a2f7
+{
78a2f7
+    if (NULL != frame->class_path && prefixcmp(frame->class_path, "file://") != 0)
78a2f7
+    {
78a2f7
+        struct stat buf;
78a2f7
+        if (stat(frame->class_path, &buf) && errno == ENOENT)
78a2f7
+        {
78a2f7
+            if (strstr(remote_files_csv->buf, frame->class_path) == NULL)
78a2f7
+            {
78a2f7
+                strbuf_append_strf(remote_files_csv, "%s%s",
78a2f7
+                        remote_files_csv->buf[0] != '\0' ? ", " : "",
78a2f7
+                        frame->class_path);
78a2f7
+            }
78a2f7
+        }
78a2f7
+    }
78a2f7
+}
78a2f7
+
78a2f7
+int main(int argc, char *argv[])
78a2f7
+{
78a2f7
+#if ENABLE_NLS
78a2f7
+    /* I18n */
78a2f7
+    setlocale(LC_ALL, "");
78a2f7
+    bindtextdomain(PACKAGE, LOCALEDIR);
78a2f7
+    textdomain(PACKAGE);
78a2f7
+#endif
78a2f7
+
78a2f7
+    abrt_init(argv);
78a2f7
+
78a2f7
+    const char *dump_dir_name = NULL;
78a2f7
+    const char *backtrace_file = NULL;
78a2f7
+
78a2f7
+    /* Can't keep these strings/structs static: _() doesn't support that */
78a2f7
+    const char *program_usage_string = _(
78a2f7
+        "& [[-d DIR] | [-f FILE]] [-o]\n"
78a2f7
+        "\n"
78a2f7
+        "Analyzes Java backtrace\n"
78a2f7
+    );
78a2f7
+    enum {
78a2f7
+        OPT_v = 1 << 0,
78a2f7
+        OPT_d = 1 << 1,
78a2f7
+        OPT_f = 1 << 2,
78a2f7
+        OPT_o = 1 << 3,
78a2f7
+    };
78a2f7
+    /* Keep enum above and order of options below in sync! */
78a2f7
+    struct options program_options[] = {
78a2f7
+        OPT__VERBOSE(&g_verbose),
78a2f7
+        OPT_STRING('d', "dumpdir", &dump_dir_name, "DIR", _("Problem directory")),
78a2f7
+        OPT_STRING('f', "backtrace", &backtrace_file, "FILE", _("Path to backtrace")),
78a2f7
+        OPT_BOOL('o', "stdout", NULL, _("Print results on standard output")),
78a2f7
+        { 0 }
78a2f7
+    };
78a2f7
+    program_options[ARRAY_SIZE(program_options) - 1].type = OPTION_END;
78a2f7
+
78a2f7
+    unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
78a2f7
+
78a2f7
+    export_abrt_envvars(0);
78a2f7
+
78a2f7
+    if (NULL != dump_dir_name && NULL != backtrace_file)
78a2f7
+        error_msg_and_die("You need to pass either DIR or FILE");
78a2f7
+
78a2f7
+    int retval = 1;
78a2f7
+    char *backtrace_str = NULL;
78a2f7
+    if (NULL != dump_dir_name)
78a2f7
+    {
78a2f7
+        backtrace_str = backtrace_from_dump_dir(dump_dir_name);
78a2f7
+    }
78a2f7
+    else if (NULL != backtrace_file)
78a2f7
+    {
78a2f7
+        backtrace_str = backtrace_from_file(backtrace_file);
78a2f7
+    }
78a2f7
+    else
78a2f7
+    {
78a2f7
+        backtrace_str = backtrace_from_fd(STDIN_FILENO);
78a2f7
+    }
78a2f7
+
78a2f7
+    if (NULL == backtrace_str)
78a2f7
+        goto finish;
78a2f7
+
78a2f7
+    struct sr_location location;
78a2f7
+    sr_location_init(&location);
78a2f7
+    const char *backtrace_str_ptr = backtrace_str;
78a2f7
+    struct sr_java_stacktrace *stacktrace = sr_java_stacktrace_parse(&backtrace_str_ptr, &location);
78a2f7
+    free(backtrace_str);
78a2f7
+
78a2f7
+    if (NULL == stacktrace)
78a2f7
+    {
78a2f7
+        error_msg("Could not parse the stack trace");
78a2f7
+        goto finish;
78a2f7
+    }
78a2f7
+
78a2f7
+    struct strbuf *remote_files_csv = strbuf_new();
78a2f7
+    frame_proc_t remote_files_proc = {
78a2f7
+        .callback = (frame_cb)&work_out_list_of_remote_urls,
78a2f7
+        .args = (void *)remote_files_csv
78a2f7
+    };
78a2f7
+
78a2f7
+    frame_proc_t *fproc[] = {
78a2f7
+        &remote_files_proc,
78a2f7
+        //duphash_proc,
78a2f7
+        //backtrace_usability,
78a2f7
+        NULL,
78a2f7
+    };
78a2f7
+
78a2f7
+    iterate_trough_stacktrace(stacktrace, fproc);
78a2f7
+
78a2f7
+    sr_java_stacktrace_free(stacktrace);
78a2f7
+
78a2f7
+    if ('\0' != remote_files_csv->buf[0])
78a2f7
+    {
78a2f7
+        char *not_reportable_message = xasprintf(
78a2f7
+        _("This problem can be caused by a 3rd party code from the "\
78a2f7
+        "jar/class at %s. In order to provide valuable problem " \
78a2f7
+        "reports, ABRT will not allow you to submit this problem. If you " \
78a2f7
+        "still want to participate in solving this problem, please contact " \
78a2f7
+        "the developers directly."), remote_files_csv->buf);
78a2f7
+
78a2f7
+        if (opts & OPT_o)
78a2f7
+        {
78a2f7
+            write_not_reportable_message_to_fd(STDOUT_FILENO,  not_reportable_message);
78a2f7
+        }
78a2f7
+        else if (NULL != dump_dir_name)
78a2f7
+        {
78a2f7
+            write_not_reportable_message_to_dump_dir(dump_dir_name,  not_reportable_message);
78a2f7
+        }
78a2f7
+        else
78a2f7
+        {   /* Just write it to the current working directory */
78a2f7
+            write_not_reportable_message_to_file(FILENAME_NOT_REPORTABLE,  not_reportable_message);
78a2f7
+        }
78a2f7
+
78a2f7
+        free(not_reportable_message);
78a2f7
+    }
78a2f7
+
78a2f7
+    strbuf_free(remote_files_csv);
78a2f7
+    retval = 0;
78a2f7
+finish:
78a2f7
+
78a2f7
+    return retval;
78a2f7
+}
78a2f7
diff --git a/utils/config.h.in b/utils/config.h.in
78a2f7
new file mode 100644
78a2f7
index 0000000..6a26446
78a2f7
--- /dev/null
78a2f7
+++ b/utils/config.h.in
78a2f7
@@ -0,0 +1,2 @@
78a2f7
+#cmakedefine ENABLE_NLS 1
78a2f7
+#cmakedefine HAVE_LOCALE_H 1
78a2f7
-- 
78a2f7
1.8.3.1
78a2f7