Your message dated Sat, 20 Apr 2013 21:28:56 +0100
with message-id <1366489736.23177.65.ca...@jacala.jungle.funky-badger.org>
and subject line Re: Bug#699375: unblock: libvdpau/0.4.1-8
has caused the Debian Bug report #699375,
regarding unblock: libvdpau/0.4.1-8
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
699375: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699375
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package libvdpau

Hi,

libvdpau may cause a segfault if it is dlopen()ed and thereafter
dlclosed() before XCloseDisplay() is called. See the patch description
for more details.

I've cherry-picked a patch from upstream git that fixes this. Thanks go
to Anssi Hannula who wrote a small testcase to demonstrate the problem
and explained me how I could check that it is actually fixed with this
patch.

Andreas

unblock libvdpau/0.4.1-8
diffstat for libvdpau-0.4.1 libvdpau-0.4.1

 changelog                                                      |   12 -
 control                                                        |    3 
 copyright                                                      |    4 
 libvdpau1.symbols                                              |    1 
 patches/0003-Fix-leaked-extension-info-on-library-unload.patch |  113 ++++++++++
 patches/series                                                 |    2 
 6 files changed, 130 insertions(+), 5 deletions(-)

diff -Nru libvdpau-0.4.1/debian/changelog libvdpau-0.4.1/debian/changelog
--- libvdpau-0.4.1/debian/changelog	2012-08-16 02:21:22.000000000 +0200
+++ libvdpau-0.4.1/debian/changelog	2013-01-27 01:49:31.000000000 +0100
@@ -1,3 +1,13 @@
+libvdpau (0.4.1-8) unstable; urgency=low
+
+  * Update my email address and remove DMUA.
+  * Cherry-pick upstream commit 837c63d from 0.5+git:
+    0003-Fix-leaked-extension-info-on-library-unload.patch  (Closes: #592204)
+  * libvdpau1.symbols: Add _vdp_DRI2RemoveExtension, added in above patch.
+  * Change Upstream-Contact to vd...@lists.freedesktop.org.
+
+ -- Andreas Beckmann <a...@debian.org>  Sun, 27 Jan 2013 01:49:23 +0100
+
 libvdpau (0.4.1-7) unstable; urgency=low
 
   * The last (and only) reverse dependency of lib32vdpau1 was the non-free
@@ -53,7 +63,7 @@
     (Closes: #616264)
   * track_dynamic_library_handles_and_free_them_on_exit.patch: Pick upstream
     commit 4262513e: "vdpau_wrapper.c: Track dynamic library handles and free
-    them on exit using __attribute__((destructor))".  This could fix #592204.
+    them on exit using __attribute__((destructor))".
   * Switch to debhelper 8.
   * Switch to dh-autoreconf: add to B-D, use dh --with autoreconf and drop
     autoreconf_-fi.patch.
diff -Nru libvdpau-0.4.1/debian/control libvdpau-0.4.1/debian/control
--- libvdpau-0.4.1/debian/control	2012-08-16 02:21:22.000000000 +0200
+++ libvdpau-0.4.1/debian/control	2013-01-27 01:49:31.000000000 +0100
@@ -6,8 +6,7 @@
  Jean-Yves Avenard <jyaven...@gmail.com>,
  Andres Mejia <ame...@debian.org>,
  Russ Allbery <r...@debian.org>,
- Andreas Beckmann <deb...@abeckmann.de>,
-DM-Upload-Allowed: yes
+ Andreas Beckmann <a...@debian.org>,
 Build-Depends:
  debhelper (>= 9),
  dh-autoreconf,
diff -Nru libvdpau-0.4.1/debian/copyright libvdpau-0.4.1/debian/copyright
--- libvdpau-0.4.1/debian/copyright	2012-08-16 02:21:22.000000000 +0200
+++ libvdpau-0.4.1/debian/copyright	2013-01-27 01:49:31.000000000 +0100
@@ -1,6 +1,6 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: VDPAU wrapper and trace libraries
-Upstream-Contact: Aaron Plattner <aplatt...@nvidia.com>
+Upstream-Contact: <vd...@lists.freedesktop.org>
 Source: http://people.freedesktop.org/~aplattner/vdpau/
 
 Files: *
@@ -10,7 +10,7 @@
 
 Files: debian/*
 Copyright: 2009-2012 Andres Mejia <mcita...@gmail.com>
-           2010-2012 Andreas Beckmann <deb...@abeckmann.de>
+           © 2010-2013 Andreas Beckmann <a...@debian.org>
            2010 Russ Allbery <r...@debian.org>
 License: Expat
 
diff -Nru libvdpau-0.4.1/debian/libvdpau1.symbols libvdpau-0.4.1/debian/libvdpau1.symbols
--- libvdpau-0.4.1/debian/libvdpau1.symbols	2012-08-16 02:21:22.000000000 +0200
+++ libvdpau-0.4.1/debian/libvdpau1.symbols	2013-01-27 01:49:31.000000000 +0100
@@ -2,6 +2,7 @@
  _vdp_DRI2Connect@Base 0.4
  _vdp_DRI2QueryExtension@Base 0.4
  _vdp_DRI2QueryVersion@Base 0.4
+ _vdp_DRI2RemoveExtension@Base 0.4.1-8~
  init_config@Base 0.4.1-6~
  init_fixes@Base 0.4.1-6~
  vdp_device_create_x11@Base 0.2
diff -Nru libvdpau-0.4.1/debian/patches/0003-Fix-leaked-extension-info-on-library-unload.patch libvdpau-0.4.1/debian/patches/0003-Fix-leaked-extension-info-on-library-unload.patch
--- libvdpau-0.4.1/debian/patches/0003-Fix-leaked-extension-info-on-library-unload.patch	1970-01-01 01:00:00.000000000 +0100
+++ libvdpau-0.4.1/debian/patches/0003-Fix-leaked-extension-info-on-library-unload.patch	2013-01-27 01:49:31.000000000 +0100
@@ -0,0 +1,113 @@
+From 3b43955c7324e1d213a3134387767722f34e2356 Mon Sep 17 00:00:00 2001
+From: Robert Morell <rmor...@nvidia.com>
+Date: Tue, 22 Jan 2013 13:26:56 -0800
+Subject: [PATCH 3/3] Fix leaked extension info on library unload
+
+In this sequence:
+dlopen(libvdpau.so)
+vdp_device_create_x11(dpy, ...)
+dlclose(libvdpau.so)
+XCloseDisplay(dpy)
+
+the process will attempt to call the address at which DRI2CloseDisplay
+was previously mapped, possibly resulting in a SEGV.
+
+Instead of tracking displays to which we've added hooks and cleaning up
+the extension on library unload or display close, simply clean up after
+ourselves once we have the data we need.
+
+Signed-off-by: Robert Morell <rmor...@nvidia.com>
+Reviewed-by: Aaron Plattner <aplatt...@nvidia.com>
+Tested-by: Aaron Plattner <aplatt...@nvidia.com>
+Signed-off-by: Aaron Plattner <aplatt...@nvidia.com>
+---
+ src/mesa_dri2.c     |   19 +++++++++++++++++--
+ src/mesa_dri2.h     |    3 +++
+ src/vdpau_wrapper.c |    3 +++
+ 3 files changed, 23 insertions(+), 2 deletions(-)
+
+diff --git a/src/mesa_dri2.c b/src/mesa_dri2.c
+index dbf9aa8..3bc75ef 100644
+--- a/src/mesa_dri2.c
++++ b/src/mesa_dri2.c
+@@ -42,7 +42,6 @@
+ 
+ static char dri2ExtensionName[] = DRI2_NAME;
+ static XExtensionInfo *dri2Info;
+-static XEXT_GENERATE_CLOSE_DISPLAY (DRI2CloseDisplay, dri2Info)
+ 
+ static /* const */ XExtensionHooks dri2ExtensionHooks = {
+   NULL,                   /* create_gc */
+@@ -51,7 +50,7 @@ static /* const */ XExtensionHooks dri2ExtensionHooks = {
+   NULL,                   /* free_gc */
+   NULL,                   /* create_font */
+   NULL,                   /* free_font */
+-  DRI2CloseDisplay,       /* close_display */
++  NULL,                   /* close_display */
+   NULL,                   /* wire_to_event */
+   NULL,                   /* event_to_wire */
+   NULL,                   /* error */
+@@ -75,6 +74,14 @@ _vdp_DRI2QueryExtension(Display * dpy, int *eventBase, int *errorBase)
+       return True;
+    }
+ 
++   if (dri2Info) {
++      if (info) {
++         XextRemoveDisplay(dri2Info, dpy);
++      }
++      XextDestroyExtension(dri2Info);
++      dri2Info = NULL;
++   }
++
+    return False;
+ }
+ 
+@@ -161,3 +168,11 @@ _vdp_DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName
+ 
+    return True;
+ }
++
++void
++_vdp_DRI2RemoveExtension(Display * dpy)
++{
++   XextRemoveDisplay(dri2Info, dpy);
++   XextDestroyExtension(dri2Info);
++   dri2Info = NULL;
++}
+diff --git a/src/mesa_dri2.h b/src/mesa_dri2.h
+index 5c5fb12..09bde8c 100644
+--- a/src/mesa_dri2.h
++++ b/src/mesa_dri2.h
+@@ -47,4 +47,7 @@ extern Bool
+ _vdp_DRI2Connect(Display * display, XID window, char **driverName,
+                  char **deviceName);
+ 
++extern void
++_vdp_DRI2RemoveExtension(Display * display);
++
+ #endif
+diff --git a/src/vdpau_wrapper.c b/src/vdpau_wrapper.c
+index a1d5d40..d847a87 100644
+--- a/src/vdpau_wrapper.c
++++ b/src/vdpau_wrapper.c
+@@ -86,14 +86,17 @@ static char * _vdp_get_driver_name_from_dri2(
+ 
+     if (!_vdp_DRI2QueryVersion(display, &major, &minor) ||
+             (major < 1 || (major == 1 && minor < 2))) {
++        _vdp_DRI2RemoveExtension(display);
+         return NULL;
+     }
+ 
+     if (!_vdp_DRI2Connect(display, root, &driver_name, &device_name)) {
++        _vdp_DRI2RemoveExtension(display);
+         return NULL;
+     }
+ 
+     XFree(device_name);
++    _vdp_DRI2RemoveExtension(display);
+ #endif /* DRI2 */
+     return driver_name;
+ }
+-- 
+1.7.10.4
+
diff -Nru libvdpau-0.4.1/debian/patches/series libvdpau-0.4.1/debian/patches/series
--- libvdpau-0.4.1/debian/patches/series	2012-08-16 02:21:22.000000000 +0200
+++ libvdpau-0.4.1/debian/patches/series	2013-01-27 01:49:31.000000000 +0100
@@ -1,3 +1,5 @@
+0003-Fix-leaked-extension-info-on-library-unload.patch
+
 track_dynamic_library_handles_and_free_them_on_exit.patch
 link-with-libx11.patch
 simplify-dlopen-path-length-error-handling.patch

--- End Message ---
--- Begin Message ---
On Wed, 2013-01-30 at 20:44 +0100, Andreas Beckmann wrote:
> On 2013-01-30 20:18, Julien Cristau wrote:
> > On Wed, Jan 30, 2013 at 20:07:48 +0100, Andreas Beckmann wrote:
> >> libvdpau may cause a segfault if it is dlopen()ed and thereafter
> >> dlclosed() before XCloseDisplay() is called. See the patch description
> >> for more details.
> >>
> > Who does that?
> 
> Applications not linked against libvdpau. I'm not sure whether there are
> any packages in Debian left doing dlopen(libvdpau) - and they are not
> easy to spot as they probably won't depend on libvdpau. Also the
> segfault will usually happen during application shutdown, so it may go
> unnoticed by the user (for gui apps started from the menu with no shell
> that shows the error).
> 
> xbmc-bin is a possible candidate as it only Recommends: libvdpau1

Unfortunately the request for confirmation in #592204 appears to have
received no replies and I'm not convinced that this issue is RC, so I'm
afraid we're going to have to decline this for r0 at least.

Regards,

Adam

--- End Message ---

Reply via email to