RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Table of Contents |
---|
Crash dumping system facilitates service providers or developers to collect crashes happened in the set-top boxes and do the debugging in offline. Crash dumping system is a debug supporting system, which consists of Crash dumping server(s) with user interfaces. Crash dumping server collect crash logs which happened in the connected STBs, process these logs and store for future reference.
Crash log is a log file automatically created on Set top boxes when a crash occurs. This information is useful for offline debugging.
What is Coredump?
Core dump files generated after an uncaught signal in a process (as a SIGSEGV or SIGQUIT), are generated in the base directory where the program was executed, and the core dumps starts with the name as “core” or “core.PID”.
By default size of the core will be zero, To generate the core, we need to set the size of the core to unlimited.
By default, core will be generated in the current directory with the file name "core". We can change the core generating directory from current directory to another by editing the kernel configuration file core pattern(/proc/sys/kernel/core_pattern) in the kernel.
echo "newpattern" > /proc/sys/kernel/core_pattern
Core pattern is helpful in the case if there are couple of core dumps files in one directory and we don't know which program caused it.What is
...
Google Breakpad
Breakpad is a library that records crashes in compact "minidump" files. It produce C and C++ stack traces from minidumps. Breakpad can also write minidumps on request for programs that have not crashed.
draw.io Diagram | ||||
---|---|---|---|---|
|
How to Integrate Google Breakpad library?
...
Panel |
---|
It takes a minidump and its corresponding text-format symbols and produce a symbolized stacktrace. minidump_stackwalk minidump.dmp gpsample_app.sym |
uploadDumps.sh collects core dumps/ mini dumps to crash server whenever any applications crashes.
Sample Application
Code Block |
---|
#include "client/linux/handler/exception_handler.h“
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
void* context,
bool succeeded)
{
printf("Dump path: %s\n", descriptor.path());
return succeeded;
}
void crash()
{
volatile int* a = (int*)(NULL);
*a = 1;
}
int main(int argc, char* argv[])
{
google_breakpad::MinidumpDescriptor descriptor("/tmp");
google_breakpad::ExceptionHandler eh(descriptor,
NULL,
dumpCallback,
NULL,
true,
-1);
crash();
return 0;
}
|
To compile the source
Panel |
---|
PKG_CONFIG_PATH=../ all: breakpad_exercise.c @ $(CXX) -std=c++11 breakpad_exercise.c -g -o breakpad_exercise `pkg-config --cflags breakpad` -L./client/linux/ -lbreakpad_client -I./ -lpthread |
Execute the sample application
Core dump files generated after an uncaught signal in a process (as a SIGSEGV or SIGQUIT), are generated in the base directory where the program was executed, and the core dumps starts with the name as “core” or “core.PID”.
By default size of the core will be zero, To generate the core, we need to set the size of the core to unlimited.
By default, core will be generated in the current directory with the file name "core". We can change the core generating directory from current directory to another by editing the kernel configuration file core pattern(/proc/sys/kernel/core_pattern) in the kernel.
echo "newpattern" > /proc/sys/kernel/core_pattern
Core pattern is helpful in the case if there are couple of core dumps files in one directory and we don't know which program caused it.
How to get stack trace?
Make sue the executable is compiled with -g option to turn on the debugging symbols
Panel |
---|
After you get inside the gdb-prompt, (on execution of the above command), type; (gdb) bt full |
To know more about SoC/Application level APIs details use in RDK, refer the link Crashupload API Documentation