[LIBREPORT PATCH 1/2] refactore: get rid of g_hash_table* calls in user_settings
by Jakub Filak
Related to abrt/abrt#594
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/lib/user_settings.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/lib/user_settings.c b/src/lib/user_settings.c
index 58c19af..56387cd 100644
--- a/src/lib/user_settings.c
+++ b/src/lib/user_settings.c
@@ -17,7 +17,7 @@
*/
#include "internal_libreport.h"
-static GHashTable *user_settings;
+static map_string_t *user_settings;
static char *conf_path;
static bool create_parentdir(char *path)
@@ -94,12 +94,8 @@ bool load_user_settings(const char *application_name)
conf_path = get_conf_path(application_name);
if (user_settings)
- g_hash_table_destroy(user_settings);
- user_settings = g_hash_table_new_full(
- /*hash_func*/ g_str_hash,
- /*key_equal_func:*/ g_str_equal,
- /*key_destroy_func:*/ free,
- /*value_destroy_func:*/ free);
+ free_map_string(user_settings);
+ user_settings = new_map_string();
return load_conf_file(conf_path, user_settings, false);
}
@@ -110,9 +106,9 @@ void set_user_setting(const char *name, const char *value)
return;
if (value)
- g_hash_table_replace(user_settings, xstrdup(name), xstrdup(value));
+ replace_map_string_item(user_settings, xstrdup(name), xstrdup(value));
else
- g_hash_table_remove(user_settings, name);
+ remove_map_string_item(user_settings, name);
}
const char *get_user_setting(const char *name)
@@ -120,7 +116,7 @@ const char *get_user_setting(const char *name)
if (!user_settings)
return NULL;
- return g_hash_table_lookup(user_settings, name);
+ return get_map_string_item_or_NULL(user_settings, name);
}
GList *load_forbidden_words(void)
--
1.8.1.4
10 years, 10 months
How to get mock chroot with rpms for a core file?
by Jan Kratochvil
Hi,
as an example for example core file:
https://bugzilla.redhat.com/show_bug.cgi?id=926099#c16
On updated Fedora 18 x86_64 the rpms are too new; but how to get the matching
ones?
I had the best result with:
retrace-server/src/coredump2packages
But still even there GDB wants to load nspr - one of the many failures - but
coredump2packages does not list nspr at all, therefore the system one does not
match.
Tried also darkclient I can generate a list of rpms but then I fail how to
install them:
* yum remote installation does not work as older rpms are only in Koji, not
in Fedora repos.
* yum localinstall for missing dependencies again searches only Fedora repos
and not Koji
* yum never downgrades version to the specified rpm file if a newer rpm is
already installed / available as a dependency.
* rpm -Uvh --oldpackage does not resolve missing dependecies at all, neither
from Fedora repos nor from Koji.
You have something done on the ABRT Retrace Server but how to prepare the same
mock chroot for local core file investigations?
Thanks,
Jan
10 years, 10 months
[ABRT PATCH] spec: always make debuginfo cache setgid
by Martin Milata
libreport relies on the directory being both setuid and setgid since
commit 82ab820df1e407bb91facc351a96bb38598f91f7. Debuginfo download
won't work with any newer libreport if the cache does not have the
setgid bit set.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
abrt.spec.in | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/abrt.spec.in b/abrt.spec.in
index 2573a6f..fec5b56 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -671,16 +671,8 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%{_libexecdir}/abrt-hook-ccpp
-# if fedora < 18 && rhel < 7; then attr(4755 ~= SETUID) ; else attr(6755 ~= SETUID|SETGID); fi
-%if 0%{?fedora} < 18
-%if 0%{?rhel} < 7
-%attr(4755, abrt, abrt) %{_libexecdir}/abrt-action-install-debuginfo-to-abrt-cache
-%else
+# attr(6755) ~= SETUID|SETGID
%attr(6755, abrt, abrt) %{_libexecdir}/abrt-action-install-debuginfo-to-abrt-cache
-%endif
-%else
-%attr(6755, abrt, abrt) %{_libexecdir}/abrt-action-install-debuginfo-to-abrt-cache
-%endif
%{_bindir}/abrt-action-analyze-c
%{_bindir}/abrt-action-trim-files
--
1.7.11.7
10 years, 11 months
[LIBREPORT PATCH] bugzilla: make rhbz_new_bug() more legible
by Jakub Filak
Related to rhbz#963020
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/lib/abrt_xmlrpc.c | 69 ++++++++++++++++++++++++++++++++++++++
src/lib/abrt_xmlrpc.h | 11 ++++++
src/plugins/rhbz.c | 92 +++++++++++++--------------------------------------
3 files changed, 103 insertions(+), 69 deletions(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c
index 545f6b8..b531d25 100644
--- a/src/lib/abrt_xmlrpc.c
+++ b/src/lib/abrt_xmlrpc.c
@@ -141,6 +141,75 @@ xmlrpc_value *abrt_xmlrpc_call_full_va(xmlrpc_env *env, struct abrt_xmlrpc *ax,
return result;
}
+xmlrpc_value *abrt_xmlrpc_array_new(xmlrpc_env *env)
+{
+ xmlrpc_value *params = xmlrpc_array_new(env);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ return params;
+}
+
+void abrt_xmlrpc_array_append_string(xmlrpc_env *env, xmlrpc_value *array, const char *value)
+{
+ xmlrpc_value *val = xmlrpc_string_new(env, value);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ xmlrpc_array_append_item(env, array, val);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ xmlrpc_DECREF(val);
+}
+
+xmlrpc_value *abrt_xmlrpc_params_new(xmlrpc_env *env)
+{
+ xmlrpc_value *params = xmlrpc_struct_new(env);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ return params;
+}
+
+void abrt_xmlrpc_params_add_string(xmlrpc_env *env, xmlrpc_value *params, const char *name, const char *value)
+{
+ xmlrpc_value *val = xmlrpc_string_new(env, value);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ xmlrpc_struct_set_value(env, params, name, val);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ xmlrpc_DECREF(val);
+}
+
+void abrt_xmlrpc_params_add_array(xmlrpc_env *env, xmlrpc_value *params, const char *name, xmlrpc_value *value)
+{
+ xmlrpc_struct_set_value(env, params, name, value);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+}
+
+xmlrpc_value *abrt_xmlrpc_call_params(xmlrpc_env *env, struct abrt_xmlrpc *ax, const char *method, xmlrpc_value *params)
+{
+ xmlrpc_value *array = xmlrpc_array_new(env);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ xmlrpc_array_append_item(env, array, params);
+ if (env->fault_occurred)
+ abrt_xmlrpc_die(env);
+
+ xmlrpc_value *result = NULL;
+ xmlrpc_client_call2(env, ax->ax_client, ax->ax_server_info, method,
+ array, &result);
+
+ xmlrpc_DECREF(array);
+ return result;
+}
+
xmlrpc_value *abrt_xmlrpc_call_full(xmlrpc_env *env, struct abrt_xmlrpc *ax,
const char *method, const char *format, ...)
{
diff --git a/src/lib/abrt_xmlrpc.h b/src/lib/abrt_xmlrpc.h
index 1e1070c..945a887 100644
--- a/src/lib/abrt_xmlrpc.h
+++ b/src/lib/abrt_xmlrpc.h
@@ -35,6 +35,14 @@ struct abrt_xmlrpc {
xmlrpc_server_info *ax_server_info;
};
+xmlrpc_value *abrt_xmlrpc_array_new(xmlrpc_env *env);
+void abrt_xmlrpc_array_append_string(xmlrpc_env *env, xmlrpc_value *array, const char *value);
+
+xmlrpc_value *abrt_xmlrpc_params_new(xmlrpc_env *env);
+void abrt_xmlrpc_params_add_string(xmlrpc_env *env, xmlrpc_value *params, const char *name, const char *value);
+void abrt_xmlrpc_params_add_array(xmlrpc_env *env, xmlrpc_value *params, const char *name, xmlrpc_value *value);
+
+
struct abrt_xmlrpc *abrt_xmlrpc_new_client(const char *url, int ssl_verify);
void abrt_xmlrpc_free_client(struct abrt_xmlrpc *ax);
void abrt_xmlrpc_die(xmlrpc_env *env) __attribute__((noreturn));
@@ -44,6 +52,9 @@ void abrt_xmlrpc_error(xmlrpc_env *env);
xmlrpc_value *abrt_xmlrpc_call(struct abrt_xmlrpc *ax,
const char *method, const char *format, ...);
+xmlrpc_value *abrt_xmlrpc_call_params(xmlrpc_env *env, struct abrt_xmlrpc *ax,
+ const char *method, xmlrpc_value *params);
+
xmlrpc_value *abrt_xmlrpc_call_full(xmlrpc_env *enf, struct abrt_xmlrpc *ax,
const char *method, const char *format, ...);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index 6f81166..2138c5f 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -585,86 +585,40 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax,
buf[3] = '\0';
}
- xmlrpc_value* result = NULL;
char *status_whiteboard = xasprintf("abrt_hash:%s", duphash);
- if (!group)
- {
- if (arch)
- {
- result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:s})",
- "product", product,
- "component", component,
- "version", version,
- "summary", (summary ? summary : bzsummary),
- "description", bzcomment,
- "status_whiteboard", status_whiteboard,
- "platform", arch
- );
- }
- else
- {
- result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s})",
- "product", product,
- "component", component,
- "version", version,
- "summary", (summary ? summary : bzsummary),
- "description", bzcomment,
- "status_whiteboard", status_whiteboard
- );
- }
- }
- else
- {
- xmlrpc_env env;
- xmlrpc_env_init(&env);
+ xmlrpc_env env;
+ xmlrpc_env_init(&env);
- xmlrpc_value *xmlrpc_groups = xmlrpc_array_new(&env);
- if (env.fault_occurred)
- abrt_xmlrpc_die(&env);
+ xmlrpc_value *params = abrt_xmlrpc_params_new(&env);
- for (GList *l = group; l; l = l->next)
- {
- xmlrpc_value *s = xmlrpc_string_new(&env, (char *) l->data);
- if (env.fault_occurred)
- abrt_xmlrpc_die(&env);
+ abrt_xmlrpc_params_add_string(&env, params, "product", product);
+ abrt_xmlrpc_params_add_string(&env, params, "component", component);
+ abrt_xmlrpc_params_add_string(&env, params, "version", version);
+ abrt_xmlrpc_params_add_string(&env, params, "summary", (summary ? summary : bzsummary));
+ abrt_xmlrpc_params_add_string(&env, params, "description", bzcomment);
+ abrt_xmlrpc_params_add_string(&env, params, "status_whiteboard", status_whiteboard);
- xmlrpc_array_append_item(&env, xmlrpc_groups, s);
- if (env.fault_occurred)
- abrt_xmlrpc_die(&env);
+ if(arch)
+ abrt_xmlrpc_params_add_string(&env, params, "platform", arch);
- xmlrpc_DECREF(s);
- }
+ if (group)
+ {
+ xmlrpc_value *xmlrpc_groups = abrt_xmlrpc_array_new(&env);
- if (arch)
- {
- result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:s,s:A})",
- "product", product,
- "component", component,
- "version", version,
- "summary", (summary ? summary : bzsummary),
- "description", bzcomment,
- "status_whiteboard", status_whiteboard,
- "platform", arch,
- "groups", xmlrpc_groups
- );
+ for (GList *l = group; l; l = l->next)
+ abrt_xmlrpc_array_append_string(&env, xmlrpc_groups, l->data);
+
+ abrt_xmlrpc_params_add_array(&env, params, "groups", xmlrpc_groups);
- }
- else
- {
- result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:A})",
- "product", product,
- "component", component,
- "version", version,
- "summary", (summary ? summary : bzsummary),
- "description", bzcomment,
- "status_whiteboard", status_whiteboard,
- "groups", xmlrpc_groups
- );
- }
xmlrpc_DECREF(xmlrpc_groups);
}
+ xmlrpc_value* result = abrt_xmlrpc_call_params(&env, ax, "Bug.create", params);
+
+ xmlrpc_DECREF(params);
+ xmlrpc_env_clean(&env);
+
free(status_whiteboard);
free(summary);
--
1.8.1.4
10 years, 11 months
[ABRT PATCH] testsuite: add test order for el7
by Jakub Filak
We must disable bodhi on RHEL because it is usable only for Fedora
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
tests/helpers/targets/el7/config.sh.local | 1 +
tests/helpers/targets/el7/defs.sh | 2 +-
tests/runtests/aux/test_order.rhel7 | 71 +++++++++++++++++++++++++++++++
3 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 tests/runtests/aux/test_order.rhel7
diff --git a/tests/helpers/targets/el7/config.sh.local b/tests/helpers/targets/el7/config.sh.local
index 7e42624..1798b6f 100644
--- a/tests/helpers/targets/el7/config.sh.local
+++ b/tests/helpers/targets/el7/config.sh.local
@@ -2,6 +2,7 @@
export FORMAT_SCRIPT='aux/scp_format.sh'
export REPORT_SCRIPT='aux/scp_report.sh'
+export TEST_LIST='aux/test_order.rhel7'
export SCPTO='virt_manage@abrt.brq.redhat.com:~/targets/el7/data/'
diff --git a/tests/helpers/targets/el7/defs.sh b/tests/helpers/targets/el7/defs.sh
index facfcbc..149ca09 100644
--- a/tests/helpers/targets/el7/defs.sh
+++ b/tests/helpers/targets/el7/defs.sh
@@ -3,7 +3,7 @@
DATA_DIR=~/targets/el7
VM_NAME='EL7_nightly_run'
REPO='git://abrt.brq.redhat.com/abrt.git'
-OS_VARIANT='rhel6'
+OS_VARIANT='rhel7'
KS_NAME_PREFIX='brq_el7'
LOC='http://download.englab.brq.redhat.com/pub/rhel/nightly/latest-RHEL-7/comp...'
DISK=$( echo /dev/mapper/*el7_vm )
diff --git a/tests/runtests/aux/test_order.rhel7 b/tests/runtests/aux/test_order.rhel7
new file mode 100644
index 0000000..33d852b
--- /dev/null
+++ b/tests/runtests/aux/test_order.rhel7
@@ -0,0 +1,71 @@
+# Order of the tests
+# ------------------
+# - basic build/install tests
+# abrt-nightly-build
+# run-abrtd
+
+# abrt-make-check
+# btparser-make-check
+# libreport-make-check
+
+# - core
+abrtd-directories
+dbus-message
+socket-api
+abrtd-inotify-flood
+symlinks-rhbz-895442
+
+# - addons
+ccpp-plugin
+ccpp-plugin-java
+ccpp-plugin-config
+python-addon
+
+# - tools tests
+cli-sanity
+cli-status
+check-hook-install
+dumpoops
+dumpxorg
+dbus-api
+dbus-NewProblem
+dbus-elements-handling
+#bodhi
+oops-processing
+abrt-python
+
+# - reporting tests
+bugzilla-bt-reattach
+bugzilla-dupe-search
+bugzilla-comment-format
+
+rhts-test
+
+mailx-reporting
+localized-reporting
+verify-that-report-edits
+upload-scp
+upload-ftp
+upload-filename
+upload-handling
+ureport
+
+blacklisted-package
+blacklisted-path
+dont-blame-interpret
+abrt-should-return-rating-0-on-fail
+
+bz591504-sparse-core-files-performance-hit
+bz618602-core_pattern-handler-truncates-parameters
+bz636913-abrt-should-ignore-SystemExit-exception
+bz652338-removed-proc-PID
+bz783450-setuid-core-owned-by-root
+
+systemd-init
+
+uefioops
+
+# - more or less destructive tests
+
+# - outdated tests
+#bz623142-abrt-should-not-report-bugs-against-systems-with-TAINT_HARDWARE_UNSUPPORTED-set
--
1.8.1.4
10 years, 11 months
[ABRT PATCH 1/3 v2] Move get_problems_count() to its only user - "abrt-cli status"
by Denys Vlasenko
Logic is not changed.
Related to #659.
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
src/cli/status.c | 49 +++++++++++++++++++++++++++++++++++++++++++----
src/include/problem_api.h | 8 --------
src/lib/problem_api.c | 38 ------------------------------------
3 files changed, 45 insertions(+), 50 deletions(-)
diff --git a/src/cli/status.c b/src/cli/status.c
index 6f228c6..0dbcd1d 100644
--- a/src/cli/status.c
+++ b/src/cli/status.c
@@ -21,13 +21,52 @@
#include <sys/types.h>
#include "problem_api.h"
+struct time_range {
+ unsigned count;
+ unsigned long since;
+};
+
+static int count_dir_if_newer_than(struct dump_dir *dd, void *arg)
+{
+ struct time_range *me = arg;
+
+ char *time_str = dd_load_text(dd, FILENAME_LAST_OCCURRENCE);
+ long val = atol(time_str);
+ free(time_str);
+ if (val < me->since)
+ return 0;
+
+ me->count++;
+ return 0;
+}
+
+static void count_problems_in_dir(gpointer data, gpointer arg)
+{
+ char *path = data;
+ struct time_range *me = arg;
+
+ VERB2 log("scanning '%s' for problems since %lu", path, me->since);
+
+ for_each_problem_in_dir(path, getuid(), count_dir_if_newer_than, me);
+}
+
+static unsigned int count_problem_dirs(GList *paths, unsigned long since)
+{
+ struct time_range me;
+ me.count = 0;
+ me.since = since;
+
+ g_list_foreach(paths, count_problems_in_dir, &me);
+
+ return me.count;
+}
+
int cmd_status(int argc, const char **argv)
{
const char *program_usage_string = _(
"& status [DIR]..."
);
-
bool opt_bare = false;
int opt_since = 0;
@@ -45,8 +84,12 @@ int cmd_status(int argc, const char **argv)
GList *problem_dir_list = NULL;
while (*argv)
problem_dir_list = g_list_append(problem_dir_list, xstrdup(*argv++));
+ if (!problem_dir_list)
+ problem_dir_list = get_problem_storages();
+
+ unsigned int problem_count = count_problem_dirs(problem_dir_list, opt_since);
- unsigned int problem_count = get_problems_count(problem_dir_list, opt_since);
+ list_free_with_free(problem_dir_list);
/* show only if there is at least 1 problem or user set the -v */
if (problem_count > 0 || g_verbose > 0)
@@ -57,7 +100,5 @@ int cmd_status(int argc, const char **argv)
printf(_("ABRT has detected '%u' problem(s). (For more info run: $ abrt-cli list --full)\n"), problem_count);
}
- list_free_with_free(problem_dir_list);
-
return 0;
}
diff --git a/src/include/problem_api.h b/src/include/problem_api.h
index 803ec32..b8b6617 100644
--- a/src/include/problem_api.h
+++ b/src/include/problem_api.h
@@ -37,11 +37,3 @@ GList *get_problem_dirs_for_element_in_time(uid_t uid,
unsigned long timestamp_from,
unsigned long timestamp_to,
const char *dump_location);
-
-/* Counts all problems in given directories
- *
- * @paths[in] list of paths to scan (pass NULL to use the default problem directories)
- * @since[in]
- * @returns count of problems
- */
-unsigned int get_problems_count(GList *paths, unsigned long since);
diff --git a/src/lib/problem_api.c b/src/lib/problem_api.c
index 894b725..2cd3336 100644
--- a/src/lib/problem_api.c
+++ b/src/lib/problem_api.c
@@ -166,41 +166,3 @@ GList *get_problem_storages(void)
return pths;
}
-
-/* get_problems_count and its helpers */
-
-typedef struct problem_count_info {
- int problem_count;
- unsigned long since;
- unsigned long until;
-} problem_count_info_t;
-
-static void count_problems_in_dir(char *path, gpointer problem_counter)
-{
- problem_count_info_t *pci = (problem_count_info_t *)problem_counter;
- VERB2 log("scanning '%s' for problems since %lu", path, pci->since);
- GList *problems = get_problem_dirs_for_element_in_time(getuid(), NULL /*don't filter by element*/, NULL, pci->since, pci->until, path);
- pci->problem_count += g_list_length(problems);
- list_free_with_free(problems);
-}
-
-unsigned int get_problems_count(GList *paths, unsigned long since)
-{
- GList *pths = NULL;
-
- if (paths == NULL)
- {
- paths = pths = get_problem_storages();
- }
-
- problem_count_info_t pci;
- pci.problem_count = 0;
- pci.since = since;
- pci.until = time(NULL);
-
- g_list_foreach(paths, (GFunc)count_problems_in_dir, &pci);
-
- list_free_with_free(pths);
-
- return pci.problem_count;
-}
--
1.8.1.4
10 years, 11 months
[SATYR PATCH 0/5] Short text backtraces a.k.a. optimized thread generators
by Martin Milata
Github ticket: https://github.com/abrt/satyr/issues/64
I decided to implement functions that return the text representation directly
instead of returning the modified thread. That functionality (optimized
threads) was originally intended to be used for thread comparisons and I
believe that returning the text directly is more convenient for the satyr user.
Martin Milata (5):
Refactor optimized GDB thread generation
Short text representation for python stacktraces
Short text representation for koops traces
Short text representation for java stacktraces
Short text representation for core stacktraces
lib/core_frame.c | 20 ++++++++++++++
lib/core_frame.h | 7 +++++
lib/core_stacktrace.c | 28 +++++++++++++++++++
lib/core_stacktrace.h | 8 ++++++
lib/gdb_frame.c | 2 --
lib/gdb_stacktrace.c | 64 ++++++++-----------------------------------
lib/gdb_stacktrace.h | 20 ++++++--------
lib/gdb_thread.c | 64 ++++++++++++++++++++++++++++++++++++++++++-
lib/gdb_thread.h | 15 ++++++++++
lib/java_stacktrace.c | 29 ++++++++++++++++++++
lib/java_stacktrace.h | 8 ++++++
lib/koops_frame.c | 12 ++++++++
lib/koops_frame.h | 9 ++++++
lib/koops_stacktrace.c | 22 +++++++++++++++
lib/koops_stacktrace.h | 8 ++++++
lib/python_frame.c | 23 ++++++++++++++++
lib/python_frame.h | 8 ++++++
lib/python_stacktrace.c | 22 +++++++++++++++
lib/python_stacktrace.h | 8 ++++++
python/py_gdb_stacktrace.c | 33 ++++++++++------------
python/py_gdb_stacktrace.h | 2 +-
python/py_java_stacktrace.c | 27 ++++++++++++++++++
python/py_java_stacktrace.h | 1 +
python/py_koops_stacktrace.c | 27 ++++++++++++++++++
python/py_koops_stacktrace.h | 1 +
python/py_python_stacktrace.c | 29 +++++++++++++++++++-
python/py_python_stacktrace.h | 1 +
tests/python/gdb.py | 11 ++++++++
tests/python/java.py | 13 +++++++++
tests/python/koops.py | 11 ++++++++
tests/python/python.py | 10 +++++++
31 files changed, 456 insertions(+), 87 deletions(-)
--
1.7.11.7
10 years, 11 months
[BTPARSER PATCH] Fix SEGV when looking for crash frame in empty thread
by Martin Milata
btp_backtrace_get_crash_frame tries to duplicate a frame which is not
there. Fixes rhbz#903140.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
lib/frame.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/frame.c b/lib/frame.c
index 87e9bb5..83da36d 100644
--- a/lib/frame.c
+++ b/lib/frame.c
@@ -66,6 +66,9 @@ btp_frame_free(struct btp_frame *frame)
struct btp_frame *
btp_frame_dup(struct btp_frame *frame, bool siblings)
{
+ if (!frame)
+ return NULL;
+
struct btp_frame *result = btp_frame_new();
memcpy(result, frame, sizeof(struct btp_frame));
--
1.7.11.7
10 years, 11 months
[ABRT PATCH 1/2] a-a-a-vmcore: save kernel version in 'kernel' file
by Jakub Filak
Related to rhbz#921949
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/plugins/abrt-action-analyze-vmcore.in | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/plugins/abrt-action-analyze-vmcore.in b/src/plugins/abrt-action-analyze-vmcore.in
index c3f2e2e..c78ba03 100644
--- a/src/plugins/abrt-action-analyze-vmcore.in
+++ b/src/plugins/abrt-action-analyze-vmcore.in
@@ -131,3 +131,27 @@ if __name__ == "__main__":
backtrace_file = open("backtrace", "w")
dump_oops = Popen(["abrt-dump-oops", "-o", "kernel_log"], stdout=backtrace_file, bufsize=-1)
backtrace_file.close()
+
+ ret = dump_oops.wait()
+ if ret != RETURN_OK:
+ sys.exit(ret)
+
+ ret = RETURN_FAILURE
+ # Save kernel version in 'kernel' file (FILENAME_KERNEL)
+ # The code below expects that abrt-dump-oops generates file in the following format:
+ # <empty line>
+ # Version: 3.8.5-201.fc18.x86_64
+ # <oops data>
+ # <EOF>
+ with open("backtrace", "r") as backtrace_file:
+ for line in backtrace_file:
+ # Please excuse the magic constant 9 => len('Version: '). This construction is more readable for me.
+ if line[:9] == "Version: ":
+ with open("kernel", "w") as kernel_file:
+ kernel_file.write(line[9:].rstrip())
+ ret = RETURN_OK # set OK only if it was successfully written
+ break # break the loop, we support only one oops per vmcore
+ if ret != RETURN_OK:
+ print _("Garbled abrt-dump-oops output format. Can't find kernel version.");
+
+ sys.exit(ret)
--
1.8.1.4
10 years, 11 months