Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949411 - media-libs/mesa-24.3.4-r1: eglinfo (from x11-apps/mesa-progs-9.0.0): segmentation fault, "libEGL warning: egl: failed to create dri2 screen" in libEGL_mesa.so.0.0.0
Summary: media-libs/mesa-24.3.4-r1: eglinfo (from x11-apps/mesa-progs-9.0.0): segmenta...
Status: UNCONFIRMED
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: 2025-02-08 00:48 UTC by Thibaud CANALE
Modified: 2025-02-17 11:01 UTC (History)
1 user (show)

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


Attachments
emerge --info x11-apps/mesa-progs media-libs/libglvnd media-libs/mesa x11-drivers/nvidia-drivers (file_949411.txt,11.89 KB, text/plain)
2025-02-08 00:48 UTC, Thibaud CANALE
Details
GDB: bt full (gzip compressed) (eglinfo_gdb_bt_full.txt.gz,5.46 KB, application/gzip)
2025-02-08 00:51 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaud CANALE 2025-02-08 00:48:04 UTC
Created attachment 918315 [details]
emerge --info x11-apps/mesa-progs media-libs/libglvnd media-libs/mesa x11-drivers/nvidia-drivers

Calling `eglinfo` will terminate unexpectedly with a "SIGSEGV" segmentation fault.

Here a bit of its output before the issue:
```
Device #1:

EGL device extensions string:
    EGL_EXT_device_drm, EGL_EXT_device_drm_render_node
Platform Device platform:
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
```

From GDB:
```
Program received signal SIGSEGV, Segmentation fault.
drisw_init_screen (screen=screen@entry=0x1001fb2b0, driver_name_is_inferred=driver_name_is_inferred@entry=false)
    at ../mesa-24.3.4/src/gallium/frontends/dri/drisw.c:623
623	   if (loader->base.version >= 4) {


(gdb) bt
#0  drisw_init_screen (screen=screen@entry=0x1001fb2b0, driver_name_is_inferred=driver_name_is_inferred@entry=false)
    at ../mesa-24.3.4/src/gallium/frontends/dri/drisw.c:623
#1  0x00007ffff02178e5 in driCreateNewScreen3 (scrn=scrn@entry=0, fd=<optimized out>, loader_extensions=<optimized out>,
    type=type@entry=DRI_SCREEN_SWRAST, driver_configs=driver_configs@entry=0x1001f7b60,
    driver_name_is_inferred=driver_name_is_inferred@entry=false, has_multibuffer=true, data=0x100682e40)
    at ../mesa-24.3.4/src/gallium/frontends/dri/dri_util.c:144
#2  0x00007ffff76981f0 in dri2_create_screen (disp=disp@entry=0x100682e40) at ../mesa-24.3.4/src/egl/drivers/dri2/egl_dri2.c:825
#3  0x00007ffff76996aa in dri2_initialize_device (disp=disp@entry=0x100682e40)
    at ../mesa-24.3.4/src/egl/drivers/dri2/platform_device.c:362
#4  0x00007ffff7698942 in dri2_initialize (disp=0x100682e40) at ../mesa-24.3.4/src/egl/drivers/dri2/egl_dri2.c:912
#5  0x00007ffff7689ef3 in eglInitialize (dpy=<optimized out>, major=0x7fffffffc63c, minor=0x7fffffffc640)
    at ../mesa-24.3.4/src/egl/main/eglapi.c:719
#6  0x00007ffff7f7f747 in eglInitialize (dpy=0x100682e40, major=0x7fffffffc63c, minor=0x7fffffffc640)
    at src/generate/g_egldispatchstubs.c:231
#7  0x0000000100002d1a in ?? ()
#8  0x0000000100001ae2 in ?? ()
#9  0x00007ffff7daa458 in ?? () from /usr/lib64/libc.so.6
#10 0x00007ffff7daa51c in __libc_start_main () from /usr/lib64/libc.so.6
#11 0x0000000100001b75 in ?? ()
```

Based on the source code, the content of variable `loader` is not check (line 617):
```
const __DRIswrastLoaderExtension *loader = screen->swrast_loader;
```

Also, I would like to report I had the same issue before I added "nouveau" in the list `VIDEO_CARDS` (only "nvidia"), it was complaining the "nouveau" driver was missing. No improvement since, except removing this warning.
Comment 1 Thibaud CANALE 2025-02-08 00:51:09 UTC
Created attachment 918316 [details]
GDB: bt full (gzip compressed)

Full backtrace with variable content, in case it is useful.
Comment 2 Matt Turner gentoo-dev 2025-02-08 01:41:19 UTC
Can you try mesa-24.3.4-r1?

I think compiling with the new flag (-Dlegacy-x11=dri2) in this version will fix things.

If it does, I'll go ahead and stabilize that version.
Comment 3 Thibaud CANALE 2025-02-08 09:11:08 UTC
(In reply to Matt Turner from comment #2)
> Can you try mesa-24.3.4-r1?
> 
> I think compiling with the new flag (-Dlegacy-x11=dri2) in this version will
> fix things.
> 
> If it does, I'll go ahead and stabilize that version.

Hello Matt,

I am already on media-libs/mesa-24.3.4-r1, as saved in attachment 918315 [details], with the flag `legacy-x11` set as expected:
```
% grep -Fne legacy-x11 /var/db/pkg/media-libs/mesa-24.3.4-r1/mesa-24.3.4-r1.ebuild
447:		-Dlegacy-x11=dri2
```

Compared to the current ebuild in main Portage tree, it just lacks the commit about `RUST_MULTILIB=1`.