Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938010 - >=media-libs/mesa-24.1.0 breaks my setup
Summary: >=media-libs/mesa-24.1.0 breaks my setup
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-16 12:19 UTC by stefan11111
Modified: 2025-01-04 19:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xorg.conf (xorg.conf,1.78 KB, text/plain)
2024-08-16 12:58 UTC, stefan11111
Details
emerge --info (emerge-info,7.15 KB, text/plain)
2024-08-16 13:03 UTC, stefan11111
Details
mesa backtrace full (mesa-backtrace-full,6.49 KB, text/plain)
2024-08-16 13:41 UTC, stefan11111
Details
mesa backtrace full unoptimized -Og (mesa-backtrace-full-unoptimized-Og,6.32 KB, text/plain)
2024-08-16 13:53 UTC, stefan11111
Details
mesa backtrace full unoptimized -O0 (mesa-backtrace-full-unoptimized-O0,6.66 KB, text/plain)
2024-08-16 14:35 UTC, stefan11111
Details
fix segfault (fix-segfault.patch,459 bytes, patch)
2024-08-16 14:50 UTC, stefan11111
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description stefan11111 2024-08-16 12:19:46 UTC
I have a amd64 laptop with an nvidia dgpu and an intel igpu.
I recently updated mesa to 24.1.3, the latest stable mesa.
After restarting, every application that uses mesa for hw accel fails like so:
>$ librewolf
>MESA-LOADER: failed to open zink: /usr/lib64/dri/zink_dri.so: cannot open shared >object file: No such file or directory (search paths /usr/lib64/dri, suffix _dri)
>Segmentation fault
These are my USE flags for mesa-24.1.3:
>[ebuild   R    ] media-libs/mesa-24.1.3::gentoo  USE="X (opengl) proprietary-codecs zstd -d3d9 -debug -llvm -lm-sensors -opencl -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan -vulkan-overlay -wayland -xa" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="18 -15 -16 -17" VIDEO_CARDS="intel -d3d12 (-freedreno) -lavapipe (-lima) -nouveau (-nvk) (-panfrost) -r300 -r600 -radeon -radeonsi (-v3d) (-vc4) -virgl (-vivante) -vmware -zink" 0 KiB
Emerging with USE=video_cards_zink doesn't help, programs just segfault when launching.
After rebuilding mesa-24.0.9, everything turned back to normal.
These are the USE flags for mesa-24.0.9:
>[ebuild   R   ] media-libs/mesa-24.0.9  USE="X gles2 (opengl) proprietary-codecs zstd -d3d9 -debug -gles1 -llvm -lm-sensors -opencl -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan -vulkan-overlay -wayland -xa (-zink)" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="-15 -16 -17" VIDEO_CARDS="intel -d3d12 (-freedreno) -lavapipe (-lima) -nouveau (-panfrost) -r300 -r600 -radeon -radeonsi (-v3d) (-vc4) -virgl (-vivante) -vmware"
After realizing this, I have tried to emerge mesa-24.1.0(necessary ebuilds copied from the ::gentoo github), and it was also broken.
Comment 1 stefan11111 2024-08-16 12:55:24 UTC
On my system, I need to use the following xorg.conf, else proton can't switch to my dgpu, and games proton doesn't start.
I will add my xorg.conf as an attatchment, but the important part is this:

>Section "ServerLayout"
>    Identifier     "Layout0"
>    Screen      0  "Screen0"
>    Screen      0  "Screen1"
>    InputDevice    "Keyboard0" "CoreKeyboard"
>    InputDevice    "Mouse0" "CorePointer"
>EndSection
<snip>
>Section "Device"
>    Identifier     "Device0"
>    Driver         "modesetting"
>    VendorName     "NVIDIA Corporation"
>    ChipId          0x0
>    ChipRev         0x0
>    IRQ             0
>EndSection
>
>Section "Device"
>    Identifier     "Device1"
>    Driver         "nvidia"
>    VendorName     "NVIDIA Corporation"
>    BusID          "PCI:1:0:0"
>EndSection
<snip>
>Section "Screen"
>    Identifier     "Screen0"
>    Device         "Device0"
>    Monitor        "Monitor0"
<snip>
>EndSection
<snip>
>Section "Screen"
>    Identifier     "Screen1"
>    Device         "Device1"
>    Monitor        "Monitor0"
<snip>
>EndSection

With this xorg.conf, I create 2 screens, Screen0, my intel igpu, and Screen1, my nvidia dgpu, so that the X server knows about both of them and can use them both.

If I disable my nvidia screen. by removing it from the ServerLayout section, >=mesa-24.1.0 works, but proton doesn't work because it can't switch to my dgpu.
Comment 2 stefan11111 2024-08-16 12:58:25 UTC
Created attachment 900247 [details]
xorg.conf
Comment 3 stefan11111 2024-08-16 13:03:09 UTC
Created attachment 900248 [details]
emerge --info
Comment 4 stefan11111 2024-08-16 13:40:34 UTC
I will also add a backtrace.
I got it from palemoon, because /usr/bine/librewolf is a shell script.
Comment 5 stefan11111 2024-08-16 13:41:10 UTC
Created attachment 900250 [details]
mesa backtrace full
Comment 6 stefan11111 2024-08-16 13:53:23 UTC
Created attachment 900251 [details]
mesa backtrace full unoptimized -Og
Comment 7 stefan11111 2024-08-16 14:35:32 UTC
Created attachment 900252 [details]
mesa backtrace full unoptimized -O0
Comment 8 stefan11111 2024-08-16 14:38:50 UTC
The last -O0 backtrace seems to provide the fullest picture.

Looks like strstr or memmem is called with src=NULL;
Comment 9 stefan11111 2024-08-16 14:49:57 UTC
Yup, and this patch fixes the issue.
Comment 10 stefan11111 2024-08-16 14:50:19 UTC
Created attachment 900253 [details, diff]
fix segfault
Comment 11 Matt Turner gentoo-dev 2025-01-04 19:44:23 UTC
Please make a merge request upstream.