xorg-server: Changes to 'ubuntu'
debian/changelog | 7
debian/control | 1
debian/patches/drm_device_keep_trying.patch | 8
debian/patches/os-use-libunwind-to-generate-backtraces.patch | 206 +++++++++++
debian/patches/series | 3
5 files changed, 218 insertions(+), 7 deletions(-)
New commits:
commit c47ff27c36f39b832b061b311a3a564d4e1581d3
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Mar 19 07:52:53 2013 +0100
remove dead code from drm_device_keep_trying.patch
diff --git a/debian/patches/drm_device_keep_trying.patch b/debian/patches/drm_device_keep_trying.patch
index b36a226..14dafa9 100644
--- a/debian/patches/drm_device_keep_trying.patch
+++ b/debian/patches/drm_device_keep_trying.patch
@@ -26,7 +26,7 @@ Signed-off-by: Bryce Harrington <bryce@canonical.com>
/* Linux platform device support */
#include "xf86_OSproc.h"
-@@ -17,23 +18,60 @@
+@@ -17,23 +18,54 @@
#include "hotplug.h"
@@ -55,11 +55,6 @@ Signed-off-by: Bryce Harrington <bryce@canonical.com>
char *buf;
int fd;
+ int err = 0;
-+ int drm_wait_total = 2; /* Max seconds we'll wait for drm */
-+ int drm_wait_usleep = 50; /* How frequently we'll re-check */
-+ int drm_wait_max_msgs = 10; /* Max errors we'll print to logs */
-+ int drm_wait_counter = drm_wait_total * 1000000 / drm_wait_usleep;
-+ int drm_wait_msg_time = drm_wait_counter / drm_wait_max_msgs;
fd = open(path, O_RDWR, O_CLOEXEC);
if (fd == -1)
@@ -88,7 +83,6 @@ Signed-off-by: Bryce Harrington <bryce@canonical.com>
+ } else
+ ErrorF("drmSetInterfaceVersion failed with %i(%s)\n", err, strerror(-err));
+
-+err:
+ close(fd);
return FALSE;
}
commit 77260f62407a905e166f8029c561e4a4c4e9d942
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Thu Mar 14 16:12:06 2013 +0100
Add patch to improve backtraces in the Xorg log.
* Add patch to improve backtraces in the Xorg log.
- os-use-libunwind-to-generate-backtraces.patch
diff --git a/debian/changelog b/debian/changelog
index 6a23fad..dd234da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.13.3-0ubuntu2) raring; urgency=low
+
+ * Add patch to improve backtraces in the Xorg log.
+ - os-use-libunwind-to-generate-backtraces.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Thu, 14 Mar 2013 16:12:16 +0100
+
xorg-server (2:1.13.3-0ubuntu1) raring; urgency=low
* New upstream release.
diff --git a/debian/control b/debian/control
index 74c07fc..1e0d7e8 100644
--- a/debian/control
+++ b/debian/control
@@ -53,6 +53,7 @@ Build-Depends:
libdbus-1-dev [kfreebsd-any],
libhal-dev [kfreebsd-any],
libudev-dev (>= 151-3) [linux-any],
+ libunwind8-dev,
libselinux1-dev (>= 2.0.80) [linux-any],
libaudit-dev [linux-any],
x11proto-xf86dri-dev (>= 2.1.0),
diff --git a/debian/patches/os-use-libunwind-to-generate-backtraces.patch b/debian/patches/os-use-libunwind-to-generate-backtraces.patch
new file mode 100644
index 0000000..261bb7d
--- /dev/null
+++ b/debian/patches/os-use-libunwind-to-generate-backtraces.patch
@@ -0,0 +1,206 @@
+From cae16adcfea6d12c72c48b9091b7f562fcb6a925 Mon Sep 17 00:00:00 2001
+From: Marcin Slusarz <marcin.slusarz@gmail.com>
+Date: Thu, 21 Feb 2013 09:02:44 +1000
+Subject: [PATCH] os: use libunwind to generate backtraces
+
+Libunwind generates backtraces much more reliably than glibc's "backtrace".
+
+Before:
+0: /opt/xserver/bin/X (0x400000+0x18ce36) [0x58ce36]
+1: /opt/xserver/bin/X (xorg_backtrace+0x9) [0x58d119]
+2: /opt/xserver/bin/X (0x400000+0x190d69) [0x590d69]
+3: /lib64/libpthread.so.0 (0x7fb904268000+0x10a90) [0x7fb904278a90]
+4: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987]
+5: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8]
+6: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b]
+7: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719]
+8: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (0x7fb90220e000+0x76f3) [0x7fb9022156f3]
+9: /opt/xserver/lib/xorg/modules/libexa.so (0x7fb9019c7000+0xbae0) [0x7fb9019d2ae0]
+10: /opt/xserver/bin/X (0x400000+0x17d2b3) [0x57d2b3]
+11: /opt/xserver/bin/X (0x400000+0xc9930) [0x4c9930]
+12: /opt/xserver/bin/X (0x400000+0x3a81a) [0x43a81a]
+13: /opt/xserver/bin/X (0x400000+0x3d6a1) [0x43d6a1]
+14: /opt/xserver/bin/X (0x400000+0x2c2ca) [0x42c2ca]
+15: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5]
+16: /opt/xserver/bin/X (0x400000+0x2c60d) [0x42c60d]
+17: ?? [0x0]
+
+After:
+0: /opt/xserver/bin/X (OsSigHandler+0x39) [0x590d69]
+1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7fb904278a8f]
+2: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987]
+3: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8]
+4: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b]
+5: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719]
+6: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (nouveau_exa_download_from_screen+0x1a3) [0x7fb9022156f3]
+7: /opt/xserver/lib/xorg/modules/libexa.so (exaGetImage+0x1f0) [0x7fb9019d2ae0]
+8: /opt/xserver/bin/X (miSpriteGetImage+0x173) [0x57d2b3]
+9: /opt/xserver/bin/X (compGetImage+0xb0) [0x4c9930]
+10: /opt/xserver/bin/X (ProcGetImage+0x55a) [0x43a81a]
+11: /opt/xserver/bin/X (Dispatch+0x341) [0x43d6a1]
+12: /opt/xserver/bin/X (main+0x3ba) [0x42c2ca]
+13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5]
+14: /opt/xserver/bin/X (_start+0x29) [0x42c60d]
+15: ? (?+0x29) [0x29]
+
+Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Tested-by: Knut Petersen <knut.petersen@t-online.de>
+(cherry picked from commit e21e183059df5975e7086850d1931edb2c1bbd06)
+---
+ configure.ac | 9 +++++-
+ include/dix-config.h.in | 3 ++
+ os/Makefile.am | 5 ++++
+ os/backtrace.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 91 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bc4f22e..fc766ab 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -309,6 +309,13 @@ AC_CHECK_HEADER([execinfo.h],[
+ ])]
+ )
+
++PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
++if test "x$HAVE_LIBUNWIND" = xyes; then
++ AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
++fi
++AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
++
++
+ dnl ---------------------------------------------------------------------------
+ dnl Bus options and CPU capabilities. Replaces logic in
+ dnl hw/xfree86/os-support/bus/Makefile.am, among others.
+@@ -1337,7 +1344,7 @@ AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
+
+ if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
+ DIX_LIB='$(top_builddir)/dix/dix.O'
+- OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)'
++ OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
+ else
+ DIX_LIB='$(top_builddir)/dix/libdix.la'
+ OS_LIB='$(top_builddir)/os/libos.la'
+diff --git a/include/dix-config.h.in b/include/dix-config.h.in
+index 578f249..5102263 100644
+--- a/include/dix-config.h.in
++++ b/include/dix-config.h.in
+@@ -60,6 +60,9 @@
+ /* Has backtrace support */
+ #undef HAVE_BACKTRACE
+
++/* Has libunwind support */
++#undef HAVE_LIBUNWIND
++
+ /* Define to 1 if you have the <byteswap.h> header file. */
+ #undef HAVE_BYTESWAP_H
+
+diff --git a/os/Makefile.am b/os/Makefile.am
+index 8891485..364b6da 100644
+--- a/os/Makefile.am
++++ b/os/Makefile.am
+@@ -34,6 +34,11 @@ if XDMCP
+ libos_la_SOURCES += $(XDMCP_SRCS)
+ endif
+
++if HAVE_LIBUNWIND
++AM_CFLAGS += $(LIBUNWIND_CFLAGS)
++libos_la_LIBADD += $(LIBUNWIND_LIBS)
++endif
++
+ EXTRA_DIST = $(SECURERPC_SRCS) $(XDMCP_SRCS)
+
+ if SPECIAL_DTRACE_OBJECTS
+diff --git a/os/backtrace.c b/os/backtrace.c
+index daac60c..426f9b1 100644
+--- a/os/backtrace.c
++++ b/os/backtrace.c
+@@ -30,6 +30,80 @@
+ #include <errno.h>
+ #include <string.h>
+
++#ifdef HAVE_LIBUNWIND
++
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++#include <dlfcn.h>
++
++void
++xorg_backtrace(void)
++{
++ unw_cursor_t cursor;
++ unw_context_t context;
++ unw_word_t off;
++ unw_proc_info_t pip;
++ int ret, i = 0;
++ char procname[256];
++ const char *filename;
++ Dl_info dlinfo;
++
++ pip.unwind_info = NULL;
++ ret = unw_getcontext(&context);
++ if (ret) {
++ ErrorFSigSafe("unw_getcontext failed: %s [%d]\n", unw_strerror(ret),
++ ret);
++ return;
++ }
++
++ ret = unw_init_local(&cursor, &context);
++ if (ret) {
++ ErrorFSigSafe("unw_init_local failed: %s [%d]\n", unw_strerror(ret),
++ ret);
++ return;
++ }
++
++ ErrorFSigSafe("\n");
++ ErrorFSigSafe("Backtrace:\n");
++ ret = unw_step(&cursor);
++ while (ret > 0) {
++ ret = unw_get_proc_info(&cursor, &pip);
++ if (ret) {
++ ErrorFSigSafe("unw_get_proc_info failed: %s [%d]\n",
++ unw_strerror(ret), ret);
++ break;
++ }
++
++ ret = unw_get_proc_name(&cursor, procname, 256, &off);
++ if (ret && ret != -UNW_ENOMEM) {
++ if (ret != -UNW_EUNSPEC)
++ ErrorFSigSafe("unw_get_proc_name failed: %s [%d]\n",
++ unw_strerror(ret), ret);
++ procname[0] = '?';
++ procname[1] = 0;
++ }
++
++ if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname &&
++ *dlinfo.dli_fname)
++ filename = dlinfo.dli_fname;
++ else
++ filename = "?";
++
++ ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname,
++ ret == -UNW_ENOMEM ? "..." : "", (int)off,
++ (void *)(pip.start_ip + off));
++
++ ret = unw_step(&cursor);
++ if (ret < 0)
++ ErrorFSigSafe("unw_step failed: %s [%d]\n", unw_strerror(ret), ret);
++ }
++ ErrorFSigSafe("\n");
++}
++#else /* HAVE_LIBUNWIND */
+ #ifdef HAVE_BACKTRACE
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+@@ -246,3 +320,4 @@ xorg_backtrace(void)
+
+ #endif
+ #endif
++#endif
+--
+1.8.1.2
+
diff --git a/debian/patches/series b/debian/patches/series
index eaea7d4..5a913a9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -34,6 +34,9 @@ drm_device_keep_trying.patch
111_armel-drv-fallbacks.patch
500_pointer_barrier_thresholds.diff
+## upstream patches
+os-use-libunwind-to-generate-backtraces.patch
+
# hybrid graphics fixes for xserver 1.13
228_autobind_gpu.patch
Reply to: