From 8e5a812ce758321fb4f1ee4c181445db34ad39d8 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 4 Dec 2009 12:08:39 +0100 Subject: added document with more detailed IMPLEMENTATION info --- doc/IMPLEMENTATION | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 doc/IMPLEMENTATION (limited to 'doc') diff --git a/doc/IMPLEMENTATION b/doc/IMPLEMENTATION new file mode 100644 index 00000000..807f1253 --- /dev/null +++ b/doc/IMPLEMENTATION @@ -0,0 +1,88 @@ +Implementation: + +C/C++ handling: +============== + +we change /proc/sys/kernel/core_pattern to invoke abrtd helper to save +the coredump of crashing app: +* helper source code: http://git.fedorahosted.org/git/abrt.git?p=abrt.git;a=blob_plain;f=src/Hooks/abrt-pyhook-helper.cpp +the code responsible for this: + + #define CORE_PATTERN "|/usr/libexec/abrt-hook-ccpp" "/var/cache/abrt" %p %s %u" + ofstream fOutCorePattern; + fOutCorePattern.open(CORE_PATTERN_IFACE); + if (fOutCorePattern.is_open()) + { + fOutCorePattern << CORE_PATTERN << endl; + fOutCorePattern.close(); + } + +%p - pid +%s - signal +%u - uid + +when some crash occures abrt-hook-ccpp is invoked to store the coredump and some other info +read from /proc//: + +executable: + char buf[sizeof("/proc/%u/exe") + sizeof(int)*3]; + sprintf(buf, "/proc/%u/exe", (int)pid); + readlink(buf); + +cmdline: + char path[sizeof("/proc/%u/cmdline") + sizeof(int)*3]; + sprintf(path, "/proc/%u/cmdline", (int)pid); + +both is saved to file in /var/cache/abrt/ccpp-