{"record":{"id":"2fb8ad6a6dfd91cc","repo":"fyne-io/fyne","slug":"eglgetconfigattrib-failed-n","errorCode":null,"errorMessage":"eglGetConfigAttrib failed\\n","messagePattern":"eglGetConfigAttrib failed\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/driver/mobile/app/x11.c","lineNumber":38,"sourceCode":"\t\tEGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,\n\t\tEGL_SURFACE_TYPE, EGL_WINDOW_BIT,\n\t\tEGL_BLUE_SIZE, 8,\n\t\tEGL_GREEN_SIZE, 8,\n\t\tEGL_RED_SIZE, 8,\n\t\tEGL_ALPHA_SIZE, 8,\n\t\tEGL_DEPTH_SIZE, 16,\n\t\tEGL_CONFIG_CAVEAT, EGL_NONE,\n\t\tEGL_NONE\n\t};\n\tEGLConfig config;\n\tEGLint num_configs;\n\tif (!eglChooseConfig(e_dpy, attribs, &config, 1, &num_configs)) {\n\t\tfprintf(stderr, \"eglChooseConfig failed\\n\");\n\t\texit(1);\n\t}\n\tEGLint vid;\n\tif (!eglGetConfigAttrib(e_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {\n\t\tfprintf(stderr, \"eglGetConfigAttrib failed\\n\");\n\t\texit(1);\n\t}\n\n\tXVisualInfo visTemplate;\n\tvisTemplate.visualid = vid;\n\tint num_visuals;\n\tXVisualInfo *visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);\n\tif (!visInfo) {\n\t\tfprintf(stderr, \"XGetVisualInfo failed\\n\");\n\t\texit(1);\n\t}\n\n\tWindow root = RootWindow(x_dpy, DefaultScreen(x_dpy));\n\tXSetWindowAttributes attr;\n\n\tattr.colormap = XCreateColormap(x_dpy, root, visInfo->visual, AllocNone);\n\tif (!attr.colormap) {\n\t\tfprintf(stderr, \"XCreateColormap failed\\n\");","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/fyne-io/fyne/blob/8860ee95c356385effa5a7be51adb11c6be9d2b6/internal/driver/mobile/app/x11.c#L20-L56","documentation":"In x11.c, right after a config is chosen, the driver asks for its EGL_NATIVE_VISUAL_ID to find the matching X visual. Failure here means the EGL implementation could not report a native visual for a config it just returned: a driver bug or a config that has no X visual at all (surfaceless/pbuffer-only leaked through the filter). The process prints 'eglGetConfigAttrib failed' and exits(1).","triggerScenarios":"eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID) returning false on the selected config; typically vendor EGL stacks (proprietary NVIDIA) or very old Mesa where the chosen config has no X11 visual.","commonSituations":"Machines with mixed vendor EGL (NVIDIA ICD plus Mesa DRI); outdated Mesa; EGL implementations primarily targeting surfaceless platforms being handed an X display.","solutions":["Update the GPU driver / Mesa to a current version and retry","Force a known-good software path: LIBGL_ALWAYS_SOFTWARE=1 ./yourapp","Inspect what EGL is active: eglinfo -B and glxinfo | grep -i vendor","If persistent, patch x11.c to fall back to the screen's default visual when EGL_NATIVE_VISUAL_ID fails instead of exiting"],"exampleFix":"// before (x11.c): exit when the attrib query fails\nif (!eglGetConfigAttrib(e_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {\n\tfprintf(stderr, \"eglGetConfigAttrib failed\\n\");\n\texit(1);\n}\n\n// after: use the default visual as a fallback\nif (!eglGetConfigAttrib(e_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {\n\tvid = XVisualIDFromVisual(DefaultVisual(x_dpy, DefaultScreen(x_dpy)));\n}","handlingStrategy":"validation","validationCode":"func eglSanity() error {\n\tout, err := exec.Command(\"eglinfo\").CombinedOutput()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"eglinfo failed (broken EGL install): %w\\n%s\", err, out)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Mesa and vendor ICDs updated together; this failure is almost always a driver bug","Avoid mixing NVIDIA's EGL with Mesa DRI drivers on the same display","Run eglinfo as part of environment bring-up to catch quirky EGL early"],"tags":["c","egl","x11","opengl-es","driver","mesa"],"backgroundTag":null,"analyzedSha":"8860ee95c356385effa5a7be51adb11c6be9d2b6","analyzedAt":"2026-08-15T22:01:51.624Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}