diff --git a/0003-Add-test-for-xorg-function-normalization.patch b/0003-Add-test-for-xorg-function-normalization.patch new file mode 100644 index 0000000..3360438 --- /dev/null +++ b/0003-Add-test-for-xorg-function-normalization.patch @@ -0,0 +1,184 @@ +From 9bdddf116bad99e8c2bb3a42a1b39afcc543d462 Mon Sep 17 00:00:00 2001 +From: Martin Milata +Date: Fri, 24 Oct 2014 15:04:06 +0200 +Subject: [PATCH] Add test for xorg function normalization + +Related to #191. + +Signed-off-by: Martin Milata +--- + tests/gdb_stacktraces/rhbz-955617 | 132 ++++++++++++++++++++++++++++++++++++++ + tests/python/gdb.py | 11 ++++ + 2 files changed, 143 insertions(+) + create mode 100644 tests/gdb_stacktraces/rhbz-955617 + +diff --git a/tests/gdb_stacktraces/rhbz-955617 b/tests/gdb_stacktraces/rhbz-955617 +new file mode 100644 +index 0000000..5abeb9a +--- /dev/null ++++ b/tests/gdb_stacktraces/rhbz-955617 +@@ -0,0 +1,132 @@ ++[New LWP 1073] ++[Thread debugging using libthread_db enabled] ++Using host libthread_db library "/lib/libthread_db.so.1". ++Core was generated by `/usr/bin/Xorg :0 -background none -verbose -auth /run/gdm/auth-for-gdm-zpSdgj/d'. ++Program terminated with signal 6, Aborted. ++#0 0xb7792424 in __kernel_vsyscall () ++ ++Thread 1 (Thread 0xb774d880 (LWP 1073)): ++#0 0xb7792424 in __kernel_vsyscall () ++No symbol table info available. ++#1 0x4be11756 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 ++ resultvar = ++ resultvar = ++ pid = 1274662912 ++ selftid = 1073 ++#2 0x4be12f93 in __GI_abort () at abort.c:90 ++ save_stage = 2 ++ act = {__sigaction_handler = {sa_handler = 0xbfaacf30, sa_sigaction = 0xbfaacf30}, sa_mask = {__val = {136754592, 1274662912, 171515904, 0, 0, 0, 0, 1272819668, 1272822008, 134533768, 1, 1272747940, 1272822448, 3077894400, 1, 1, 0, 0, 134573327, 136717752, 0, 0, 0, 1272877292, 0, 0, 0, 136716288, 1, 136760368, 136760272, 1272774256}}, sa_flags = 136754592, sa_restorer = 0x4be12e58 <__GI_abort+8>} ++ sigs = {__val = {32, 0 }} ++#3 0x080b8daa in OsAbort () at utils.c:1299 ++No locals. ++#4 0x080d2147 in ddxGiveUp (error=error@entry=EXIT_ERR_ABORT) at xf86Init.c:1075 ++ i = ++#5 0x080d21eb in AbortDDX (error=error@entry=EXIT_ERR_ABORT) at xf86Init.c:1119 ++ i = ++#6 0x080b4662 in AbortServer () at log.c:670 ++No locals. ++#7 0x080b4ccf in FatalError (f=f@entry=0x81f6d38 "Caught signal %d (%s). Server aborting\n") at log.c:811 ++ args = 0xbfaad064 "\v" ++ args2 = 0xbfaad064 "\v" ++ beenhere = 1 ++#8 0x080b6136 in OsSigHandler (signo=11, sip=0xbfaad08c, unused=0xbfaad10c) at osinit.c:147 ++ unused = 0xbfaad10c ++ sip = 0xbfaad08c ++ signo = 11 ++#9 ++No symbol table info available. ++#10 0x08117ca2 in xf86CursorSetCursor (pDev=pDev@entry=0x8f20e48, pScreen=0x8e63948, pCurs=0x9117410, x=747, y=515) at xf86Cursor.c:333 ++ infoPtr = 0x8e7ecc8 ++#11 0x08117eeb in xf86CursorEnableDisableFBAccess (pScrn=0x8e30a68, enable=1) at xf86Cursor.c:233 ++ pDev = 0x8f20e48 ++ pScreen = ++#12 0xb6f97b98 in ?? () from /usr/lib/xorg/modules/drivers/nvidia_drv.so ++No symbol table info available. ++Backtrace stopped: previous frame inner to this frame (corrupt stack?) ++From To Syms Read Shared Object Library ++0xb77628f0 0xb776c7f4 Yes /lib/libudev.so.1 ++0x4c025940 0x4c028e4c Yes /lib/librt.so.1 ++0x4c09daf0 0x4c0b1074 Yes /lib/libselinux.so.1 ++0x4112ef80 0x41224d64 Yes /lib/libcrypto.so.10 ++0x4bfbfad0 0x4bfc09bc Yes /lib/libdl.so.2 ++0x4c11cf20 0x4c1232d4 Yes /lib/libunwind.so.8 ++0x4c22e980 0x4c233cf4 Yes /lib/libpciaccess.so.0 ++0x4bfa76b0 0x4bfb2d70 Yes /lib/libpthread.so.0 ++0xb7754670 0xb775a454 Yes /lib/libdrm.so.2 ++0x414c3db0 0x41542214 Yes /lib/libpixman-1.so.0 ++0x4c0ecdc0 0x4c10d794 Yes /lib/libXfont.so.1 ++0x4c37aa60 0x4c37b854 Yes /lib/libXau.so.6 ++0x417ddea0 0x417dfa74 Yes /lib/libXdmcp.so.6 ++0x41adad60 0x41ae0974 Yes /lib/libaudit.so.1 ++0x4bfca560 0x4bff51e8 Yes /lib/libm.so.6 ++0x4bdfa2d0 0x4bf3e6dc Yes /lib/libc.so.6 ++0x4c0c00c0 0x4c0d62e4 Yes /lib/libgcc_s.so.1 ++0x4bdbb850 0x4bdd409c Yes /lib/ld-linux.so.2 ++0x4c02ff20 0x4c07be24 Yes /lib/libpcre.so.1 ++0x4c00c860 0x4c019704 Yes /lib/libz.so.1 ++0x4c7237f0 0x4c790444 Yes /lib/libfreetype.so.6 ++0x4c0ded70 0x4c0e0f34 Yes /lib/libfontenc.so.1 ++0xb7789e80 0xb778ad40 Yes /usr/lib/xorg/modules/libglamoregl.so ++0x412aed20 0x412c1794 Yes /lib/libEGL.so.1 ++0xb76b9490 0xb76df8d4 Yes /lib/libglamor.so.0 ++0x4ca2c480 0x4ca8c378 Yes (*) /usr/lib/nvidia/libGL.so.1 ++0x4c9e3430 0x4c9e3584 Yes /lib/libX11-xcb.so.1 ++0x412a32e0 0x412a48b4 Yes /lib/libxcb-dri2.so.0 ++0x414b6cb0 0x414b9260 Yes /lib/libxcb-xfixes.so.0 ++0x4155da20 0x41561620 Yes /lib/libxcb-render.so.0 ++0x4fff5b80 0x4fff6914 Yes /lib/libxcb-shape.so.0 ++0x4c4c9f70 0x4c4d9ed4 Yes /lib/libxcb.so.1 ++0x410eb650 0x410ef134 Yes /lib/libwayland-client.so.0 ++0x4167f5f0 0x41686004 Yes /lib/libwayland-server.so.0 ++0x41674220 0x41675b64 Yes /lib/libgbm.so.1 ++0x416a06d0 0x416b1c14 Yes /lib/libglapi.so.0 ++0x4c39b430 0x4c427994 Yes /lib/libX11.so.6 ++0x4cad9df0 0x4cadb4c3 Yes (*) /usr/lib/nvidia/tls/libnvidia-tls.so.313.30 ++0x4d1c46c0 0x4e34b2c0 Yes (*) /usr/lib/nvidia/libnvidia-glcore.so.313.30 ++0x4c658880 0x4c662c84 Yes /lib/libXext.so.6 ++0xb7781fc0 0xb7785664 Yes /lib/libffi.so.6 ++0xb72609b0 0xb75a7a84 Yes (*) /usr/lib/nvidia/xorg/libglx.so ++0xb6a00020 0xb6fefbf0 Yes (*) /usr/lib/xorg/modules/drivers/nvidia_drv.so ++0xb69b3da0 0xb69d9b7c Yes /usr/lib/xorg/modules/libwfb.so ++0xb685de00 0xb6865764 Yes /usr/lib/xorg/modules/input/evdev_drv.so ++0xb6837bf0 0xb683a6b4 Yes /lib/libmtdev.so.1 ++0xb684c990 0xb6857604 Yes /usr/lib/xorg/modules/input/synaptics_drv.so ++0xb683fa40 0xb6846e1c Yes /lib/libnss_files.so.2 ++(*): Shared library is missing debugging information. ++$1 = 0x0 ++No symbol "__glib_assert_msg" in current context. ++eax 0x0 0 ++ecx 0x431 1073 ++edx 0x6 6 ++ebx 0x431 1073 ++esp 0xbfaace74 0xbfaace74 ++ebp 0x826cbd0 0x826cbd0 ++esi 0x1 1 ++edi 0x4bf9d000 1274662912 ++eip 0xb7792424 0xb7792424 <__kernel_vsyscall+16> ++eflags 0x3202 [ IF #12 #13 ] ++cs 0x73 115 ++ss 0x7b 123 ++ds 0x7b 123 ++es 0x7b 123 ++fs 0x0 0 ++gs 0x33 51 ++Dump of assembler code for function __kernel_vsyscall: ++ 0xb7792414 <+0>: push %ecx ++ 0xb7792415 <+1>: push %edx ++ 0xb7792416 <+2>: push %ebp ++ 0xb7792417 <+3>: mov %esp,%ebp ++ 0xb7792419 <+5>: sysenter ++ 0xb779241b <+7>: nop ++ 0xb779241c <+8>: nop ++ 0xb779241d <+9>: nop ++ 0xb779241e <+10>: nop ++ 0xb779241f <+11>: nop ++ 0xb7792420 <+12>: nop ++ 0xb7792421 <+13>: nop ++ 0xb7792422 <+14>: int $0x80 ++=> 0xb7792424 <+16>: pop %ebp ++ 0xb7792425 <+17>: pop %edx ++ 0xb7792426 <+18>: pop %ecx ++ 0xb7792427 <+19>: ret ++End of assembler dump. +diff --git a/tests/python/gdb.py b/tests/python/gdb.py +index 3b88af7..8871b7c 100755 +--- a/tests/python/gdb.py ++++ b/tests/python/gdb.py +@@ -14,6 +14,12 @@ expected_short_text = '''Thread no. 1 (5 frames) + #4 _gtk_marshal_BOOLEAN__BOXED at gtkmarshalers.c:84 + ''' + ++expected_short_text_955617 = '''Thread no. 1 (3 frames) ++ #10 xf86CursorSetCursor at xf86Cursor.c:333 ++ #11 xf86CursorEnableDisableFBAccess at xf86Cursor.c:233 ++ #12 ?? at /usr/lib/xorg/modules/drivers/nvidia_drv.so ++''' ++ + class TestGdbStacktrace(BindingsTestCase): + def setUp(self): + self.trace = satyr.GdbStacktrace(contents) +@@ -61,6 +67,11 @@ class TestGdbStacktrace(BindingsTestCase): + def test_hash(self): + self.assertHashable(self.trace) + ++ def test_short_text_normalization(self): ++ contents = load_input_contents('../gdb_stacktraces/rhbz-955617') ++ trace = satyr.GdbStacktrace(contents) ++ self.assertEqual(trace.to_short_text(5), expected_short_text_955617) ++ + class TestGdbThread(BindingsTestCase): + def setUp(self): + self.thread = satyr.GdbStacktrace(contents).threads[0] +-- +2.1.0 + diff --git a/0004-unwind-Append-threads-frames-in-O-1.patch b/0004-unwind-Append-threads-frames-in-O-1.patch new file mode 100644 index 0000000..44b9893 --- /dev/null +++ b/0004-unwind-Append-threads-frames-in-O-1.patch @@ -0,0 +1,84 @@ +From 9b0d41184821bc229a92d3734200c34a31603783 Mon Sep 17 00:00:00 2001 +From: Martin Milata +Date: Wed, 27 Aug 2014 13:55:50 +0200 +Subject: [PATCH] unwind: Append threads/frames in O(1) + +Related to #179. + +Signed-off-by: Martin Milata +--- + lib/core_unwind_elfutils.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +diff --git a/lib/core_unwind_elfutils.c b/lib/core_unwind_elfutils.c +index 43d66be..78470bc 100644 +--- a/lib/core_unwind_elfutils.c ++++ b/lib/core_unwind_elfutils.c +@@ -33,14 +33,14 @@ + + struct frame_callback_arg + { +- struct sr_core_thread *thread; ++ struct sr_core_frame **frames_tail; + char *error_msg; + unsigned nframes; + }; + + struct thread_callback_arg + { +- struct sr_core_stacktrace *stacktrace; ++ struct sr_core_thread **threads_tail; + char *error_msg; + }; + +@@ -70,8 +70,8 @@ frame_callback(Dwfl_Frame *frame, void *data) + return CB_STOP_UNWIND; + } + +- frame_arg->thread->frames = +- sr_core_frame_append(frame_arg->thread->frames, result); ++ *frame_arg->frames_tail = result; ++ frame_arg->frames_tail = &result->next; + + /* Avoid huge stacktraces from programs stuck in infinite recursion. */ + frame_arg->nframes++; +@@ -99,7 +99,7 @@ unwind_thread(Dwfl_Thread *thread, void *data) + + struct frame_callback_arg frame_arg = + { +- .thread = result, ++ .frames_tail = &(result->frames), + .error_msg = NULL, + .nframes = 0 + }; +@@ -121,14 +121,15 @@ unwind_thread(Dwfl_Thread *thread, void *data) + goto abort; + } + +- if (!error_msg && !frame_arg.thread->frames) ++ if (!error_msg && !result->frames) + { + set_error("No frames found for thread id %d", (int)result->id); + goto abort; + } + +- thread_arg->stacktrace->threads = +- sr_core_thread_append(thread_arg->stacktrace->threads, result); ++ *thread_arg->threads_tail = result; ++ thread_arg->threads_tail = &result->next; ++ + return DWARF_CB_OK; + + abort: +@@ -166,7 +167,7 @@ sr_parse_coredump(const char *core_file, + + struct thread_callback_arg thread_arg = + { +- .stacktrace = stacktrace, ++ .threads_tail = &(stacktrace->threads), + .error_msg = NULL + }; + +-- +2.1.0 + diff --git a/0005-unwind-throw-away-the-most-recent-frames.patch b/0005-unwind-throw-away-the-most-recent-frames.patch new file mode 100644 index 0000000..cda7939 --- /dev/null +++ b/0005-unwind-throw-away-the-most-recent-frames.patch @@ -0,0 +1,51 @@ +From 36d6b09bc537483dbd7a12823f2111abdadd68cb Mon Sep 17 00:00:00 2001 +From: Martin Milata +Date: Wed, 27 Aug 2014 14:21:55 +0200 +Subject: [PATCH] unwind: throw away the most recent frames + +In case there's more than 1024 frames. + +Fixes #179. + +Signed-off-by: Martin Milata +--- + lib/core_unwind_elfutils.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/lib/core_unwind_elfutils.c b/lib/core_unwind_elfutils.c +index 78470bc..7be7ec7 100644 +--- a/lib/core_unwind_elfutils.c ++++ b/lib/core_unwind_elfutils.c +@@ -72,13 +72,7 @@ frame_callback(Dwfl_Frame *frame, void *data) + + *frame_arg->frames_tail = result; + frame_arg->frames_tail = &result->next; +- +- /* Avoid huge stacktraces from programs stuck in infinite recursion. */ + frame_arg->nframes++; +- if (frame_arg->nframes >= FRAME_LIMIT) +- { +- return CB_STOP_UNWIND; +- } + + return DWARF_CB_OK; + } +@@ -127,6 +121,15 @@ unwind_thread(Dwfl_Thread *thread, void *data) + goto abort; + } + ++ /* Truncate the stacktrace to FRAME_LIMIT least recent frames. */ ++ while (result->frames && frame_arg.nframes > FRAME_LIMIT) ++ { ++ struct sr_core_frame *old_frame = result->frames; ++ result->frames = old_frame->next; ++ sr_core_frame_free(old_frame); ++ frame_arg.nframes--; ++ } ++ + *thread_arg->threads_tail = result; + thread_arg->threads_tail = &result->next; + +-- +2.1.0 + diff --git a/0006-unwind-lower-stacktrace-length-limit-to-256.patch b/0006-unwind-lower-stacktrace-length-limit-to-256.patch new file mode 100644 index 0000000..80129ff --- /dev/null +++ b/0006-unwind-lower-stacktrace-length-limit-to-256.patch @@ -0,0 +1,28 @@ +From a2285d8209eb52efddd6856ddeeef9650da2bdec Mon Sep 17 00:00:00 2001 +From: Martin Milata +Date: Wed, 27 Aug 2014 15:32:54 +0200 +Subject: [PATCH] unwind: lower stacktrace length limit to 256 + +Related to #179. + +Signed-off-by: Martin Milata +--- + lib/core_unwind_elfutils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/core_unwind_elfutils.c b/lib/core_unwind_elfutils.c +index 7be7ec7..bbd4813 100644 +--- a/lib/core_unwind_elfutils.c ++++ b/lib/core_unwind_elfutils.c +@@ -29,7 +29,7 @@ + #include + #include + +-#define FRAME_LIMIT 1024 ++#define FRAME_LIMIT 256 + + struct frame_callback_arg + { +-- +2.1.0 + diff --git a/0007-koops-add-function-name-into-some-reasons.patch b/0007-koops-add-function-name-into-some-reasons.patch new file mode 100644 index 0000000..4e6b378 --- /dev/null +++ b/0007-koops-add-function-name-into-some-reasons.patch @@ -0,0 +1,208 @@ +From 9bde0322c40ea87d170982eca49624bbf92a996c Mon Sep 17 00:00:00 2001 +From: Martin Milata +Date: Mon, 3 Nov 2014 17:04:13 +0100 +Subject: [PATCH] koops: add function name into some reasons + +Related to rhbz#998887. + +Signed-off-by: Martin Milata +--- + include/koops/stacktrace.h | 5 +++++ + lib/koops_stacktrace.c | 28 +++++++++++++++++++++------ + tests/kerneloopses/rhbz-1140681 | 43 +++++++++++++++++++++++++++++++++++++++++ + tests/koops_stacktrace.at | 43 +++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 113 insertions(+), 6 deletions(-) + create mode 100644 tests/kerneloopses/rhbz-1140681 + +diff --git a/include/koops/stacktrace.h b/include/koops/stacktrace.h +index 449756b..347e45e 100644 +--- a/include/koops/stacktrace.h ++++ b/include/koops/stacktrace.h +@@ -84,6 +84,11 @@ struct sr_koops_stacktrace + * @brief Call trace. It might be NULL as it is not mandatory. + */ + struct sr_koops_frame *frames; ++ ++ /** ++ * @brief Reason message extracted by ABRT. ++ */ ++ char *reason; + }; + + /** +diff --git a/lib/koops_stacktrace.c b/lib/koops_stacktrace.c +index 611c7d1..a651a2b 100644 +--- a/lib/koops_stacktrace.c ++++ b/lib/koops_stacktrace.c +@@ -131,6 +131,7 @@ sr_koops_stacktrace_free(struct sr_koops_stacktrace *stacktrace) + + free(stacktrace->version); + free(stacktrace->raw_oops); ++ free(stacktrace->reason); + free(stacktrace); + } + +@@ -149,6 +150,9 @@ sr_koops_stacktrace_dup(struct sr_koops_stacktrace *stacktrace) + if (result->raw_oops) + result->raw_oops = sr_strdup(result->raw_oops); + ++ if (result->reason) ++ result->reason = sr_strdup(result->reason); ++ + return result; + } + +@@ -335,6 +339,9 @@ sr_koops_stacktrace_parse(const char **input, + /* Looks for the "Tainted: " line in the whole input */ + parse_taint_flags(local_input, stacktrace); + ++ /* The "reason" is expected to be the first line of the input */ ++ stacktrace->reason = sr_strndup(*input, strcspn(*input, "\n")); ++ + while (*local_input) + { + sr_skip_char_span(&local_input, " \t"); +@@ -700,7 +707,7 @@ char * + sr_koops_stacktrace_get_reason(struct sr_koops_stacktrace *stacktrace) + { + char *func = ""; +- char *result; ++ struct sr_strbuf *result = sr_strbuf_new(); + + struct sr_koops_stacktrace *copy = sr_koops_stacktrace_dup(stacktrace); + sr_normalize_koops_stacktrace(copy); +@@ -708,17 +715,26 @@ sr_koops_stacktrace_get_reason(struct sr_koops_stacktrace *stacktrace) + if (copy->frames && copy->frames->function_name) + func = copy->frames->function_name; + +- if (copy->frames && copy->frames->module_name) ++ if (stacktrace->reason) + { +- result = sr_asprintf("Kernel oops in %s [%s]", func, +- copy->frames->module_name); ++ if (strstr(stacktrace->reason, "general protection fault: ")) ++ result = sr_strbuf_append_strf(result, "general protection fault in %s", func); ++ else if (strstr(stacktrace->reason, "kernel paging request at")) ++ result = sr_strbuf_append_strf(result, "kernel paging request at %s", func); ++ else ++ result = sr_strbuf_append_str(result, stacktrace->reason); + } + else +- result = sr_asprintf("Kernel oops in %s", func); ++ { ++ result = sr_strbuf_append_strf(result, "Kernel oops in %s", func); ++ } ++ ++ if (copy->frames && copy->frames->module_name) ++ result = sr_strbuf_append_strf(result, " [%s]", copy->frames->module_name); + + sr_koops_stacktrace_free(copy); + +- return result; ++ return sr_strbuf_free_nobuf(result); + } + + static void +diff --git a/tests/kerneloopses/rhbz-1140681 b/tests/kerneloopses/rhbz-1140681 +new file mode 100644 +index 0000000..ec53f02 +--- /dev/null ++++ b/tests/kerneloopses/rhbz-1140681 +@@ -0,0 +1,43 @@ ++general protection fault: 0000 [#1] SMP ++Modules linked in: ccm rfcomm ip6t_rpfilter ip6t_REJECT xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security bnep iptable_raw iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal coretemp kvm_intel kvm snd_hda_codec_hdmi crct10dif_pclmul snd_hda_codec_conexant snd_hda_codec_generic crc32_pclmul crc32c_intel arc4 iwldvm ghash_clmulni_intel mac80211 joydev microcode snd_hda_intel uvcvideo snd_hda_controller serio_raw videobuf2_vmalloc i2c_i801 snd_hda_codec videobuf2_memops iwlwifi videobuf2_core btusb videodev snd_hwdep lpc_ich bluetooth media mfd_core cfg80211 snd_seq snd_seq_device snd_pcm sdhci_pci sdhci mmc_core mei_me shpchp mei snd_timer wmi tpm_tis tpm thinkpad_acpi snd soundcore rfkill nfsd auth_rpcgss nfs_acl lockd sunrpc i915 i2c_algo_bit drm_kms_helper e1000e drm ptp i2c_core pps_core video ++CPU: 1 PID: 946 Comm: X Not tainted 3.15.10-201.fc20.x86_64 #1 ++Hardware name: LENOVO 4173W15/4173W15, BIOS 8CET58WW (1.38 ) 07/18/2013 ++task: ffff8800d523cf00 ti: ffff88020211c000 task.ti: ffff88020211c000 ++RIP: 0010:[] [] find_get_entry+0x42/0xc0 ++RSP: 0000:ffff88020211fa28 EFLAGS: 00013246 ++RAX: 0000000080000000 RBX: ffff880037e6e670 RCX: 00000000fffffffa ++RDX: 1000000000000000 RSI: ffff88013c46dad0 RDI: 0000000000000036 ++RBP: ffff88020211fa38 R08: 0000000000000000 R09: ffff88013c46d918 ++R10: ffff88020211fa08 R11: ffff880000000418 R12: 0000000000000072 ++R13: ffff880037e6e668 R14: ffff880037e6e518 R15: ffffea0006fd9480 ++FS: 00007fc8b072a9c0(0000) GS:ffff88021e240000(0000) knlGS:0000000000000000 ++CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 ++CR2: 00007fc8ac283000 CR3: 000000020fd19000 CR4: 00000000000407e0 ++Stack: ++ 0000000000000072 0000000000000072 ffff88020211fa60 ffffffff81171d6f ++ 0000000000000072 0000000000000000 0000000000000001 ffff88020211fb18 ++ ffffffff8118b98d 0000000000000000 ffff8800d523cf00 ffff88020211fb28 ++Call Trace: ++ [] find_lock_entry+0x1f/0x80 ++ [] shmem_getpage_gfp+0xcd/0x7c0 ++ [] shmem_read_mapping_page_gfp+0x40/0x80 ++ [] i915_gem_object_get_pages_gtt+0x14a/0x3b0 [i915] ++ [] i915_gem_object_get_pages+0x6c/0xc0 [i915] ++ [] i915_gem_object_pin+0x34d/0x6f0 [i915] ++ [] ? kfree+0xff/0x140 ++ [] i915_gem_fault+0x139/0x2a0 [i915] ++ [] __do_fault+0x48/0xc0 ++ [] ? drm_vm_open_locked+0x31/0x90 [drm] ++ [] do_shared_fault.isra.58+0x40/0x1e0 ++ [] handle_mm_fault+0x495/0x10e0 ++ [] ? drm_ioctl+0x1ec/0x660 [drm] ++ [] ? mmap_region+0x19d/0x5d0 ++ [] __do_page_fault+0x18c/0x530 ++ [] ? do_mmap_pgoff+0x2f5/0x3c0 ++ [] ? file_map_prot_check+0x63/0xd0 ++ [] ? do_vfs_ioctl+0x2e0/0x4a0 ++ [] do_page_fault+0x22/0x30 ++ [] page_fault+0x28/0x30 ++Code: 89 df e8 62 13 1e 00 48 85 c0 48 89 c6 74 52 48 8b 10 48 85 d2 74 3d f6 c2 03 75 6e 65 8b 04 25 a0 c7 00 00 a9 00 ff 1f 00 75 5d <8b> 4a 1c 85 c9 74 ca 8d 79 01 4c 8d 4a 1c 89 c8 f0 0f b1 7a 1c ++RIP [] find_get_entry+0x42/0xc0 ++ RSP +diff --git a/tests/koops_stacktrace.at b/tests/koops_stacktrace.at +index 5e17ca7..cd57fc8 100644 +--- a/tests/koops_stacktrace.at ++++ b/tests/koops_stacktrace.at +@@ -813,3 +813,46 @@ int main(void) + return 0; + } + ]]) ++ ++## ------------------------------ ## ++## sr_koops_stacktrace_get_reason ## ++## ------------------------------ ## ++ ++AT_TESTFUN([sr_koops_stacktrace_get_reason], ++[[ ++#include "koops/stacktrace.h" ++#include "koops/frame.h" ++#include "thread.h" ++#include "location.h" ++#include "utils.h" ++#include ++#include ++#include ++ ++ ++int main(void) ++{ ++ char *error_message; ++ char *full_input = sr_file_to_string("../../kerneloopses/rhbz-1140681", &error_message); ++ assert(full_input); ++ char *input = full_input; ++ ++ struct sr_location location; ++ sr_location_init(&location); ++ struct sr_koops_stacktrace *stacktrace = ++ sr_koops_stacktrace_parse(&input, &location); ++ ++ assert(stacktrace); ++ assert(*input == '\0'); ++ free(full_input); ++ ++ char *expected_reason = "general protection fault in find_get_entry"; ++ char *actual_reason = sr_koops_stacktrace_get_reason(stacktrace); ++ printf("%s\n%s\n", expected_reason, actual_reason); ++ assert(0 == strcmp(expected_reason, actual_reason)); ++ ++ sr_koops_stacktrace_free(stacktrace); ++ ++ return 0; ++} ++]]) +-- +2.1.0 + diff --git a/0008-configure-don-t-link-against-libunwind-needlessly.patch b/0008-configure-don-t-link-against-libunwind-needlessly.patch new file mode 100644 index 0000000..469a815 --- /dev/null +++ b/0008-configure-don-t-link-against-libunwind-needlessly.patch @@ -0,0 +1,48 @@ +From 3cf1a5c1da350369ea27a7f6b45eeb2e10ce3bbe Mon Sep 17 00:00:00 2001 +From: Martin Milata +Date: Thu, 6 Nov 2014 15:48:24 +0100 +Subject: [PATCH] configure: don't link against libunwind needlessly + +Previously we linked against libunwind even if we detected usable +elfutils unwinder. Not a problem for elfutils from mock/koji but can +cause confusion during development. + +Closes #162. + +Signed-off-by: Martin Milata +--- + configure.ac | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index aff4419..ba18759 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -104,13 +104,19 @@ AC_CHECK_LIB([elf], [main]) + AC_CHECK_LIB([dw], [main]) + AC_CHECK_LIB([dwfl], [main]) + AC_CHECK_LIB([dl], [main]) +-AC_CHECK_FUNC(dwfl_getthreads, AC_DEFINE(HAVE_DWFL_NEXT_THREAD, [], [Have function dwfl_getthreads for coredump unwinding])) ++elfutils_unwinder=0 ++AC_CHECK_FUNC(dwfl_getthreads, ++ AC_DEFINE(HAVE_DWFL_NEXT_THREAD, [], [Have function dwfl_getthreads for coredump unwinding]) ++ elfutils_unwinder=1 ++) + + # libunwind +-AC_CHECK_HEADERS([libunwind-coredump.h]) +-AC_CHECK_LIB([unwind], [main]) +-AC_CHECK_LIB([unwind-generic], [main]) +-AC_CHECK_LIB([unwind-coredump], [main]) ++if test "$elfutils_unwinder" != "1"; then ++ AC_CHECK_HEADERS([libunwind-coredump.h]) ++ AC_CHECK_LIB([unwind], [main]) ++ AC_CHECK_LIB([unwind-generic], [main]) ++ AC_CHECK_LIB([unwind-coredump], [main]) ++fi + + # rpm + AC_CHECK_LIB([rpm], [main]) +-- +2.1.0 + diff --git a/satyr.spec b/satyr.spec index ef9a6e0..17db598 100644 --- a/satyr.spec +++ b/satyr.spec @@ -19,7 +19,7 @@ Name: satyr Version: 0.15 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tools to create anonymous, machine-friendly problem reports Group: System Environment/Libraries License: GPLv2+ @@ -38,6 +38,24 @@ BuildRequires: gcc-c++ BuildRequires: python-sphinx %endif +# '%%autosetup -S git' -> git +BuildRequires: git + +# git format-patch %%{Version} --topo-order -N -M; +# +# --topo-oder is needed because reversed chronological order produces a +# different permutatoin after merging a very old patch +# +# i=0; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done +#Patch0000: 0001-ruby-ruby-1.8-compatibility.patch +#Patch0001: 0002-ruby-release-0.2.patch +Patch0002: 0003-Add-test-for-xorg-function-normalization.patch +Patch0003: 0004-unwind-Append-threads-frames-in-O-1.patch +Patch0004: 0005-unwind-throw-away-the-most-recent-frames.patch +Patch0005: 0006-unwind-lower-stacktrace-length-limit-to-256.patch +Patch0006: 0007-koops-add-function-name-into-some-reasons.patch +Patch0007: 0008-configure-don-t-link-against-libunwind-needlessly.patch + %description Satyr is a library that can be used to create and process microreports. Microreports consist of structured data suitable to be analyzed in a fully @@ -64,7 +82,12 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Python bindings for %{name}. %prep -%setup -q +# http://www.rpm.org/wiki/PackagerDocs/Autosetup +# Default '__scm_apply_git' is 'git apply && git commit' but this workflow +# doesn't allow us to create a new file within a patch, so we have to use +# 'git am' (see /usr/lib/rpm/macros for more details) +%define __scm_apply_git(qp:m:) %{__git} am +%autosetup -S git %build %configure \ @@ -107,6 +130,9 @@ make check %endif %changelog +* Fri Nov 07 2014 Jakub Filak 0.15-2 +- Add function name into reason text for kernel page faults + * Tue Oct 07 2014 Jakub Filak 0.15-1 - New upstream version - uReport enhancements (DESKTOP_SESSION, auth_data, missing values)