Your message dated Thu, 20 Jul 2006 06:03:25 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#377287: fixed in libsdl1.2 1.2.11-1
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libsdl1.2debian
Version: 1.2.10-3
Severity: normal
Tags: patch

Nexuiz uses SDL's OpenGL stuff, but HW acceleration doesn't work. It
works fine with other games that use OGL directly. Glxinfo also
shows that HW acceleration is activated.

What's happening:
,-----------
| [EMAIL PROTECTED]:/tmp/src$ glxinfo 2>/dev/null | grep renderer
| OpenGL renderer string: Mesa DRI R300 20040924 AGP 8x TCL
| [EMAIL PROTECTED]:/home/greek0$ LIBGL_DEBUG=verbose nexuiz
| ...
| ^7Starting video system
| ^7Video: fullscreen 640x480x32x60hz
| ^7Linked against SDL version 1.2.10
| ^7Using SDL library version 1.2.10
| libGL: XF86DRIGetClientDriverName: 4.0.3 r300 (screen 0)
| libGL: OpenDriver: trying /usr/lib/dri/r300_dri.so
| libGL error: dlopen /usr/lib/dri/r300_dri.so failed 
(/usr/lib/dri/r300_dri.so: undefined symbol: _glapi_Dispatch)
| libGL error: unable to find driver: r300_dri.so
| ^7checking for OpenGL 1.1.0...  enabled
| ^7GL_VENDOR: Mesa project: www.mesa3d.org
| ^7GL_RENDERER: Mesa GLX Indirect
| ^7GL_VERSION: 1.2 (1.5 Mesa 6.4.2)
| ...
`-----------

So it tries to load r300_dri, but it doesn't work, because there are
missing symbols. After a bit of googling I found this:
http://www.mail-archive.com/[email protected]/msg26006.html

The workaround proposed there (preloading libGL.so.1) actually
works.

Looking at the source, SDL really uses dlopen() without RTLD_GLOBAL.
X11_GL_LoadLibrary() calls SDL_LoadObject(), and on Linux the
implementation in src/loadso/dlopen/SDL_sysloadso.c is used. There
we can see:
,-----------
| void *handle = dlopen(sofile, RTLD_NOW);
`-----------

As Drepper writes[1], using RTLD_GLOBAL generally isn't a good idea,
but libGL seems to require it:
http://dri.sourceforge.net/doc/DRIuserguide.html#s11

So the attached patch introduces a new static function
SDL_LoadObject_LibGL() in src/video/x11/SDL_x11gl.c, which does the
same as SDL_LoadObject, but uses RTLD_GLOBAL. If SDL_LOADSO_DLOPEN
is not defined (i.e. not the dlopen SDL_LoadObject implementation is
used, but another one), the patch doesn't touch anything.

It fixes the bug for me and shouldn't cause any other problems
AFAICS.

After writing all this I see that there's a simmilar patch in the
SDL svn repository, cf. commit 2523:
http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/video/x11/SDL_x11gl.c?view=log

Would be nice if you could apply either one of the patches to fix
this problem, thanks.

Cheers,
Christian Aichinger

[1] <URL:http://people.redhat.com/drepper/dsohowto.pdf>, Page 9

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17.2-vs2.1.1-rc23-iphigenie
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)

Versions of packages libsdl1.2debian depends on:
ii  libsdl1.2debian-alsa          1.2.10-3   Simple DirectMedia Layer (with X11

libsdl1.2debian recommends no packages.

-- no debconf information
diff -Nur libsdl1.2-1.2.10.orig/src/video/x11/SDL_x11gl.c 
libsdl1.2-1.2.10/src/video/x11/SDL_x11gl.c
--- libsdl1.2-1.2.10.orig/src/video/x11/SDL_x11gl.c     2006-05-17 
05:16:07.000000000 +0200
+++ libsdl1.2-1.2.10/src/video/x11/SDL_x11gl.c  2006-07-07 23:27:16.000000000 
+0200
@@ -447,6 +447,25 @@
 
 #if SDL_VIDEO_OPENGL_GLX
 
+/* We need this because libGL.so needs RTLD_GLOBAL to work, but SDL_LoadObject
+ * doesn't use it normally (for good reasons) */
+#ifdef SDL_LOADSO_DLOPEN
+#include <stdio.h>
+#include <dlfcn.h>
+
+static void *SDL_LoadObject_LibGL(const char *sofile)
+{
+       void *handle = dlopen(sofile, RTLD_NOW | RTLD_GLOBAL);
+       const char *loaderror = (char *)dlerror();
+       if ( handle == NULL ) {
+               SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+       }
+       return(handle);
+}
+#else
+#define SDL_LoadObject_LibGL(sofile) SDL_LoadObject(sofile)
+#endif
+
 /* Passing a NULL path means load pointers from the application */
 int X11_GL_LoadLibrary(_THIS, const char* path) 
 {
@@ -464,7 +483,7 @@
                }
        }
 
-       handle = SDL_LoadObject(path);
+       handle = SDL_LoadObject_LibGL(path);
        if ( handle == NULL ) {
                /* SDL_LoadObject() will call SDL_SetError() for us. */
                return -1;

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: libsdl1.2
Source-Version: 1.2.11-1

We believe that the bug you reported is fixed in the latest version of
libsdl1.2, which is due to be installed in the Debian FTP archive:

libsdl1.2-dev_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2-dev_1.2.11-1_i386.deb
libsdl1.2_1.2.11-1.diff.gz
  to pool/main/libs/libsdl1.2/libsdl1.2_1.2.11-1.diff.gz
libsdl1.2_1.2.11-1.dsc
  to pool/main/libs/libsdl1.2/libsdl1.2_1.2.11-1.dsc
libsdl1.2_1.2.11.orig.tar.gz
  to pool/main/libs/libsdl1.2/libsdl1.2_1.2.11.orig.tar.gz
libsdl1.2debian-all_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-all_1.2.11-1_i386.deb
libsdl1.2debian-alsa_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-alsa_1.2.11-1_i386.deb
libsdl1.2debian-arts_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-arts_1.2.11-1_i386.deb
libsdl1.2debian-esd_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-esd_1.2.11-1_i386.deb
libsdl1.2debian-nas_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-nas_1.2.11-1_i386.deb
libsdl1.2debian-oss_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-oss_1.2.11-1_i386.deb
libsdl1.2debian-udeb_1.2.11-1_i386.udeb
  to pool/main/libs/libsdl1.2/libsdl1.2debian-udeb_1.2.11-1_i386.udeb
libsdl1.2debian_1.2.11-1_i386.deb
  to pool/main/libs/libsdl1.2/libsdl1.2debian_1.2.11-1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Sam Hocevar (Debian packages) <[EMAIL PROTECTED]> (supplier of updated 
libsdl1.2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 20 Jul 2006 14:17:18 +0200
Source: libsdl1.2
Binary: libsdl1.2debian-oss libsdl1.2debian-alsa libsdl1.2debian-arts 
libsdl1.2debian libsdl1.2-dev libsdl1.2debian-udeb libsdl1.2debian-nas 
libsdl1.2debian-esd libsdl1.2debian-all
Architecture: source i386
Version: 1.2.11-1
Distribution: unstable
Urgency: low
Maintainer: Debian SDL packages maintainers <[EMAIL PROTECTED]>
Changed-By: Sam Hocevar (Debian packages) <[EMAIL PROTECTED]>
Description: 
 libsdl1.2-dev - Simple DirectMedia Layer development files
 libsdl1.2debian - Simple DirectMedia Layer
 libsdl1.2debian-all - Simple DirectMedia Layer (with all available options)
 libsdl1.2debian-alsa - Simple DirectMedia Layer (with X11 and ALSA options)
 libsdl1.2debian-arts - Simple DirectMedia Layer (with X11 and aRts options)
 libsdl1.2debian-esd - Simple DirectMedia Layer (with X11 and esound options)
 libsdl1.2debian-nas - Simple DirectMedia Layer (with X11 and NAS options)
 libsdl1.2debian-oss - Simple DirectMedia Layer (with X11 and OSS options)
 libsdl1.2debian-udeb - Simple DirectMedia Layer (with directfb graphics and no 
sound) (udeb)
Closes: 373756 375822 377287
Changes: 
 libsdl1.2 (1.2.11-1) unstable; urgency=low
 .
   * New upstream release.
   * Upstream now uses pkgconfig, we ship the .pc files.
   * Upstream fixed SDL_SetGamma() (Closes: #373756).
   * Upstream fixed dynamic DRI support loading (Closes: #377287).
 .
   * debian/patches/000_no_yasm.diff:
     + Do not try to detect yasm, it will fail to build. We want nasm.
 .
   * debian/patches/000_unlibfoolise.diff:
     + Removed ugly stuff from acinclude.m4.
 .
   * debian/patches/000_builddir_support.diff:
     + Fix alternate build directory support.
 .
   * debian/patches/100_dont_propagate_lpthread.diff:
     + Do not propagate -lpthread to sdl-config --libs (Closes: #375822).
Files: 
 3805a7a97a4944d6550cbc9f2e5cb59c 1498 libs optional libsdl1.2_1.2.11-1.dsc
 418b42956b7cd103bfab1b9077ccc149 2796407 libs optional 
libsdl1.2_1.2.11.orig.tar.gz
 744cd6b591f400b4c8d9dd49460ce60d 281862 libs optional 
libsdl1.2_1.2.11-1.diff.gz
 a4c8ae570c2f10e07bd70e62cca87b15 20110 libs optional 
libsdl1.2debian_1.2.11-1_i386.deb
 f696e07180e9bef124f4ab6c89c2aa18 215812 libs optional 
libsdl1.2debian-all_1.2.11-1_i386.deb
 87ee04bc201575772531bb3305d61bb2 208284 libs extra 
libsdl1.2debian-alsa_1.2.11-1_i386.deb
 3a11a0789309f2515b4a0cf291437ebe 208952 libs extra 
libsdl1.2debian-oss_1.2.11-1_i386.deb
 e5ad6d867896f207d42dad0504280c59 207318 libs extra 
libsdl1.2debian-esd_1.2.11-1_i386.deb
 20ad87b7d503097970fd0d7a8eb62503 207282 libs extra 
libsdl1.2debian-arts_1.2.11-1_i386.deb
 ad34066d1bf9b54f957f2ab87d89a80c 206134 libs extra 
libsdl1.2debian-nas_1.2.11-1_i386.deb
 79b066ccf994dfe3d6f90f49fd7bded0 117458 debian-installer extra 
libsdl1.2debian-udeb_1.2.11-1_i386.udeb
 5fdda5e097795388fd0ed493692dfbe7 735784 libdevel optional 
libsdl1.2-dev_1.2.11-1_i386.deb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEv3hrfPP1rylJn2ERAsKuAJ0VIwLyUrzzSaR0jpAiAKrXVdZspQCggr76
NIg6xjOn9dTcKNR8CEhhmvo=
=m+bi
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to