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