Skip to content

Commit bbf0399

Browse files
author
Jakub Filak
committed
Fulfill missing values in core/frames
File name of __kernel_vsyscall function frame cannot be resolved but we known that the function comes from kernel. The frame often appears in backtraces of sleep. Signed-off-by: Jakub Filak <[email protected]>
1 parent c68b46d commit bbf0399

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lib/abrt.c

+24
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "operating_system.h"
2525
#include "core/unwind.h"
2626
#include "core/stacktrace.h"
27+
#include "core/thread.h"
28+
#include "core/frame.h"
2729
#include "core/fingerprint.h"
2830
#include "python/stacktrace.h"
2931
#include "koops/stacktrace.h"
@@ -62,6 +64,26 @@ sr_abrt_print_report_from_dir(const char *directory,
6264
return true;
6365
}
6466

67+
static void
68+
fulfill_missing_values(struct sr_core_stacktrace *core_stacktrace)
69+
{
70+
struct sr_core_thread *thread = core_stacktrace->threads;
71+
while (thread)
72+
{
73+
struct sr_core_frame *frame = thread->frames;
74+
while (frame)
75+
{
76+
if (!frame->file_name && frame->function_name
77+
&& strcmp("__kernel_vsyscall", frame->function_name) == 0)
78+
{
79+
frame->file_name = sr_strdup("kernel");
80+
}
81+
frame = frame->next;
82+
}
83+
thread = thread->next;
84+
}
85+
}
86+
6587
static bool
6688
create_core_stacktrace(const char *directory, const char *gdb_output,
6789
bool hash_fingerprints, char **error_message)
@@ -87,6 +109,8 @@ create_core_stacktrace(const char *directory, const char *gdb_output,
87109
if (!core_stacktrace)
88110
return false;
89111

112+
fulfill_missing_values(core_stacktrace);
113+
90114
#if 0
91115
sr_core_fingerprint_generate(core_stacktrace,
92116
error_message);

0 commit comments

Comments
 (0)