[PATCH] Retrace Server RPM
by Michal Toman
Hi,
the current Retrace Server RPM is broken, here's the patch to make it
work properly. I have never packaged anything, there may be something
wrong. Please review.
Michal
13 years, 3 months
oops report lost (Was: kerneloops.org dns problem)
by Bernie Innocenti
On Mon, 2011-03-21 at 23:32 -0400, Bernie Innocenti wrote:
> Hello Arjan,
>
> are you the admin contact for kerneloops.org? There seem to be an issue
> resolving submit.kerneloops.org using one of the authoritative
> nameservers:
Additionally, after hacking my /etc/hosts, I successfully reported the
following oops, but I can't find any evidence of it on
www.kerneloops.org.
The abrt-gui interface told me that the oops was filed correctly, but
did not return a reference ID.
general protection fault: 0000 [#1] SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:1a.0/usb1/idVendor
CPU 0
Modules linked in: pl2303 hidp fuse usb_storage rfcomm sco bnep l2cap vboxnetadp vboxnetflt vboxdrv coretemp ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf kvm_intel kvm uinput qcserial usb_wwan arc4 i2400m_usb i2400m ecb wimax snd_hda_codec_intelhdmi btusb bluetooth usbserial snd_hda_codec_conexant iwlagn snd_hda_intel snd_hda_codec snd_hwdep snd_seq iwlcore snd_seq_device snd_pcm mac80211 thinkpad_acpi cfg80211 snd_timer e1000e snd snd_page_alloc joydev iTCO_wdt i2c_i801 wmi iTCO_vendor_support rfkill microcode soundcore i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: scsi_wait_scan]
Pid: 2080, comm: kslowd002 Not tainted 2.6.35.11-83.fc14.x86_64 #1 3249CTO/3249CTO
RIP: 0010:[<ffffffff812266a0>] [<ffffffff812266a0>] list_del+0x10/0x8b
RSP: 0018:ffff88012d9cfc90 EFLAGS: 00010286
RAX: dead000000200200 RBX: ffff88008d8b09c8 RCX: ffff880130648000
RDX: 0000000000000000 RSI: ffff88012d9cfff8 RDI: ffff88008d8b09c8
RBP: ffff88012d9cfca0 R08: ffff88012d9cfb5c R09: ffffffff8100aae0
R10: ffff8801ad9cf98f R11: 0000000000000000 R12: ffff88012fd27800
R13: ffff88012fd25000 R14: ffffffffa009ea10 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff880002000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f2168285018 CR3: 0000000132253000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kslowd002 (pid: 2080, threadinfo ffff88012d9ce000, task ffff880130648000)
Stack:
ffff88012fd27800 ffff88008d8b09c0 ffff88012d9cfcf0 ffffffffa0035425
<0> 0000000000000000 0000000000000001 ffff88012fd27800 ffff88012fd27800
<0> 0000000000000000 ffff88012fd27a68 ffffffffa009ea10 0000000000000438
Call Trace:
[<ffffffffa0035425>] drm_mode_connector_update_edid_property+0x3f/0xf3 [drm]
[<ffffffffa0067c40>] drm_helper_probe_single_connector_modes+0x110/0x29d [drm_kms_helper]
[<ffffffffa00654e5>] drm_fb_helper_probe_connector_modes+0x47/0x5f [drm_kms_helper]
[<ffffffffa0066756>] drm_fb_helper_hotplug_event+0xac/0xc9 [drm_kms_helper]
[<ffffffffa0094888>] intel_fb_output_poll_changed+0x1c/0x20 [i915]
[<ffffffffa006757b>] output_poll_execute+0xf2/0x12e [drm_kms_helper]
[<ffffffff810c9f1b>] slow_work_execute+0x1a2/0x2cc
[<ffffffff810ca3c5>] slow_work_thread+0x173/0x2a4
[<ffffffff81066633>] ? autoremove_wake_function+0x0/0x39
[<ffffffff81469fcf>] ? _raw_spin_unlock_irqrestore+0x17/0x19
[<ffffffff810ca252>] ? slow_work_thread+0x0/0x2a4
[<ffffffff81066199>] kthread+0x7f/0x87
[<ffffffff8100aae4>] kernel_thread_helper+0x4/0x10
[<ffffffff8106611a>] ? kthread+0x0/0x87
[<ffffffff8100aae0>] ? kernel_thread_helper+0x0/0x10
Code: 00 00 00 74 05 e8 8b 74 e2 ff 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f c9 c3 90 90 55 48 89 e5 53 48 89 fb 48 83 ec 08 48 8b 47 08 <4c> 8b 00 49 39 f8 74 1d 48 89 f9 48 c7 c2 fb 18 7b 81 be 30 00
RIP [<ffffffff812266a0>] list_del+0x10/0x8b
RSP <ffff88012d9cfc90>
--
// Bernie Innocenti - http://codewiz.org/
\X/ Sugar Labs - http://sugarlabs.org/
13 years, 3 months
[PATCH] parse and store 'allow-empty' value
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/include/report/event_config.h | 1 +
src/lib/event_xml_parser.c | 13 ++++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h
index cc6c15b..12beefe 100644
--- a/src/include/report/event_config.h
+++ b/src/include/report/event_config.h
@@ -52,6 +52,7 @@ typedef struct
char *value;
char *label;
option_type_t type;
+ int allow_empty;
//char *description; //can be used as tooltip in gtk app
//char *allowed_value;
//int required;
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
index 9277aea..7432913 100644
--- a/src/lib/event_xml_parser.c
+++ b/src/lib/event_xml_parser.c
@@ -64,7 +64,8 @@ static void consume_cur_option(struct my_parse_data *parse_data)
}
event_config_t *event_config = parse_data->event_config;
- GList *elem = g_list_find_custom(event_config->options, opt->name, &cmp_event_option_name_with_string);
+ GList *elem = g_list_find_custom(event_config->options, opt->name,
+ &cmp_event_option_name_with_string);
if (elem)
{
/* we already have option with such name */
@@ -111,8 +112,7 @@ static void start_element(GMarkupParseContext *context,
event_option_t *opt = parse_data->cur_option = new_event_option();
- int i;
- for (i = 0; attribute_names[i] != NULL; ++i)
+ for (int i = 0; attribute_names[i] != NULL; ++i)
{
VERB2 log("attr: %s:%s", attribute_names[i], attribute_values[i]);
if (strcmp(attribute_names[i], "name") == 0)
@@ -187,6 +187,13 @@ static void text(GMarkupParseContext *context,
opt->value = text_copy;
return;
}
+
+ if (strcmp(inner_element, ALLOW_EMPTY_ELEMENT) == 0)
+ {
+ VERB2 log("allow-empty:'%s'", text_copy);
+ opt->allow_empty = string_to_bool(text_copy);
+ return;
+ }
/*
if (strcmp(inner_element, DESCRIPTION_ELEMENT) == 0)
{
--
1.7.1
13 years, 3 months
Re: abrt2 problemy a nejasnosti
by Jiri Moskovcak
Wow, what a list! :) Will try to answer what I can and CCing the rest of
the team so they can help with answers.
On 03/16/2011 12:24 PM, Michal Nowak wrote:
> Cau,
>
> pri adaptaci fedoriho test daye na F15 a ABRT2 jsem narazil
> na nekolik problemu/odlisnosti od verze 1.1.
>
> Testoval jsem to vcerejsim dopolednim buildu, takze mozna
> neco uz bude opravene.
>
> 1) strace je na blacklistu, ale nenapada me proc. Jestli to
> bylo kvuli tomu, ze kdyz spadl program, ktery byl tracovany,
> tak strace se ukoncila s taky s coredumpem, tak mu prijde, ze
> tohle chovani se zmenilo: `strace sleep 3m`; kdyz sundam sleep,
> tak ABRT zachyti crash v coreutils.
- don't remember, but it was because of the strace maintainer wanted it
>
> 2) Pri testovani kerneloops jsem narazil na tohle: Kdyz se do
> /var/log/messages prida "cut_here.test" z Gitu, tak se ABRT
> zacykli a zamyka a odemyka adresar.
- sounds like a bug, need to test it
>
> 3) Kdyz selze autentizace pri pokusu o analyzovani v Retrace
> Serveru (v GUI), tak wizard dovoli pokracovani.
- wizard shouldn't allow user to continue if analyze action finishes
with exit code != 0
>
> 4) Nekolikrat se mi stalo, ze Logger nezalogoval do
> /var/log/abrt.log (v GUI se vsechno zdalo OK, ale soubor
> neexistoval.
- the default path is wrong and user doesn't have permission to write
there..
>
> 5) Kdyz se da oops1.test do /var/log/messages, tak se OOPS
> najde, kdyz se ale pak smaze, tak se zase "najde", asi tam
> chybi nejaka zarazka (nebo jich tam je vic...).
>
- hm, kerneloops plugin should use some marker and shouldn't find the
same crash again..
> 6) Seznam problemu v GUI se neaktualizuje automaticky. Napr.
> kdyz mam otevrene GUI a prijde nejaky pak, tak se to v novem
> GUI neprojevi, ve starem jo.
>
- known bug, gui needs to watch the dump directories, it's in our TODO
> 7) "Enabled = no" v CCpp.conf (i jinde) nefunguje, jak bych
> cekal, crashe se porad nachazeji.
>
- this is obsolete and should be removed from the config files
> 8) Koukal jsem do ruznych konfiguraku v /etc/abrt a prijde mi,
> ze LogPath u Loggeru je definovana aspon na trech mistech, tak
> nevim, ktere je to "hlavni". Je to matouci.
>
- yes, we should have only one default config and we should provide some
docs about the other non default places...
> 9) 'cmdline' u pythoni vyjimky je v review casti u GUI prazdna.
>
- shouldn't be, that's probably a bug
> 10) Uzivatel nemuze zapisovat do /var/log/abrt.log, coz je zmena
> oproti ABRT 1.1 a prijde mi, ze Logger pak pro nej vubec nefunguje
> (Permission denied).
>
- this is actually a correct behaviour, only the path shouldn't be
/var/log/abrt.log
> 11) Podpora pro Mailx neni kompletni, chybi tam nejaky event, ktery
> by ten plugin zprovoznoval.
>
- yes, Mailx needs an event config file
> 12) Kdyz se povoli sosreport v abrt_event.conf, tak uzivatel nema
> prava k takovemu souboru a nepodari se mu (minimalne pres GUI)
> ten problem nikam zahlasit (Permission denied na sosreport.tar).
>
- known bug
> 13) Edit> Preferences nic nedela.
- I know, this is just a stub and will be removed in Fedora build
>
> 14) "Tecka" v prvnim sloupci GUI se u uzivatele nikdy nezmeni z
> cervene na zelenou, i kdyz je bug zareportovan. Pro roota to
> funguje.
>
- sounds like a bug
> 15) `abrt-cli -l` pro uzivatele nefunguje (root je OK), nezobrazi
> nic - ani reportovane, ani nereportovane. `abrt-cli -l -f` zobrazi
> vsechny.
>
- sounds like a bug, do you have any crashes owned by the user who runs
the abrt-cli?
> 16) V abrt-cli u uzivatele se nedeje zadna analyza, ale CLI ten
> problem v klidu odesle bez backtrace za to s corefile. BZ#687916
>
- bug
> 17) Bugzilli plug-in se uz nepta na login/heslo, kdyz je ve
> wizardu vybrany, reportovani tak v poslednim okne zdechne.
>
- known bug, it's in our TODO
> 18) Edit> Plugin> BZ neuklada do g-keyringu.
>
- this should work since Monday 14.3.2011 ;)
> 19) V GUI je dvakrat akcelerator pro "O" (Open a Online Help).
> Chova se to pak divne pri "Alt-O". Co takhle "Online _Help"?
>
- will change it
> 20) Kdyz si pustim `abrtd -dvvv` manualne, tak po tom, co se
> postara o crash, vyplivne GLib-CRITICAL a nejaky problem s
> hashovaci tabulkou, podle te hlasky to leze z procesu abrtd.
>
- sounds like a bug
> 21) Uzivatel neni upozornen na kernel OOPS, v ABRT 1.1 to tak
> myslim bylo, ale mozna se spletu.
>
- sounds like a bug we need to test oopses more
> 22) Whiteboard pole v BZ obsahuje prazdny hash: abrt_hash:(null)
> Coz by byl problem pro kontrolu duplicity.
- that sounds like a bug in bz plugin
- btw, it would be much easier if you write in English and send emails
like this directly to our ml ;)
Thank you,
Jirka
13 years, 3 months
[PATCH] Replace FILENAME_MESSAGE with FILENAME_REPORTED_TO
by Denys Vlasenko
This fixes the problem with abrt-cli not showing unreported bugs
and abrt-gui not showing "green lamp" for reported bugs.
In general, it introduces a way to record reporting results,
such as Bugzilla URL, in dump dir.
In the future, this enables such functions as "check BZ status".
Now, the reporter event should put a line into "reported_to"
element, if it considers its reporting to be successful.
Example:
Bugzilla: URL=https://bugzilla.redhat.com/show_bug.cgi?id=688129
--
vda
diff --git a/src/cli/cli.c b/src/cli/cli.c
index 49c0827..7a89ef3 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -121,8 +121,8 @@ static void print_crash_list(vector_of_crash_data_t *crash_list, bool include_re
crash_data_t *crash = get_crash_data(crash_list, i);
if (!include_reported)
{
- const char *msg = get_crash_item_content_or_NULL(crash, FILENAME_MESSAGE);
- if (!msg || !msg[0])
+ const char *msg = get_crash_item_content_or_NULL(crash, FILENAME_REPORTED_TO);
+ if (msg)
continue;
}
diff --git a/src/cli/report.cpp b/src/cli/report.cpp
index 05f0b11..4391bfb 100644
--- a/src/cli/report.cpp
+++ b/src/cli/report.cpp
@@ -508,8 +508,6 @@ static int run_events(const char *dump_dir_name,
GList *env_list = NULL;
// Run events
- bool at_least_one_reporter_succeeded = false;
- std::string message;
struct logging_state l_state;
l_state.last_line = NULL;
struct run_event_state *run_state = new_run_event_state();
@@ -530,11 +528,7 @@ static int run_events(const char *dump_dir_name,
}
if (r == 0)
{
- at_least_one_reporter_succeeded = true;
printf("%s: %s\n", event.c_str(), (l_state.last_line ? : "Reporting succeeded"));
- if (message != "")
- message += ";";
- message += (l_state.last_line ? : "Reporting succeeded");
}
else
{
@@ -553,17 +547,6 @@ static int run_events(const char *dump_dir_name,
}
free_run_event_state(run_state);
- // Save reporting results
- if (at_least_one_reporter_succeeded)
- {
- struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
- if (dd)
- {
- dd_save_text(dd, FILENAME_MESSAGE, message.c_str());
- dd_close(dd);
- }
- }
-
return error_cnt;
}
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp
index a4503b5..77e18b0 100644
--- a/src/daemon/MiddleWare.cpp
+++ b/src/daemon/MiddleWare.cpp
@@ -376,7 +376,7 @@ report_status_t Report(crash_data_t *client_report,
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
if (dd)
{
- dd_save_text(dd, FILENAME_MESSAGE, message.c_str());
+ add_reported_to(dd, message.c_str());
dd_close(dd);
}
}
diff --git a/src/gui-gtk/abrt-gtk.c b/src/gui-gtk/abrt-gtk.c
index 4598468..4a921aa 100644
--- a/src/gui-gtk/abrt-gtk.c
+++ b/src/gui-gtk/abrt-gtk.c
@@ -54,7 +54,7 @@ void add_directory_to_dirlist(const char *dirname)
size_t time_len = strftime(time_buf, sizeof(time_buf)-1, "%c", ptm);
time_buf[time_len] = '\0';
- char *msg = dd_load_text_ext(dd, FILENAME_MESSAGE, 0
+ char *msg = dd_load_text_ext(dd, FILENAME_REPORTED_TO, 0
| DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE
| DD_FAIL_QUIETLY_ENOENT
| DD_FAIL_QUIETLY_EACCES
diff --git a/src/include/abrt_crash_data.h b/src/include/abrt_crash_data.h
index 5a03f39..93fcb1f 100644
--- a/src/include/abrt_crash_data.h
+++ b/src/include/abrt_crash_data.h
@@ -61,7 +61,13 @@
#define FILENAME_UUID "uuid"
#define FILENAME_INFORMALL "inform_all_users"
#define FILENAME_COUNT "count"
-#define FILENAME_MESSAGE "message"
+/* Multi-line list of places problem was reported.
+ * Recommended line format:
+ * "Reporter: VAR=VAL VAR=VAL"
+ * Use add_reported_to(dd, "line_without_newline"): it adds line
+ * only if it is not already there.
+ */
+#define FILENAME_REPORTED_TO "reported_to"
#define FILENAME_EVENT_LOG "event_log"
// Not stored as files, added "on the fly":
#define CD_DUMPDIR "DumpDir"
@@ -81,6 +87,9 @@ enum {
extern "C" {
#endif
+#define add_reported_to abrt_add_reported_to
+void add_reported_to(struct dump_dir *dd, const char *line);
+
#define log_crash_data abrt_log_crash_data
void log_crash_data(crash_data_t *crash_data, const char *pfx);
diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c
index fefec60..045149a 100644
--- a/src/lib/dump_dir.c
+++ b/src/lib/dump_dir.c
@@ -731,6 +731,37 @@ void dd_save_binary(struct dump_dir* dd, const char* name, const char* data, uns
free(full_path);
}
+void add_reported_to(struct dump_dir *dd, const char *line)
+{
+ if (!dd->locked)
+ error_msg_and_die("dump_dir is not opened"); /* bug */
+
+ char *reported_to = dd_load_text_ext(dd, FILENAME_REPORTED_TO, DD_FAIL_QUIETLY_ENOENT | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE);
+ if (reported_to)
+ {
+ unsigned len_line = strlen(line);
+ char *p = reported_to;
+ while (*p)
+ {
+ if (strncmp(p, line, len_line) == 0 && (p[len_line] == '\n' || p[len_line] == '\0'))
+ goto ret;
+ p = strchrnul(p, '\n');
+ if (!*p)
+ break;
+ p++;
+ }
+ if (p != reported_to && p[-1] != '\n')
+ reported_to = append_to_malloced_string(reported_to, "\n");
+ reported_to = append_to_malloced_string(reported_to, line);
+ reported_to = append_to_malloced_string(reported_to, "\n");
+ }
+ else
+ reported_to = xasprintf("%s\n", line);
+ dd_save_text(dd, FILENAME_REPORTED_TO, reported_to);
+ ret:
+ free(reported_to);
+}
+
DIR *dd_init_next_file(struct dump_dir *dd)
{
// if (!dd->locked)
diff --git a/src/lib/make_descr.c b/src/lib/make_descr.c
index 08c9bca..bd21518 100644
--- a/src/lib/make_descr.c
+++ b/src/lib/make_descr.c
@@ -66,7 +66,6 @@ static const char *const blacklisted_items[] = {
FILENAME_INFORMALL,
CD_DUMPDIR ,
FILENAME_COUNT ,
- FILENAME_MESSAGE ,
NULL
};
diff --git a/src/plugins/abrt-action-bugzilla.cpp b/src/plugins/abrt-action-bugzilla.cpp
index b24d8c3..79e83b3 100644
--- a/src/plugins/abrt-action-bugzilla.cpp
+++ b/src/plugins/abrt-action-bugzilla.cpp
@@ -861,7 +861,7 @@ static void report_to_bugzilla(
free(dsc);
- bool is_priv = is_private && (is_private[0] == '1');
+ bool is_priv = is_private && string_to_bool(is_private);
if (bz_server.add_comment(bug_id, full_dsc, is_priv) == -1)
{
free(full_dsc);
@@ -883,6 +883,15 @@ static void report_to_bugzilla(
(int)bug_id
);
+ dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
+ if (dd)
+ {
+ char *msg = xasprintf("Bugzilla: URL=%s/show_bug.cgi?id=%u", bugzilla_url, (int)bug_id);
+ add_reported_to(dd, msg);
+ free(msg);
+ dd_close(dd);
+ }
+
free_crash_data(crash_data);
bug_info_destroy(&bz);
}
diff --git a/src/plugins/abrt-action-rhtsupport.c b/src/plugins/abrt-action-rhtsupport.c
index 94523e0..d7f93ea 100644
--- a/src/plugins/abrt-action-rhtsupport.c
+++ b/src/plugins/abrt-action-rhtsupport.c
@@ -128,7 +128,6 @@ static void report_to_rhtsupport(
if (strcmp(name, FILENAME_COUNT) == 0) continue;
if (strcmp(name, CD_DUMPDIR) == 0) continue;
if (strcmp(name, FILENAME_INFORMALL) == 0) continue;
- if (strcmp(name, FILENAME_MESSAGE) == 0) continue; // plugin's status message (if we already reported it yesterday)
const char *content = value->content;
if (value->flags & CD_FLAG_TXT)
diff --git a/src/plugins/abrt-action-upload.c b/src/plugins/abrt-action-upload.c
index 88380bd..8556e14 100644
--- a/src/plugins/abrt-action-upload.c
+++ b/src/plugins/abrt-action-upload.c
@@ -160,7 +160,6 @@ static int create_and_upload_archive(
if (strcmp(short_name, FILENAME_COUNT) == 0) goto next;
if (strcmp(short_name, CD_DUMPDIR) == 0) goto next;
if (strcmp(short_name, FILENAME_INFORMALL) == 0) goto next;
- if (strcmp(short_name, FILENAME_MESSAGE) == 0) goto next; // plugin's status message (if we already reported it yesterday)
// dd_get_next_file guarantees this:
//struct stat stbuf;
//if (stat(full_name, &stbuf) != 0)
13 years, 3 months
[PATCH] expose export/unexport_event_config
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/gui-wizard-gtk/wizard.c | 34 ----------------------------------
src/include/report/event_config.h | 12 ++++++++++++
src/lib/event_config.c | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 34 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 07ebcb5..31c7bb2 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -619,40 +619,6 @@ enum {
LOGSTATE_MIDLINE,
};
-static GList *export_event_config(const char *event_name)
-{
- GList *env_list = NULL;
-
- event_config_t *config = get_event_config(event_name);
- if (config)
- {
- for (GList *lopt = config->options; lopt; lopt = lopt->next)
- {
- event_option_t *opt = lopt->data;
- if (!opt->value)
- continue;
- char *var_val = xasprintf("%s=%s", opt->name, opt->value);
- VERB3 log("Exporting '%s'", var_val);
- env_list = g_list_prepend(env_list, var_val);
- putenv(var_val);
- }
- }
-
- return env_list;
-}
-
-static void unexport_event_config(GList *env_list)
-{
- while (env_list)
- {
- char *var_val = env_list->data;
-VERB3 log("Unexporting '%s'", var_val);
- safe_unsetenv(var_val);
- env_list = g_list_remove(env_list, var_val);
- free(var_val);
- }
-}
-
static int spawn_next_command_in_evd(struct analyze_event_data *evd)
{
evd->env_list = export_event_config(evd->event_name);
diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h
index 75f357d..cc6c15b 100644
--- a/src/include/report/event_config.h
+++ b/src/include/report/event_config.h
@@ -21,6 +21,11 @@
#ifndef EVENT_CONFIG_H
#define EVENT_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum
{
OPTION_TYPE_TEXT,
@@ -80,4 +85,11 @@ event_option_t *get_event_option_from_list(const char *option_name, GList *event
extern GHashTable *g_event_config_list; // for iterating through entire list of all loaded configs
+GList *export_event_config(const char *event_name);
+void unexport_event_config(GList *env_list);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index 43c9e76..3f76021 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -246,3 +246,37 @@ event_config_t *get_event_config(const char *name)
}
return g_hash_table_lookup(g_event_config_list, name);
}
+
+GList *export_event_config(const char *event_name)
+{
+ GList *env_list = NULL;
+
+ event_config_t *config = get_event_config(event_name);
+ if (config)
+ {
+ for (GList *lopt = config->options; lopt; lopt = lopt->next)
+ {
+ event_option_t *opt = lopt->data;
+ if (!opt->value)
+ continue;
+ char *var_val = xasprintf("%s=%s", opt->name, opt->value);
+ VERB3 log("Exporting '%s'", var_val);
+ env_list = g_list_prepend(env_list, var_val);
+ putenv(var_val);
+ }
+ }
+
+ return env_list;
+}
+
+void unexport_event_config(GList *env_list)
+{
+ while (env_list)
+ {
+ char *var_val = env_list->data;
+ VERB3 log("Unexporting '%s'", var_val);
+ safe_unsetenv(var_val);
+ env_list = g_list_remove(env_list, var_val);
+ free(var_val);
+ }
+}
--
1.7.1
13 years, 3 months
looping backtraces
by Tom Tromey
I was looking at this recently:
https://bugzilla.redhat.com/show_bug.cgi?id=627497
I think this could be solved pretty easily by ABRT itself -- it could
supply its own variant of `bt', written in Python, that would detect
looping backtraces and skip to the end.
Writing a replacement for `bt' in Python is quite easy. I have an
implementation on a branch here that I can send if you want.
I wonder what other ways that ABRT could use gdb's Python scripting to
good effect, or in what ways we could modify gdb to be more useful to
ABRT.
Tom
13 years, 3 months
[PATCH] get rid of std::vector from bugzilla
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/plugins/abrt-action-bugzilla.cpp | 30 ++++++------------------------
1 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/src/plugins/abrt-action-bugzilla.cpp b/src/plugins/abrt-action-bugzilla.cpp
index c77a2ba..5b4eacc 100644
--- a/src/plugins/abrt-action-bugzilla.cpp
+++ b/src/plugins/abrt-action-bugzilla.cpp
@@ -41,9 +41,10 @@ struct bug_info {
const char* bug_reporter;
const char* bug_product;
xmlrpc_int32 bug_dup_id;
- std::vector<char*> bug_cc;
+ GList* bug_cc;
};
+/* xzalloc */
static void bug_info_init(struct bug_info* bz)
{
bz->bug_status = NULL;
@@ -60,27 +61,7 @@ static void bug_info_destroy(struct bug_info* bz)
free((void*)bz->bug_reporter);
free((void*)bz->bug_product);
- if (!bz->bug_cc.empty())
- {
- for (unsigned ii = 0; ii < bz->bug_cc.size(); ii++)
- free(bz->bug_cc[ii]);
-
- bz->bug_cc.clear();
- }
-}
-
-static int am_i_in_cc(const struct bug_info* bz, const char* login)
-{
- if (bz->bug_cc.empty())
- return -1;
-
- int size = bz->bug_cc.size();
- for (int ii = 0; ii < size; ii++)
- {
- if (strcmp(login, bz->bug_cc[ii]) == 0)
- return 0;
- }
- return -1;
+ list_free_with_free(bz->bug_cc);
}
/*
@@ -308,7 +289,7 @@ void ctx::get_bug_cc(xmlrpc_value* result_xml, struct bug_info* bz)
if (*cc != '\0')
{
- bz->bug_cc.push_back((char*)cc);
+ bz->bug_cc = g_list_append(bz->bug_cc, (char*)cc);
VERB3 log("member on cc is %s", cc);
continue;
}
@@ -846,7 +827,8 @@ static void report_to_bugzilla(
if (strcmp(bz.bug_status, "CLOSED") != 0)
{
int status = 0;
- if ((strcmp(bz.bug_reporter, login) != 0) && (am_i_in_cc(&bz, login)))
+ if ((strcmp(bz.bug_reporter, login) != 0)
+ && (g_list_find(bz.bug_cc, login)))
{
log(_("Add %s to CC list"), login);
status = bz_server.add_plus_one_cc(bug_id, login);
--
1.7.1
13 years, 3 months
[PATCH] merge config files
by Nikola Pajkovsky
firstly load system wide config from /etc/abrt/events, then
load user defined config from ~/.abrt/events and override
system wide config by user defined config
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/lib/event_config.c | 106 +++++++++++++++++++++++++++--------------------
1 files changed, 61 insertions(+), 45 deletions(-)
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index e38041b..019a3ed 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -70,52 +70,13 @@ event_option_t *get_event_option_from_list(const char *name, GList *options)
return NULL;
}
-/* (Re)loads data from /etc/abrt/events/foo.{xml,conf} */
-void load_event_config_data(void)
+static void load_config_file(const char *dir_path)
{
- free_event_config_data();
-
- if (!g_event_config_list)
- g_event_config_list = g_hash_table_new_full(
- /*hash_func*/ g_str_hash,
- /*key_equal_func:*/ g_str_equal,
- /*key_destroy_func:*/ free,
- /*value_destroy_func:*/ (GDestroyNotify) free_event_config
- );
-
DIR *dir;
struct dirent *dent;
- /* Load .xml files */
- dir = opendir(EVENTS_DIR);
- if (!dir)
- return;
- while ((dent = readdir(dir)) != NULL)
- {
- char *ext = strrchr(dent->d_name, '.');
- if (!ext)
- continue;
- if (strcmp(ext + 1, "xml") != 0)
- continue;
-
- char *fullname = concat_path_file(EVENTS_DIR, dent->d_name);
-
- *ext = '\0';
- event_config_t *event_config = get_event_config(dent->d_name);
- bool new_config = (!event_config);
- if (new_config)
- event_config = new_event_config();
-
- load_event_description_from_file(event_config, fullname);
- free(fullname);
-
- if (new_config)
- g_hash_table_replace(g_event_config_list, xstrdup(dent->d_name), event_config);
- }
- closedir(dir);
-
/* Load .conf files */
- dir = opendir(EVENTS_DIR);
+ dir = opendir(dir_path);
if (!dir)
return;
while ((dent = readdir(dir)) != NULL)
@@ -126,7 +87,7 @@ void load_event_config_data(void)
if (strcmp(ext + 1, "conf") != 0)
continue;
- char *fullname = concat_path_file(EVENTS_DIR, dent->d_name);
+ char *fullname = concat_path_file(dir_path, dent->d_name);
*ext = '\0';
event_config_t *event_config = get_event_config(dent->d_name);
@@ -147,16 +108,17 @@ void load_event_config_data(void)
while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&value))
{
event_option_t *opt;
- GList *elem = g_list_find_custom(event_config->options, name, &cmp_event_option_name_with_string);
+ GList *elem = g_list_find_custom(event_config->options, name,
+ &cmp_event_option_name_with_string);
if (elem)
{
opt = elem->data;
- //log("conf: replacing '%s' value:'%s'->'%s'", name, opt->value, value);
+// log("conf: replacing '%s' value:'%s'->'%s'", name, opt->value, value);
free(opt->value);
}
else
{
- //log("conf: new value %s='%s'", name, value);
+// log("conf: new value %s='%s'", name, value);
opt = new_event_option();
opt->name = xstrdup(name);
}
@@ -173,6 +135,60 @@ void load_event_config_data(void)
closedir(dir);
}
+/* (Re)loads data from /etc/abrt/events/foo.{xml,conf} and ~/.abrt/events/foo.conf */
+void load_event_config_data(void)
+{
+ free_event_config_data();
+
+ if (!g_event_config_list)
+ g_event_config_list = g_hash_table_new_full(
+ /*hash_func*/ g_str_hash,
+ /*key_equal_func:*/ g_str_equal,
+ /*key_destroy_func:*/ free,
+ /*value_destroy_func:*/ (GDestroyNotify) free_event_config
+ );
+
+ DIR *dir;
+ struct dirent *dent;
+
+ /* Load .xml files */
+ dir = opendir(EVENTS_DIR);
+ if (!dir)
+ return;
+ while ((dent = readdir(dir)) != NULL)
+ {
+ char *ext = strrchr(dent->d_name, '.');
+ if (!ext)
+ continue;
+ if (strcmp(ext + 1, "xml") != 0)
+ continue;
+
+ char *fullname = concat_path_file(EVENTS_DIR, dent->d_name);
+
+ *ext = '\0';
+ event_config_t *event_config = get_event_config(dent->d_name);
+ bool new_config = (!event_config);
+ if (new_config)
+ event_config = new_event_config();
+
+ load_event_description_from_file(event_config, fullname);
+ free(fullname);
+
+ if (new_config)
+ g_hash_table_replace(g_event_config_list, xstrdup(dent->d_name), event_config);
+ }
+ closedir(dir);
+
+ load_config_file(EVENTS_DIR);
+
+ char *HOME = getenv("HOME");
+ if (!HOME || !HOME[0])
+ return;
+ HOME = concat_path_file(HOME, ".abrt/events");
+ load_config_file(HOME);
+ free(HOME);
+}
+
/* Frees all loaded data */
void free_event_config_data(void)
{
--
1.7.1
13 years, 3 months