32bit libgl search for dri at wrong place on 64bit system

Bug #248392 reported by Lukas Hejtmanek
48
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Mesa
Fix Released
High
ia32-libs (Ubuntu)
Fix Released
Low
Alberto Milone
Karmic
Won't Fix
Undecided
Unassigned
Lucid
Fix Released
Low
Alberto Milone
mesa (Ubuntu)
Fix Released
High
Alberto Milone
Karmic
Won't Fix
Undecided
Chow Loong Jin
Lucid
Fix Released
High
Alberto Milone

Bug Description

Binary package hint: ia32-libs

On 64bit system using 32bit libGL results in not finding DRI module. It is because the libGL searches dri modules in /usr/lib/dri instead of /usr/lib32/dri where the 32bit dri modules are placed.

I'm using ubuntu/intrepid. ia32-libs 2.2ubuntu11

Tags: intrepid
Revision history for this message
Daniel T Chen (crimsun) wrote :

I presume this issue remains valid in 8.10?

Changed in ia32-libs:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Scott Ritchie (scottritchie) wrote :

If you are on Intel, I believe this may be the same issue as https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/352455

If you are on nvidia, I believe this is fixed: $ ldd /usr/lib32/libGL.so.1
 linux-gate.so.1 => (0xf7f84000)
 libGLcore.so.1 => /usr/lib32/libGLcore.so.1 (0xf6f58000)
 libnvidia-tls.so.1 => /usr/lib32/tls/libnvidia-tls.so.1 (0xf6f56000)
 libm.so.6 => /lib32/libm.so.6 (0xf6f2d000)
 libXext.so.6 => /usr/lib32/libXext.so.6 (0xf6f1d000)
 libX11.so.6 => /usr/lib32/libX11.so.6 (0xf6dee000)
 libdl.so.2 => /lib32/libdl.so.2 (0xf6dea000)
 libc.so.6 => /lib32/libc.so.6 (0xf6c92000)
 /lib/ld-linux.so.2 (0xf7f85000)
 libXau.so.6 => /usr/lib32/libXau.so.6 (0xf6c8e000)
 libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf6c6f000)
 libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf6c6a000)

If you are on ATI, I am not sure.

Changed in ia32-libs (Ubuntu):
assignee: nobody → Scott Ritchie (scottritchie)
status: Incomplete → In Progress
Revision history for this message
Scott Ritchie (scottritchie) wrote :

I believe I have fixed this with my latest upload of ia32-libs for Karmic -- if this is still an issue, please reopen. Thank you for reporting!

Changed in ia32-libs (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Julius Schwartzenberg (jschwart) wrote :

I still have this issue on Karmic. I am fully up to date.
I need to do:
export LIBGL_DRIVERS_PATH=/usr/lib32/dri

Before I can run 32-bit applications with OpenGL, otherwise they will fall back to software rendering (verified with LIBGL_DEBUG=verbose).

Changed in ia32-libs (Ubuntu):
status: Fix Released → New
Revision history for this message
Scott Ritchie (scottritchie) wrote :

Which applications, Julius? Were they built with ia32-libs in place?

I'm not sure what else can be done in the ia32-libs package itself, as we already ship all the /usr/lib/dri libraries in 32-bit form at /usr/lib32/dri

Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

Created an attachment (id=30758)
Additionally search in /usr/lib/dri/<host, e..g. i486-pc-linux.gnu>/ for DRI modules

On Ubuntu Karmic x86_64, all 32-bit applications which use DRI fail to have Direct Rendering due to libGL.so searching in /usr/lib/dri, which contains 64-bit DRI modules instead of /usr/lib32/dri.

One of the bugs that this has caused is http://bugs.winehq.org/show_bug.cgi?id=20448, which occurs in combination with http://bugs.freedesktop.org/show_bug.cgi?id=23335.

Revision history for this message
In , Julien Cristau (jcristau) wrote :

On Tue, Oct 27, 2009 at 11:40:05 -0700, <email address hidden> wrote:

> On Ubuntu Karmic x86_64, all 32-bit applications which use DRI fail to have
> Direct Rendering due to libGL.so searching in /usr/lib/dri, which contains
> 64-bit DRI modules instead of /usr/lib32/dri.
>
> One of the bugs that this has caused is
> http://bugs.winehq.org/show_bug.cgi?id=20448, which occurs in combination with
> http://bugs.freedesktop.org/show_bug.cgi?id=23335.

sounds like a packaging issue rather than a mesa bug?

Revision history for this message
Chow Loong Jin (hyperair) wrote :

An issue caused by this is WineD3D segfaulting (it should not happen if DRI works). I submitted a patch upstream at http://bugs.winehq.org/show_bug.cgi?id=20448.

As for the library at fault, it's /usr/lib32/libGL.so* extracted from libgl1-mesa-glx. The path "/usr/lib/dri" is hardcoded into that library. Running this: `sed -i -e 's,/usr/lib/dri,/usr/l32/dri,g' /usr/lib32/libGL.so.1.2`, and then symlinking /usr/l32 to /usr/lib32 is a hack-ish workaround that I've used to test out this theory, which works. (Note that I couldn't change it to /usr/lib32/dri directly because that changes the length and causes segfaults.)

Changed in ia32-libs (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

Well, the other way would be to recompile every 32-bit library within ia32-libs with --libdir=/usr/lib32, which doesn't seem like a particularly good idea to me either.

Revision history for this message
In , Dbn-lists (dbn-lists) wrote :

Why not just build mesa so that the paths are correct? There's even a switch, --with-dri-driverdir, that sets this correctly. I don't think things will work correctly if they get moved around after the installation. If Ubuntu multiarch uses /usr/lib32 for 32 bit libraries, why not just build with --libdir=/usr/lib32?

If we really want to extend the search path, I'd rather keep the current default and allow overriding with --with-dri-searchpath or something.

Changed in mesa (Ubuntu):
assignee: nobody → Chow Loong Jin (hyperair)
status: New → In Progress
Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

Building with --libdir=/usr/lib32 won't work, since 32-bit machines do use /usr/lib after all. The whole point of this was to avoid the requirement of rebuilding with different configure arguments, so that all the 32-bit libraries can be treated the same way (just repacking) for the multiarch ia32-libs package.

As for --with-dri-searchpath, I think that can be handled without too many changes to the build system. If you're sure you'd like it that way, I can come up with a patch to make it that way. I just don't have a lot of time to spare a the moment and don't want to come up with numerous patches that get rejected one by one.

Revision history for this message
In , Dbn-lists (dbn-lists) wrote :

I don't think you can have it both ways. If your system's ABI is 32 bit in /usr/lib32 and 64 bit in /usr/lib, then you should probably build the binaries that way. If you want your system's ABI to be compatible with a 32 bit only system, then put the 64 bit libraries in /usr/lib64 like everybody else.

Mesa libGL is certainly not the only library that dlopen's modules from private directories. What would you do about, say, gstreamer?

I would commit a patch that changes the search path via a configure argument as long as it doesn't change the default.

Revision history for this message
In , Corbin Simpson (mostawesomedude) wrote :

Multilib distributions always have extra baggage on their shoulders, and this is just one more bit of it. I'm really struggling to see how this is our problem when we've got not just a compile-time flag (--with-dri-driverdir) but also a run-time environment variable (LIBGL_DRIVERS_PATH) to configure this.

I'd like to close as NOTOURBUG, but I'd like to make sure that nobody else wants to follow up on this. I also heavily encourage the original reporter to follow up with Ubuntu directly.

Changed in mesa (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

@Dan Nicholson: Sticking 64-bit libraries into /usr/lib64 instead of /usr/lib would require changing Debian's packaging policy as well as every derivative of Debian's policy to accomodate one library that won't work otherwise.

I'm not actually sure about what the case is like for GStreamer. However, the approach I am proposing is actually used within Gtk for loading modules which are usually found in /usr/lib/gtk-2.0 (i.e. it also searches within /usr/lib/gtk-2.0/<GTK_HOST> where GTK_HOST is defined to the $host found from configure. In fact, https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/369498 is what I was referring to when I came up with the patch.

@Corbin Simpson: The compile time flag --with-dri-driverdir would fail if I set more than one path there, e.g. /usr/lib/dri:/usr/lib/dri/i486-pc-linux-gnu, and the LIBGL_DRIVERS_PATH environment variable would require that every 64-bit user running 32-bit OpenGL applications set the environment variable, which is hardly what I would consider appropriate.

Also, you both were mentioning "changing the defaults". The patch I propose does not change the defaults, it just adds an extra search path. The original search path is preserved.

Either way, if you wouldn't mind committing a patch that changes the path via a configure argument, then I'll just write up a patch that does that instead.

Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

For reference, https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/248392 is the original bug downstream.

Revision history for this message
In , Dbn-lists (dbn-lists) wrote :

(In reply to comment #7)
> @Dan Nicholson: Sticking 64-bit libraries into /usr/lib64 instead of /usr/lib
> would require changing Debian's packaging policy as well as every derivative of
> Debian's policy to accomodate one library that won't work otherwise.

So debian's policy is that 32 bit libraries go in /usr/lib32 on x86_64 but their 32 bit libraries aren't actually installed there? So, is this is multiarch or not? It sounds like it's not intended to be multiarch.

I would agree with Corbin that this is NOTABUG since this case is pretty convoluted and no one has ever needed it before. However, if you write a patch that sets the search path from configure and leaves the current default (not extending it with a path that hasn't been needed), then I'll commit it for you.

You may want to open a bug in ubuntu to see what the developers say. If this is a debian/ubuntu policy, then I don't know why it hasn't come up before.

Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

(In reply to comment #9)
> (In reply to comment #7)
> > @Dan Nicholson: Sticking 64-bit libraries into /usr/lib64 instead of /usr/lib
> > would require changing Debian's packaging policy as well as every derivative of
> > Debian's policy to accomodate one library that won't work otherwise.
>
> So debian's policy is that 32 bit libraries go in /usr/lib32 on x86_64 but
> their 32 bit libraries aren't actually installed there? So, is this is
> multiarch or not? It sounds like it's not intended to be multiarch.
It's not trivial to change the userland, and the package manager does not natively support multiarch. ia32-libs exists because of the need for 32-bit libraries in 64-bit.

> I would agree with Corbin that this is NOTABUG since this case is pretty
> convoluted and no one has ever needed it before. However, if you write a patch
> that sets the search path from configure and leaves the current default (not
> extending it with a path that hasn't been needed), then I'll commit it for you.
Will do.

> You may want to open a bug in ubuntu to see what the developers say. If this is
> a debian/ubuntu policy, then I don't know why it hasn't come up before.
I'm not sure about ia32-libs' history as I've only switched to 64-bit Ubuntu relatively recently (after Ubuntu 9.04's release), but I've talked to other developers and am personally an Ubuntu Contributing Developer myself. The bug in Ubuntu which I linked in comment #8 was filed on 2008-07-14, but never really got much attention, probably because not many actually played 32-bit GPU intensive games on 64-bit Ubuntu with Intel graphics.

I myself did not notice that Wine was not getting direct rendering until the whole issue with Wine segfaulting as a result of a bad FBO returned by mesa under indirect rendering took place.

Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

Created an attachment (id=30761)
Add --with-dri-driver-searchdirs configure flag

This patch adds the --with-dri-driver-searchdirs configure flag which will append the provided path to ${DRI_DRIVER_SEARCH_DIR} if present.

Revision history for this message
In , Hverbeet (hverbeet) wrote :

(In reply to comment #9)
> You may want to open a bug in ubuntu to see what the developers say. If this is
> a debian/ubuntu policy, then I don't know why it hasn't come up before.
>
For what it's worth, we do get a number of bug reports from people with broken 32 bit OpenGL setups both for Wine and CrossOver, so the issue certainly isn't new. Wine using FBOs by default in combination with bug 23335 just made it a lot more noticeable for most people. Ultimately it's the responsibility of the distribution to not screw this up, but if Mesa can do anything to make that easier that's appreciated of course.

Revision history for this message
Chow Loong Jin (hyperair) wrote :

Not ready due to upstream issues with submitted patch.

Changed in mesa (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
In , Dbn-lists (dbn-lists) wrote :

(In reply to comment #11)
> Created an attachment (id=30761) [details]
> Add --with-dri-driver-searchdirs configure flag
>
> This patch adds the --with-dri-driver-searchdirs configure flag which will
> append the provided path to ${DRI_DRIVER_SEARCH_DIR} if present.

That looks good, but I don't think $DRI_DRIVER_INSTALL_DIR should be forced in ahead of the user value. If they decide to override the default, they should be in full control of the path. Also, do you mind chaning the option to --with-dri-searchpath to keep it a little more concise?

Revision history for this message
In , Chow Loong Jin (hyperair) wrote :

Created an attachment (id=30786)
Add --with-dri-searchpath configure flag

As requested, it is --with-dri-searchpath now.

Revision history for this message
In , Dbn-lists (dbn-lists) wrote :

Pushed as 35506dec6734a1ae777dc16981cb19e514f41897 with an additional change so the dri pkgconfig file doesn't break.

Thanks. Now you just have to get the Ubuntu people to rebuild in the right way. :)

Changed in mesa:
status: Unknown → In Progress
Changed in mesa (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
Chow Loong Jin (hyperair) wrote :
Changed in mesa:
status: In Progress → Fix Released
Revision history for this message
Scott Ritchie (scottritchie) wrote :

Mesa is in main so I'm subscribing ubuntu-sru. The mesa fix needs to go in before the subsequent ia32-libs update.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

BTW, the mesa patch went upstream (great job Chow!) and is included in the mesa packages in the x-updates PPA.

Revision history for this message
Chow Loong Jin (hyperair) wrote :
Changed in mesa (Ubuntu Karmic):
assignee: nobody → Chow Loong Jin (hyperair)
status: New → Confirmed
Revision history for this message
Vidar Braut Haarr (vhaarr+launchpad) wrote :

Is this fixed in Lucid? It seems related to https://bugs.launchpad.net/ubuntu/+source/wine1.2/+bug/506320, which I just filed.

Revision history for this message
Chow Loong Jin (hyperair) wrote : Re: [Bug 248392] Re: 32bit libgl search for dri at wrong place on 64bit system

On Tuesday 12,January,2010 07:38 PM, Vidar Braut Haarr wrote:
> Is this fixed in Lucid? It seems related to
> https://bugs.launchpad.net/ubuntu/+source/wine1.2/+bug/506320, which I
> just filed.
>
One way to determine this is to download the 32-bit mesa-utils package and
extract the glxinfo package, then use it to test.

--
Kind regards,
Chow Loong Jin (GPG: 0x8F02A411)
Ubuntu Contributing Developer

Revision history for this message
Vidar Braut Haarr (vhaarr+launchpad) wrote :

Here's the results from running a 32bit glxinfo on my system;
http://pastebin.com/m789c79a6

Revision history for this message
Alberto Milone (albertomilone) wrote :

@Vidar
In Lucid there are 2 additional bugs to fix: bug #506437 and bug #506435

Revision history for this message
Kjell L. (lkjell) wrote :

Is this why World of warcraft lagg? My work around is to enable compiz.

Bryce Harrington (bryce)
tags: added: intrepid
Revision history for this message
Ernst (ernst-blaauw) wrote :

I have this bug too in Lucid. Running Wine with LIBGL_DRIVERS_PATH=/usr/lib32/dri fixes the problem. I have this problem with QuickTime Alternative.

$ uname -m
x86_64

$ uname -r
2.6.32-16-generic

$ apt-cache policy wine1.2
wine1.2:
  Installed: 1.1.40-0ubuntu2
  Candidate: 1.1.40-0ubuntu2
  Version table:
 *** 1.1.40-0ubuntu2 0
        500 http://nl.archive.ubuntu.com lucid/universe Packages
        100 /var/lib/dpkg/status

Changed in mesa (Ubuntu Lucid):
assignee: Chow Loong Jin (hyperair) → Alberto Milone (albertomilone)
importance: Undecided → Medium
status: Confirmed → In Progress
Changed in mesa (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
David Heidelberg (okias) wrote :

NO fix was not commited! 10.04 all updates, wine still loking in /usr/lib/dri...

Revision history for this message
Scott Ritchie (scottritchie) wrote :

okias, Alberto's mentioned fix hasn't crept into the released package yet, which means I can't yet update ia32-libs, which means Wine was still built with the old buggy behavior. Can you push out a new mesa package soon Alberto?

Revision history for this message
Alberto Milone (albertomilone) wrote :

sure, I'll do it soon

Changed in mesa (Ubuntu Lucid):
importance: Medium → High
Revision history for this message
Alberto Milone (albertomilone) wrote :

Just an update: we'll upload a new mesa after Beta 2 and only then we'll refresh ia32-libs.

Revision history for this message
Benjamin Drung (bdrung) wrote :

unsubscribing ubuntu-sponsors. @Alberto and Scott: Please resubscribe, if you don't want to sponsor the packages.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 7.7.1-1ubuntu1

---------------
mesa (7.7.1-1ubuntu1) lucid; urgency=low

  [ Alberto Milone ]
  * debian/rules: pass --with-dri-searchpath=/usr/lib/dri:/usr/lib32/dri
    to confflags-dri on i386 so that /usr/lib32/dri is used for 32 bit
    compatibility on 64 bit systems (LP: #248392).

mesa (7.7.1-1) unstable; urgency=low

  [ Brice Goglin ]
  * Remove Thierry Reding from Uploaders, closes: #572539.
  * Bump Standards-Version to 3.8.4, no changes needed.

  [ Timo Aaltonen ]
  * New upstream release.
 -- Timo Aaltonen <email address hidden> Thu, 01 Apr 2010 13:31:09 +0300

Changed in mesa (Ubuntu Lucid):
status: Fix Committed → Fix Released
Changed in ia32-libs (Ubuntu Lucid):
status: Confirmed → In Progress
assignee: Scott Ritchie (scottritchie) → Alberto Milone (albertomilone)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ia32-libs - 2.7ubuntu23

---------------
ia32-libs (2.7ubuntu23) lucid; urgency=low

  * Freshen packages as the new mesa now uses the correct path for 32 bit
    compatibility on 64 bit systems (LP: #248392).
 -- Alberto Milone <email address hidden> Sun, 11 Apr 2010 13:44:57 +0000

Changed in ia32-libs (Ubuntu Lucid):
status: In Progress → Fix Released
Changed in mesa:
importance: Unknown → High
Changed in mesa:
importance: High → Unknown
Changed in mesa:
importance: Unknown → High
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Karmic is past End of Life, and is no longer supported. As such, this bug is being marked "Won't Fix" against the Karmic bug task.

Changed in ia32-libs (Ubuntu Karmic):
status: New → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

karmic has seen the end of its life and is no longer receiving any updates. Marking the karmic task for this ticket as "Won't Fix".

Changed in mesa (Ubuntu Karmic):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.