On 03/11/2010 01:05 PM, Denys Vlasenko wrote:
On Wed, 2010-03-10 at 18:52 +0100, Jiri Moskovcak wrote:
buf is leaked. (There are more similar leaks elsewhere).
hopefully fixed all instances of leaked buf
g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(), uid_str);
g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(),
get_crash_data_item_content(crashinfo, CD_UUID).c_str(), uid_str);
Crash id is "UID:UUID", not just "UUID". In the "UID:UUID" form, it identifies crash uniquely.
the second version sends the crashid in the form of uid:uuid from daemon.
Tested. Seems to work. (The bubble is still placed in a strange place though)
This is expected behaviour, the bubble placement is defined by configuration of your {GNOME, KDE, XFCE, ...} notification daemon as it's not bind to the icon anymore. (e.g. on my desktop it's shown in the top right corner because I configured my notification daemon that way).
-void CApplet::CrashNotify(const char *format, ...) +void CApplet::action_report(NotifyNotification *notification, gchar *action, gpointer user_data) {
- va_list args;
- CApplet *applet = (CApplet *)user_data;
- if (applet->m_bDaemonRunning)
- {
pid_t pid = vfork();
if (pid< 0)
perror_msg("vfork");
if (pid == 0)
{ /* child */
char *buf = NULL;
int n = 0;
n = asprintf(&buf, "--report=%s", applet->m_pLastCrashID);
xasprintf() will be simpler (no need to have "int n" variable)...
Changed.
signal(SIGCHLD, SIG_DFL); /* undo SIG_IGN in abrt-applet */
execl(BIN_DIR"/abrt-gui", "abrt-gui", (n>= 0&& buf) ? buf : (char*) NULL, (char*) NULL);
...and no need to have "(n>= 0&& buf) ? buf : (char*) NULL" here
perror_msg_and_die("Can't exec abrt-gui");
free(buf);
Unreachable free()
Fixed.
/* Send dbus signal */
char *crash_id = NULL; if (analyzer_has_InformAllUsers(analyzer)) uid_str = NULL;
g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(), uid_str);
else
{
crash_id = xasprintf("%s:%s",uid_str,get_crash_data_item_content(crashinfo, CD_UUID).c_str());
}
g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(),
crash_id != NULL ? crash_id : get_crash_data_item_content(crashinfo, CD_UUID).c_str(),
uid_str);
free(crash_id);
I think you are confused here. uid_str is an uid to inform, whereas "UID:" part from crash_id of the "UID:UUID" format is the UID of the crashed program. uid_str can't be used for it. The code should be:
/* Send dbus signal */ if (analyzer_has_InformAllUsers(analyzer)) uid_str = NULL; crash_id = xasprintf("%s:%s", get_crash_data_item_content(crashinfo, CD_UID).c_str() get_crash_data_item_content(crashinfo, CD_UUID).c_str() ); g_pCommLayer->Crash(get_crash_data_item_content(crashinfo, FILENAME_PACKAGE).c_str(), crash_id, uid_str); free(crash_id);
IOW, "always send the full crash_id".
Yes, I forgot you removed the '-1' magic so now we always have the right uid.
- if(notify_is_initted())
notify_uninit();
Minor style nit: needs space - "if (...)"
-- vda
Crash-catcher mailing list Crash-catcher@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/crash-catcher