Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2013-01-27 Thread Andreas Beckmann
On 2013-01-26 23:02, Anssi Hannula wrote:
 I'm not 100% sure if this is even supposed to work, but at the very
 least it is rather fishy. Anyway, the libvdpau part has been fixed, and
 it of course fixes the issue on all those cases where the main program
 is directly linked against libXext.so.6 (which I guess most VDPAU users
 are, except for my testcase) as that the libXext callbacks will always
 be present at XCloseDisplay() time.

Thanks for the clarification. Adding -lXext makes your program work
properly. I have now cherry-picked this patch and uploaded it to sid,
perhaps we can still get this into wheezy.


Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2013-01-26 Thread Anssi Hannula
25.01.2013 23:36, Andreas Beckmann kirjoitti:
 Control: tag -1 moreinfo
 
 Hi Anssi,

Hi!

 On 2012-03-06 02:10, Anssi Hannula wrote:
 Testcase attached. Also, this is a libvdpau bug, not a
 nvidia-vdpau-driver one. It crashes with all drivers, whether VDPAU is
 supported or not (as the bug is caused by the probing code in libvdpau).
 
 I just noticed that there is now an upstream commit that should fix this
 (3b43955c7324e1d213a3134387767722f34e2356), but so far I could still
 reproduce the segfault with your test program.
 Anyway, I just uploaded (to experimental) 0.5-1 including all upstream
 commits that were done after the upstream release of 0.5.
 
 Perhaps you can have a look at this again.

There is an identical issue in libXext.so which is triggered by the use
of Xext in libvdpau.so.

Aaron Plattner from upstream has posted a testcase which workarounds the
libXext.so issue:
http://lists.freedesktop.org/archives/vdpau/2013-January/45.html

The libXext.so issue can be reproduced easily without libvdpau
involvement by dlopening it, calling e.g. XGEQueryVersion() or
XSyncQueryExtension() (two examples I just randomly picked up), and then
dlclosing it before calling XCloseDisplay(). Testcase attached for that.

I'm not 100% sure if this is even supposed to work, but at the very
least it is rather fishy. Anyway, the libvdpau part has been fixed, and
it of course fixes the issue on all those cases where the main program
is directly linked against libXext.so.6 (which I guess most VDPAU users
are, except for my testcase) as that the libXext callbacks will always
be present at XCloseDisplay() time.

-- 
Anssi Hannula

/*
 * Testcase for libXext segmentation fault on unload due to handlers
 * installed to be run at display close time.
 *
 * Written by Anssi Hannula an...@mageia.org
 *
 * gcc -o libxext-dlopen-crash libxext-dlopen-crash.c -lX11 -ldl
 */

#include X11/Xlib.h
#include stdio.h
#include stdlib.h
#include dlfcn.h

int main() {
	Display *dpy;
	void *libxext;
	char *error;
	int a, b;
	Bool (*XGEQueryVersion)(Display* dpy, int *major, int* minor);
	Status (*XSyncQueryExtension)(Display*, int *event_base_return, int *error_base_return);

	dpy = XOpenDisplay(NULL);
	if (!dpy) {
		fprintf(stderr, Unable to open display.);
		return EXIT_FAILURE;
	}

	libxext = dlopen(libXext.so.6, RTLD_LAZY);
	if (!libxext) {
		fprintf(stderr, %s\n, dlerror());
		return EXIT_FAILURE;
	}

	*(void **) (XGEQueryVersion) = dlsym(libxext, XGEQueryVersion);
	if ((error = dlerror()) != NULL) {
		fprintf(stderr, %s\n, error);
		return EXIT_FAILURE;
	}

	*(void **) (XSyncQueryExtension) = dlsym(libxext, XSyncQueryExtension);
	if ((error = dlerror()) != NULL) {
		fprintf(stderr, %s\n, error);
		return EXIT_FAILURE;
	}

	// Either of these is enough to cause a crash. Test both of them.
	XGEQueryVersion(dpy, a, b);
	XSyncQueryExtension(dpy, a, b);

	if (dlclose(libxext)) {
		fprintf(stderr, %s\n, dlerror());
		return EXIT_FAILURE;
	}

	puts(Calling XCloseDisplay() - this will segfault if handlers were installed.);
	XCloseDisplay(dpy);

	return 0;
}



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2013-01-25 Thread Andreas Beckmann
Control: tag -1 moreinfo

Hi Anssi,

On 2012-03-06 02:10, Anssi Hannula wrote:
 Testcase attached. Also, this is a libvdpau bug, not a
 nvidia-vdpau-driver one. It crashes with all drivers, whether VDPAU is
 supported or not (as the bug is caused by the probing code in libvdpau).

I just noticed that there is now an upstream commit that should fix this
(3b43955c7324e1d213a3134387767722f34e2356), but so far I could still
reproduce the segfault with your test program.
Anyway, I just uploaded (to experimental) 0.5-1 including all upstream
commits that were done after the upstream release of 0.5.

Perhaps you can have a look at this again.

Note, there seems to be a new contact address for vdpau:
  vd...@lists.freedesktop.org


Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2012-03-05 Thread Anssi Hannula
21.02.2012 12:55, Andreas Beckmann kirjoitti:
 On 2011-09-15 16:20, Andreas Beckmann wrote:
 On 2010-08-25 03:33, Andreas Beckmann wrote:
 On Sunday, 8. August 2010 09:06:37 Andres Mejia wrote:
 For apps such as xbmc or mplayer that use vdpau for video output, calling
 XCloseDisplay results in a segfault. Simple test would be to run

 I could reproduce this with mplayer from Debian (but not the one from 
 debian-multimedia.org) and driver 195.36.31. Stacktrace looked like this:

 I just tried again, but I could no longer reproduce this with libvdpau1
 0.4.1-2 (testing), 0.4.1-3 (unstable, should have a fix for this issue)
 or 0.4-1 (snapshot.d.o, probably the version I used to reproduce this
 last year) and mplayer from squeeze and wheezy.

 But then, over the last year a lot has changed: X, mplayer, libs, nvidia
 driver ...

 Andres, can you still reproduce this?
 
 Ping. Any test result?
 If noone can still reproduce this I'll close this bug as fixed in 4 weeks.

Testcase attached. Also, this is a libvdpau bug, not a
nvidia-vdpau-driver one. It crashes with all drivers, whether VDPAU is
supported or not (as the bug is caused by the probing code in libvdpau).

-- 
Anssi Hannula

/*
 * Testcase for Debian bug #592204.
 * This will trigger a segmentation fault.
 *
 * Written by Anssi Hannula an...@mageia.org
 *
 * gcc -o vdpau-debian-592204 vdpau-debian-592204.c -lX11 -ldl
 */

#include X11/Xlib.h
#include vdpau/vdpau_x11.h
#include stdio.h
#include stdlib.h
#include dlfcn.h

int main() {
	Display *dpy;
	void *libvdpau;
	VdpDeviceCreateX11 *vdp_create;
	VdpGetProcAddress *vdp_get_proc_address;
	VdpDeviceDestroy *vdp_destroy;
	char *error;
	VdpStatus status;
	VdpDevice device;

	dpy = XOpenDisplay(NULL);
	if (!dpy) {
		fprintf(stderr, Unable to open display.);
		return EXIT_FAILURE;
	}

	libvdpau = dlopen(libvdpau.so.1, RTLD_LAZY);
	if (!libvdpau) {
		fprintf(stderr, %s\n, dlerror());
		return EXIT_FAILURE;
	}
	*(void **) (vdp_create) = dlsym(libvdpau, vdp_device_create_x11);

	if ((error = dlerror()) != NULL) {
		fprintf(stderr, %s\n, error);
		return EXIT_FAILURE;
	}

	status = vdp_create(dpy, DefaultScreen(dpy), device, vdp_get_proc_address);
	if (status == VDP_STATUS_OK) {
		/* We don't actually have use for it, so destroy it immediately
		   if it was created successfully. Since the segfault is caused
		   by the probing code in libvdpau, it will happen regardless of
		   whther device creation succeeded or not. */

		status = vdp_get_proc_address(device, VDP_FUNC_ID_DEVICE_DESTROY, (void*)vdp_destroy);
		if (status != VDP_STATUS_OK) {
			fprintf(stderr, Unable to get VdpDeviceDestroy.);
			return EXIT_FAILURE;
		}
		
		status = vdp_destroy(device);
		if (status != VDP_STATUS_OK) {
			fprintf(stderr, Unable to destroy VdpDevice.);
			return EXIT_FAILURE;
		}
	} else {
		puts(VDPAU device not created - it doesn't matter for this testcase.);
	}

	if (dlclose(libvdpau)) {
		fprintf(stderr, %s\n, dlerror());
		return EXIT_FAILURE;
	}

	puts(Calling XCloseDisplay() - this will segfault.);
	XCloseDisplay(dpy);
}



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2012-02-21 Thread Andreas Beckmann
On 2011-09-15 16:20, Andreas Beckmann wrote:
 On 2010-08-25 03:33, Andreas Beckmann wrote:
 On Sunday, 8. August 2010 09:06:37 Andres Mejia wrote:
 For apps such as xbmc or mplayer that use vdpau for video output, calling
 XCloseDisplay results in a segfault. Simple test would be to run
 
 I could reproduce this with mplayer from Debian (but not the one from 
 debian-multimedia.org) and driver 195.36.31. Stacktrace looked like this:
 
 I just tried again, but I could no longer reproduce this with libvdpau1
 0.4.1-2 (testing), 0.4.1-3 (unstable, should have a fix for this issue)
 or 0.4-1 (snapshot.d.o, probably the version I used to reproduce this
 last year) and mplayer from squeeze and wheezy.
 
 But then, over the last year a lot has changed: X, mplayer, libs, nvidia
 driver ...
 
 Andres, can you still reproduce this?

Ping. Any test result?
If noone can still reproduce this I'll close this bug as fixed in 4 weeks.


Andreas



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: [pkg-nvidia-devel] Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2011-09-15 Thread Andreas Beckmann
On 2010-08-25 03:33, Andreas Beckmann wrote:
 On Sunday, 8. August 2010 09:06:37 Andres Mejia wrote:
 For apps such as xbmc or mplayer that use vdpau for video output, calling
 XCloseDisplay results in a segfault. Simple test would be to run

 I could reproduce this with mplayer from Debian (but not the one from 
 debian-multimedia.org) and driver 195.36.31. Stacktrace looked like this:

I just tried again, but I could no longer reproduce this with libvdpau1
0.4.1-2 (testing), 0.4.1-3 (unstable, should have a fix for this issue)
or 0.4-1 (snapshot.d.o, probably the version I used to reproduce this
last year) and mplayer from squeeze and wheezy.

But then, over the last year a lot has changed: X, mplayer, libs, nvidia
driver ...

Andres, can you still reproduce this? (Especially test with libvdpau1
both from testing and unstable).

Thanks


Andreas



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2010-12-20 Thread Andreas Beckmann
reassign 592204 libvdpau1 0.4-1
tags 592204 upstream
forwarded 592204 Aaron Plattner
thanks

Thanks for the info, reassigning to libvdpau1.

Andreas

On 2010-12-14 23:55, Anssi Hannula wrote:
 This is a libvdpau issue (regression), as figured out by a fellow XBMC
 dev (bobo1on1).



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2010-12-14 Thread Anssi Hannula
This is a libvdpau issue (regression), as figured out by a fellow XBMC
dev (bobo1on1).

When libvdpau uses dri2 to figure out the driver name, it installs a
callback to be run when the Display* is closed. However, if libvdpau is
loaded with dlopen() and a dlclose() is done before the Display is
closed, a segfault will happen at XCloseDisplay() time as the callback
function no longer exists.

This issue was just reported to Aaron Plattner.

-- 
Anssi Hannula



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2010-09-21 Thread Andreas Beckmann
On Wednesday, 25. August 2010 03:33:38 Andreas Beckmann wrote:
 I could reproduce this with mplayer from Debian (but not the one from
 debian-multimedia.org) and driver 195.36.31. Stacktrace looked like this:
...
 Let's check this again once we got 256.xx driver packages out ... and
 report to upstream if the problem still exists.

256.53-1 is in experimental, but I can't test it right now. Can you try it? 
And test with the new libvdpau, too.


Andreas



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2010-08-24 Thread Andreas Beckmann
found 592204 195.36.31-2
severity 592204 normal
tags 592204 upstream
thanks

On Sunday, 8. August 2010 09:06:37 Andres Mejia wrote:
 Not sure whether this is a problem with NVIDIA's VDPAU driver or with
 libvdpau, but I'm fairly certain this is in relation to the driver.

 For apps such as xbmc or mplayer that use vdpau for video output, calling
 XCloseDisplay results in a segfault. Simple test would be to run

I could reproduce this with mplayer from Debian (but not the one from 
debian-multimedia.org) and driver 195.36.31. Stacktrace looked like this:

#0  0x7fffe7d96580 in ?? ()
#1  0x77630e92 in XCloseDisplay () from usr/lib/libX11.so.6
#2  0x004b5a17 in vo_uninit ()
#3  0x00454551 in exit_player_with_rc ()
#4  0x0046041f in run_command ()
#5  0x004568e8 in main ()

Let's check this again once we got 256.xx driver packages out ... and report 
to upstream if the problem still exists.


Andreas



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#592204: nvidia-vdpau-driver: Segfault on VDPAU using apps that call XCloseDisplay

2010-08-08 Thread Andres Mejia
Package: nvidia-vdpau-driver
Version: 195.36.24-4
Severity: important

Not sure whether this is a problem with NVIDIA's VDPAU driver or with libvdpau,
but I'm fairly certain this is in relation to the driver.

For apps such as xbmc or mplayer that use vdpau for video output, calling
XCloseDisplay results in a segfault. Simple test would be to run

$ mplayer -vo vdpau some_video.mp4

Fortunately, XCloseDisplay is called upon exiting these apps, so there isn't a
major problem with this bug.

-- Package-specific info:
uname -a:
Linux andres-desktop01 2.6.32-5-amd64 #1 SMP Fri Aug 6 00:38:23 UTC 2010 x86_64 
GNU/Linux

/proc/version:
Linux version 2.6.32-5-amd64 (Debian 2.6.32-19) (b...@decadent.org.uk) (gcc 
version 4.3.5 (Debian 4.3.5-2) ) #1 SMP Fri Aug 6 00:38:23 UTC 2010

/proc/driver/nvidia/version: 
NVRM version: NVIDIA UNIX x86_64 Kernel Module  195.36.24  Thu Apr 22 19:10:14 
PDT 2010
GCC version:  gcc version 4.3.5 (Debian 4.3.5-1) 

lspci 'VGA compatible controller [0300]':
02:00.0 VGA compatible controller [0300]: nVidia Corporation G96 [GeForce 9400 
GT] [10de:065b] (rev a1) (prog-if 00 [VGA controller])
Subsystem: ASUSTeK Computer Inc. Device [1043:82c7]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- TAbort- 
MAbort- SERR- PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 16
Region 0: Memory at b800 (32-bit, non-prefetchable) [size=16M]
Region 1: Memory at c000 (64-bit, prefetchable) [size=512M]
Region 3: Memory at b600 (64-bit, non-prefetchable) [size=32M]
Region 5: I/O ports at 2000 [size=128]
Expansion ROM at unassigned [disabled]
Capabilities: access denied
Kernel driver in use: nvidia


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages nvidia-vdpau-driver depends on:
ii  libc6 2.11.2-2   Embedded GNU C Library: Shared lib
ii  libvdpau1 0.4-5  Video Decode and Presentation API 
ii  libx11-6  2:1.3.3-3  X11 client-side library
ii  libxext6  2:1.1.2-1  X11 miscellaneous extension librar

Versions of packages nvidia-vdpau-driver recommends:
ii  nvidia-kernel-2.6. 195.36.24-1+2.6.32-13 NVIDIA binary kernel module for Li
ii  nvidia-kernel-dkms 195.36.24-4   NVIDIA binary kernel module DKMS s

Versions of packages nvidia-vdpau-driver suggests:
ii  nvidia-kernel-dkms   195.36.24-4 NVIDIA binary kernel module DKMS s
ii  nvidia-kernel-source 195.36.24-4 NVIDIA binary kernel module source

Versions of packages nvidia-glx depends on:
ii  dpkg   1.15.8.3  Debian package management system
ii  libc6  2.11.2-2  Embedded GNU C Library: Shared lib
ii  libx11-6   2:1.3.3-3 X11 client-side library
ii  libxext6   2:1.1.2-1 X11 miscellaneous extension librar
ii  nvidia-kernel-2.6. 195.36.24-1+2.6.32-13 NVIDIA binary kernel module for Li
ii  nvidia-kernel-dkms 195.36.24-4   NVIDIA binary kernel module DKMS s

Versions of packages nvidia-kernel-dkms depends on:
ii  dkms  2.1.1.2-5  Dynamic Kernel Module Support Fram
ii  nvidia-kernel-common  20100522+1 NVIDIA binary kernel module suppor

Versions of packages nvidia-kernel-source depends on:
ii  debhelper 8.0.0  helper programs for debian/rules
ii  make  3.81-8 An utility for Directing compilati
ii  quilt 0.48-7 Tool to work with series of patche

Versions of packages nvidia-vdpau-driver is related to:
ii  binutils 2.20.1-13   The GNU assembler, linker and bina
pn  binutils-goldnone  (no description available)
ii  linux-headers-2.6-amd64 [lin 2.6.32+28   Header files for Linux 2.6-amd64 (
ii  linux-headers-2.6.32-5-amd64 2.6.32-19   Header files for Linux 2.6.32-5-am
ii  nvidia-glx   195.36.24-4 NVIDIA binary Xorg driver
ii  nvidia-kernel-common 20100522+1  NVIDIA binary kernel module suppor
ii  nvidia-kernel-dkms   195.36.24-4 NVIDIA binary kernel module DKMS s
ii  nvidia-kernel-source 195.36.24-4 NVIDIA binary kernel module source
ii  xserver-xorg 1:7.5+6 the X.Org X server
ii  xserver-xorg-core2:1.7.7-3   Xorg X server - core server

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org