Requires: zip
Requires: libelf
Requires: libdw
-Requires: %{_sbindir}/minicoredumper
+Requires: minicoredumper >= 2.1.0
Requires: %{_bindir}/buxton2ctl
%description
SNPRINTF_OR_EXIT(sig, "%d");
SNPRINTF_OR_EXIT(time, "%ld");
+ const char *without_core_str = config.dump_core ? NULL : "-s";
+
/* Execute minicoredumper */
char *args[] = {
MINICOREDUMPER_BIN_PATH, // minicoredumper filename path
coredump_name, // coredump filename
"-P",
prstatus_fd_str,
+ (char *)without_core_str, // with or without core
NULL
};
/* Minicoredumper must be executed to dump at least PRSTATUS for
other tools, coredump, however, might have been disabled. */
- if (!config.dump_core) {
+ if (!config.dump_core && file_exists_in_dir(cinfo->pfx, coredump_name)) {
if (remove_file_in_dir(cinfo->pfx, coredump_name) != 0)
_E("Saving core disabled - removing coredump %s/%s failed: %m",
cinfo->pfx, coredump_name);
return stat(path, &buf) == 0;
}
+bool file_exists_in_dir(const char *base_dir, const char *file_name)
+{
+ char *path;
+ bool result = false;
+
+ if (asprintf(&path, "%s/%s", base_dir, file_name) == -1) {
+ _E("Failed to asprintf for path: %m");
+ } else {
+ result = file_exists(path);
+ free(path);
+ }
+
+ return result;
+}
+
bool write_to_file(const char *content, const char *base_dir, const char *file_name)
{
char *path;
}
close(fd);
- result = true;
exit:
free(path);
return result;
bool file_exists(const char *path);
+bool file_exists_in_dir(const char *dir_path, const char *file_name);
+
bool write_to_file(const char *content, const char *base_dir, const char *file_name);
#ifdef __cplusplus
fail "coredump file exists"
fi
+RESULT=$(cat ${CRASH_DUMP_PATH}/kenny*/kenny*info)
+check "MemTotal:"
+check "VmExe:"
+check "VmSwap:"
+check '[heap]'
+check '/usr/lib/libm-.*.so'
+check '/usr/lib/libc-.*.so'
+check '/usr/lib/libgcc_s.so'
+check '/usr/lib/libstdc++.*so'
+check '/usr/lib/libpthread-.*.so'
+check '/usr/lib/ld-.*.so'
+check '[stack]'
+check 'main.*kenny'
+
exit_ok