Re: [Crash-catcher] improving handling of debuginfos by abrt
by Jan Kratochvil
Hi,
Cced to <crash-catcher(a)lists.fedorahosted.org>.
On Wed, 26 Aug 2009 04:31:12 +0200, Denys Vlasenko wrote:
> When we process a crash, we have a core file. We just run gdb on it
> in batch mode by running
>
> gdb -batch -x FILE
>
> where FILE contains:
>
> file BINARY
> code COREFILE
^^^^->core-file
Fedora GDB does not need the first "file" command, it will find out the binary
by its build-id. But for binaries either without build-id (=built on
non-Fedora GCC) or which do not have their debuginfo rpm installed we would
not find the filename of BINARY so it is right to say also "file BINARY".
> thread apply all backtrace full
> q
> It tries to locate debuginfo by finding executable's build id,
> [Jan, can you expand on this - does gdb look at executable
> or at the core file in order to find build id? If it looks at core file
> for this, does code file contain build ids of loaded libraries too?]
> then looks it up in /usr/lib/debug/.build-id/XX/XXXXXXXXXXXXXXX
> and uses if it is found.
If you type "file BINARY" it will try to find the separate .debug file
according to the build-id of BINARY. In such case COREFILE build-id would be
ignored.
If you type just "core-file COREFILE" (without "file BINARY") it will find the
binary according to its build-id.
Libraries are always found preferred to their build-id.
Separate debug info files for binaries and libraries are always found
preferred according to the build-id in the binary/library (not core file).
But as build-id of the binary, .debug file and the core file note must be
always the same by definition this paragraph is just an implementation detail.
> example:
> # ls -l /usr/lib/debug/.build-id/00/5af5b5e7d6ab560825b0747fcbe41112431b8c.debug
> lrwxrwxrwx 1 root root 28 2009-07-20 18:08 /usr/lib/debug/.build-id/00/5af5b5e7d6ab560825b0747fcbe41112431b8c.debug -> ../../usr/bin/makestrs.debug
>
> However, we (abrt) do not know whether debuginfo is installed,
> so currently we just run "debuginfo-install -y -- PACKAGE".
ABRT should
eu-unstrip -n --core=/tmp/core.20546
and for its each produced line like
0x3979600000+0x36e000 ec8dd400904ddfcac8b1c343263a790f977159dc@0x3979600280 /lib64/libc-2.10.1.so /usr/lib/debug/lib64/libc-2.10.1.so.debug libc.so.6
use
yum --enablerepo='*-debuginfo' install /usr/lib/debug/.build-id/ec/8dd400904ddfcac8b1c343263a790f977159dc.debug
(or some other yum/gpk command what recommend their maintainers)
> This is a simple approach, but it has several drawbacks.
Yes, I was already suggesting the direct build-id way before which avoids the
package versions mistakes and it may even work one day after we convince
releng they should keep debuginfos even for some (all) previous versions of
packages. Currently for any longterm running programs/daemons the crash
backtrace always fails as there is no longer the debuginfo available for the
running version of the program (while the on-disk program binary is already
updated, incl. its debuginfo package, even if it was already installed).
> So, Jan, what is this pk-debuginfo-install thing, and how it can
> help us here?
Tried installing pk-debuginfo-install but it wanted to install some graphical
mess. Crashes bugreporting must not rely on graphical tools to be usable on
the RHEL text-only server farms.
Thanks,
Jan
14 years, 6 months
[Crash-catcher] [PATCH] bz518420
by Nikola Pajkovsky
diff --git a/lib/CommLayer/DBusClientProxy.cpp
b/lib/CommLayer/DBusClientProxy.cpp
index 2cc00a5..b87e7cc 100644
--- a/lib/CommLayer/DBusClientProxy.cpp
+++ b/lib/CommLayer/DBusClientProxy.cpp
@@ -209,7 +209,7 @@ map_crash_report_t
CDBusClient_proxy::GetJobResult(uint64_t pJobID)
/* signal handlers for this interface
*/
-void CDBusClient_proxy::Crash(std::string& value)
+void CDBusClient_proxy::Crash(const std::string& progname,const
std::string& uid)
{
}
@@ -221,8 +221,9 @@ void CDBusClient_proxy::_Crash_stub(const
::DBus::SignalMessage &sig)
{
DBus::MessageIter ri = sig.reader();
- std::string value; ri >> value;
- Crash(value);
+ std::string progname; ri >> progname;
+ std::string uid; ri >> uid;
+ Crash(progname, uid);
}
void CDBusClient_proxy::_JobDone_stub(const ::DBus::SignalMessage &sig)
diff --git a/lib/CommLayer/DBusClientProxy.h
b/lib/CommLayer/DBusClientProxy.h
index 22dfcf1..40b5426 100644
--- a/lib/CommLayer/DBusClientProxy.h
+++ b/lib/CommLayer/DBusClientProxy.h
@@ -96,7 +96,7 @@ public:
public:
/* signal handlers for this interface
*/
- virtual void Crash(std::string& value);
+ virtual void Crash(const std::string& progname,const std::string& uid);
private:
/* unmarshalers (to unpack the DBus message before calling the
actual signal handler)
diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp
index 8f01133..bdc2293 100644
--- a/src/Applet/CCApplet.cpp
+++ b/src/Applet/CCApplet.cpp
@@ -94,11 +94,16 @@ CApplet::~CApplet()
}
/* dbus related */
-void CApplet::Crash(std::string &value)
+void CApplet::Crash(const std::string& progname, const std::string& uid)
{
if (m_pCrashHandler)
{
- m_pCrashHandler(value.c_str());
+ std::istringstream input_string(uid);
+ uid_t num;
+ input_string >> num;
+
+ if( (num == getuid()) )
+ m_pCrashHandler(progname.c_str());
}
else
{
diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h
index faf89d1..ff6be8e 100644
--- a/src/Applet/CCApplet.h
+++ b/src/Applet/CCApplet.h
@@ -73,7 +73,7 @@ class CApplet
static void onHide_cb(GtkMenuItem *menuitem, gpointer applet);
private:
/* dbus stuff */
- void Crash(std::string &value);
+ void Crash(const std::string& progname, const std::string& uid);
/* the real signal handler called to handle the signal */
void (*m_pCrashHandler)(const char *progname);
diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h
index 76af62b..ad6fe1c 100644
--- a/src/Daemon/CommLayerServer.h
+++ b/src/Daemon/CommLayerServer.h
@@ -26,7 +26,7 @@ class CCommLayerServer {
virtual bool DeleteDebugDump(const std::string& pUUID, const
std::string& pSender) = 0;
/* just stubs to be called when not implemented in specific
comm layer */
- virtual void Crash(const std::string& arg1) {}
+ virtual void Crash(const std::string& progname, const
std::string& uid) {}
virtual void AnalyzeComplete(const map_crash_report_t& arg1) {}
virtual void Error(const std::string& arg1) {}
virtual void Update(const std::string& pDest, const
std::string& pMessage) {};
diff --git a/src/Daemon/CommLayerServerDBus.cpp
b/src/Daemon/CommLayerServerDBus.cpp
index 022d480..535b987 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -244,11 +244,12 @@ void CCommLayerServerDBus::UnRegisterPlugin(const
std::string& pName)
*/
/* Notify the clients (UI) about a new crash */
-void CCommLayerServerDBus::Crash(const std::string& arg1)
+void CCommLayerServerDBus::Crash(const std::string& program, const
std::string& uid)
{
::DBus::SignalMessage sig("Crash");
::DBus::MessageIter wi = sig.writer();
- wi << arg1;
+ wi << program;
+ wi << uid;
emit_signal(sig);
}
diff --git a/src/Daemon/CommLayerServerDBus.h
b/src/Daemon/CommLayerServerDBus.h
index bbc0c3d..e6c29a0 100644
--- a/src/Daemon/CommLayerServerDBus.h
+++ b/src/Daemon/CommLayerServerDBus.h
@@ -47,7 +47,7 @@ class CCommLayerServerDBus
/* DBus signal senders */
public:
- virtual void Crash(const std::string& arg1);
+ virtual void Crash(const std::string& progname, const
std::string& uid);
virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
virtual void Update(const std::string& pDest, const
std::string& pMessage);
diff --git a/src/Daemon/CommLayerServerSocket.cpp
b/src/Daemon/CommLayerServerSocket.cpp
index 1b54068..6407485 100644
--- a/src/Daemon/CommLayerServerSocket.cpp
+++ b/src/Daemon/CommLayerServerSocket.cpp
@@ -231,7 +231,7 @@ bool CCommLayerServerSocket::DeleteDebugDump(const
std::string& pUUID, const std
return true;
}
-void CCommLayerServerSocket::Crash(const std::string& arg1)
+void CCommLayerServerSocket::Crash(const std::string& progname, const
std::string& uid)
{
//Send("(CRASH)New Crash Detected: " + arg1);
}
diff --git a/src/Daemon/CommLayerServerSocket.h
b/src/Daemon/CommLayerServerSocket.h
index e0b7478..111d7fa 100644
--- a/src/Daemon/CommLayerServerSocket.h
+++ b/src/Daemon/CommLayerServerSocket.h
@@ -30,7 +30,7 @@ class CCommLayerServerSocket : public CCommLayerServer
virtual report_status_t Report(const map_crash_report_t&
pReport, const std::string& pSender);
virtual bool DeleteDebugDump(const std::string& pUUID, const
std::string& pSender);
- virtual void Crash(const std::string& arg1);
+ virtual void Crash(const std::string& progname, const
std::string& uid);
virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
};
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index bf5215d..03fb5b2 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -468,13 +468,13 @@ static gboolean handle_event_cb(GIOChannel *gio,
GIOCondition condition, gpointe
log("New crash, saving...");
RunActionsAndReporters(crashinfo[CD_MWDDD][CD_CONTENT]);
/* send message to dbus */
-
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]);
+
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT],
crashinfo[CD_UID][CD_CONTENT]);
break;
case MW_REPORTED:
case MW_OCCURED:
/* send message to dbus */
log("Already saved crash, deleting...");
-
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]);
+
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT],
crashinfo[CD_UID][CD_CONTENT]);
DeleteDebugDumpDir(std::string(DEBUG_DUMPS_DIR) + "/" + name);
break;
case MW_BLACKLISTED:
14 years, 8 months
[Crash-catcher] [PATCH] bz518420
by Nikola Pajkovsky
resolved https://bugzilla.redhat.com/show_bug.cgi?id=518420
diff --git a/lib/CommLayer/DBusClientProxy.cpp
b/lib/CommLayer/DBusClientProxy.cpp
index 2cc00a5..ccb48d5 100644
--- a/lib/CommLayer/DBusClientProxy.cpp
+++ b/lib/CommLayer/DBusClientProxy.cpp
@@ -209,7 +209,7 @@ map_crash_report_t
CDBusClient_proxy::GetJobResult(uint64_t pJobID)
/* signal handlers for this interface
*/
-void CDBusClient_proxy::Crash(std::string& value)
+void CDBusClient_proxy::Crash(const std::string& progname, const
std::string& uid)
{
}
@@ -221,8 +221,9 @@ void CDBusClient_proxy::_Crash_stub(const
::DBus::SignalMessage &sig)
{
DBus::MessageIter ri = sig.reader();
- std::string value; ri >> value;
- Crash(value);
+ std::string progname; ri >> progname;
+ std::string uid; ri >> uid;
+ Crash(progname, uid);
}
void CDBusClient_proxy::_JobDone_stub(const ::DBus::SignalMessage &sig)
diff --git a/lib/CommLayer/DBusClientProxy.h
b/lib/CommLayer/DBusClientProxy.h
index 22dfcf1..e43805b 100644
--- a/lib/CommLayer/DBusClientProxy.h
+++ b/lib/CommLayer/DBusClientProxy.h
@@ -96,7 +96,7 @@ public:
public:
/* signal handlers for this interface
*/
- virtual void Crash(std::string& value);
+ virtual void Crash(const std::string& progname, const std::string&
uid);
private:
/* unmarshalers (to unpack the DBus message before calling the
actual signal handler)
diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp
index 8f01133..bdc2293 100644
--- a/src/Applet/CCApplet.cpp
+++ b/src/Applet/CCApplet.cpp
@@ -94,11 +94,16 @@ CApplet::~CApplet()
}
/* dbus related */
-void CApplet::Crash(std::string &value)
+void CApplet::Crash(const std::string& progname, const std::string& uid)
{
if (m_pCrashHandler)
{
- m_pCrashHandler(value.c_str());
+ std::istringstream input_string(uid);
+ uid_t num;
+ input_string >> num;
+
+ if( (num == getuid()) )
+ m_pCrashHandler(progname.c_str());
}
else
{
diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h
index faf89d1..ff6be8e 100644
--- a/src/Applet/CCApplet.h
+++ b/src/Applet/CCApplet.h
@@ -73,7 +73,7 @@ class CApplet
static void onHide_cb(GtkMenuItem *menuitem, gpointer applet);
private:
/* dbus stuff */
- void Crash(std::string &value);
+ void Crash(const std::string& progname, const std::string& uid);
/* the real signal handler called to handle the signal */
void (*m_pCrashHandler)(const char *progname);
diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h
index 76af62b..8730d01 100644
--- a/src/Daemon/CommLayerServer.h
+++ b/src/Daemon/CommLayerServer.h
@@ -26,7 +26,7 @@ class CCommLayerServer {
virtual bool DeleteDebugDump(const std::string& pUUID, const
std::string& pSender) = 0;
/* just stubs to be called when not implemented in specific
comm layer */
- virtual void Crash(const std::string& arg1) {}
+ virtual void Crash(const std::string& arg1, const std::string&
arg2) {}
virtual void AnalyzeComplete(const map_crash_report_t& arg1) {}
virtual void Error(const std::string& arg1) {}
virtual void Update(const std::string& pDest, const
std::string& pMessage) {};
diff --git a/src/Daemon/CommLayerServerDBus.cpp
b/src/Daemon/CommLayerServerDBus.cpp
index db78cd3..e58e33f 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -244,11 +244,12 @@ void CCommLayerServerDBus::UnRegisterPlugin(const
std::string& pName)
*/
/* Notify the clients (UI) about a new crash */
-void CCommLayerServerDBus::Crash(const std::string& arg1)
+void CCommLayerServerDBus::Crash(const std::string& arg1, const
std::string& arg2)
{
::DBus::SignalMessage sig("Crash");
::DBus::MessageIter wi = sig.writer();
wi << arg1;
+ wi << arg2;
emit_signal(sig);
}
diff --git a/src/Daemon/CommLayerServerDBus.h
b/src/Daemon/CommLayerServerDBus.h
index bbc0c3d..5f5ed57 100644
--- a/src/Daemon/CommLayerServerDBus.h
+++ b/src/Daemon/CommLayerServerDBus.h
@@ -47,7 +47,7 @@ class CCommLayerServerDBus
/* DBus signal senders */
public:
- virtual void Crash(const std::string& arg1);
+ virtual void Crash(const std::string& arg1, const std::string&
arg2);
virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
virtual void Update(const std::string& pDest, const
std::string& pMessage);
diff --git a/src/Daemon/CommLayerServerSocket.cpp
b/src/Daemon/CommLayerServerSocket.cpp
index 734c5a1..99afd8c 100644
--- a/src/Daemon/CommLayerServerSocket.cpp
+++ b/src/Daemon/CommLayerServerSocket.cpp
@@ -234,7 +234,7 @@ bool CCommLayerServerSocket::DeleteDebugDump(const
std::string& pUUID, const std
return true;
}
-void CCommLayerServerSocket::Crash(const std::string& arg1)
+void CCommLayerServerSocket::Crash(const std::string& arg1, const
std::string& arg2)
{
//Send("(CRASH)New Crash Detected: " + arg1);
}
diff --git a/src/Daemon/CommLayerServerSocket.h
b/src/Daemon/CommLayerServerSocket.h
index e0b7478..a998ae6 100644
--- a/src/Daemon/CommLayerServerSocket.h
+++ b/src/Daemon/CommLayerServerSocket.h
@@ -30,7 +30,7 @@ class CCommLayerServerSocket : public CCommLayerServer
virtual report_status_t Report(const map_crash_report_t&
pReport, const std::string& pSender);
virtual bool DeleteDebugDump(const std::string& pUUID, const
std::string& pSender);
- virtual void Crash(const std::string& arg1);
+ virtual void Crash(const std::string& arg1, const std::string&
arg2);
virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
};
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 81484d1..c36876d 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -468,13 +468,13 @@ static gboolean handle_event_cb(GIOChannel *gio,
GIOCondition condition, gpointe
g_cw->Debug("New crash, saving...");
RunActionsAndReporters(crashinfo[CD_MWDDD][CD_CONTENT]);
/* send message to dbus */
-
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]);
+
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT],
crashinfo[CD_UID][CD_CONTENT]);
break;
case MW_REPORTED:
case MW_OCCURED:
/* send message to dbus */
g_cw->Debug("Already saved crash,
deleting...");
-
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT]);
+
g_pCommLayer->Crash(crashinfo[CD_PACKAGE][CD_CONTENT],
crashinfo[CD_UID][CD_CONTENT]);
DeleteDebugDumpDir(std::string(DEBUG_DUMPS_DIR) + "/" + name);
break;
case MW_BLACKLISTED:
14 years, 8 months
[Crash-catcher] patch: TicketUploader plugin
by Gavin Romig-Koch
This is a first step in a report plugin that is intended to report
directly to Red Hat support, with all the Red Hat specific stuff
stripped out (or actually pushed into the config file).
It works by FTPing a tar'ed compressed encripted file to an anonymous
FTP site, and then sending a 'receipt' (containing the filename, md5sum,
and encryption key) of that upload to an actual ticket in a ticketing
system. This version doesn't yet send the receipt.
-gavin...
14 years, 8 months