Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 923831

Summary: media-libs/mesa loader search path is broken
Product: Gentoo Linux Reporter: Plüss Roland <roland>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED INVALID    
Severity: major CC: roland
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=728286
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 506276    

Description Plüss Roland 2024-02-05 14:09:39 UTC
Trying to run Wine or anything else using MESA 32-bit fails with errors like these:

MESA-LOADER: failed to open radeonsi: /usr/lib64/dri/radeonsi_dri.so: wrong ELF class: ELFCLASS64 (search paths /usr/lib32/dri:/usr/lib64/dri, suffix _dri)
failed to load driver: radeonsi
MESA-LOADER: failed to open radeonsi: /usr/lib64/dri/radeonsi_dri.so: wrong ELF class: ELFCLASS64 (search paths /usr/lib32/dri:/usr/lib64/dri, suffix _dri)
failed to load driver: radeonsi
MESA-LOADER: failed to open swrast: /usr/lib64/dri/swrast_dri.so: wrong ELF class: ELFCLASS64 (search paths /usr/lib32/dri:/usr/lib64/dri, suffix _dri)
failed to load driver: swrast
0024:err:wgl:X11DRV_WineGL_InitOpenglInfo  couldn't initialize OpenGL, expect problems

The search patrh "/usr/lib32/dri" does not exist. What does exist is "/usr/lib/dri". Examining the arch of the binaries in that directory show that they are 32-bit as required.

Grepping for the search path in /etc yields this:

> /etc # find -type f | xargs -- grep -nHF "/usr/lib32/dri"
./profile.d/ati-fglrx.sh:19:  if ! set | grep LIBGL_DRIVERS_PATH | grep /usr/lib32/dri:/usr/lib64/dri > /dev/null
./profile.d/ati-fglrx.sh:21:    LIBGL_DRIVERS_PATH=$LIBGL_DRIVERS_PATH:/usr/lib32/dri:/usr/lib64/dri
./profile.d/ati-fglrx.sh:25:  LIBGL_DRIVERS_PATH=/usr/lib32/dri:/usr/lib64/dri
./ati/inst_path_default:15:   ATI_3D_DRV_32=/usr/lib32/dri
./profile.csh:13:setenv LIBGL_DRIVERS_PATH '/usr/lib64/dri:/usr/lib32/dri'

These are all profile configuration managed by Gentoo and the path stored in there is wrong.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-05 14:14:19 UTC
I'm not sure about this.

grepping for LIBGL_DRIVERS_PATH in gentoo.git gives 0 results, we've not had fglrx in tree for years either.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-05 14:14:43 UTC
(In reply to Sam James from comment #1)
> I'm not sure about this.
> 
> grepping for LIBGL_DRIVERS_PATH in gentoo.git gives 0 results, we've not had
> fglrx in tree for years either.

I also bet that all of those files in your grep are orphaned (not owned by anything). You can check with qfile or equery b. Possibly from the old 'eselect opengl'.
Comment 3 Plüss Roland 2024-02-05 18:22:59 UTC
All the files mentioned in the grep indeed do not show any output with equery. Interesting how they could end up in a sane system. Maybe adding some tool to look for such left-over files in etc/profile might be useful for the future.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-06 03:58:53 UTC
qfile -o can help find them (although see bug 910755).

Really, this should've been dealt with when eselect-opengl was last-rited. We should've included it in the mask/last-rites and in the news item too if there was one (iirc there might've been).