Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Segfault with latest egl context change #2209

Closed
J0nnyMak0 opened this issue May 19, 2020 · 13 comments · Fixed by #2210 or #2213
Closed

Segfault with latest egl context change #2209

J0nnyMak0 opened this issue May 19, 2020 · 13 comments · Fixed by #2210 or #2213

Comments

@J0nnyMak0
Copy link
Contributor

With 1edc421 I'm getting a segfault at startup.

gdb.txt

emersion added a commit to emersion/wlroots that referenced this issue May 19, 2020
get_tex_for_bo changes the current EGL context. Rendering operations
must immediately follow drm_surface_make_current.

Closes: swaywm#2209
@emersion
Copy link
Member

Can you try #2210?

@J0nnyMak0
Copy link
Contributor Author

That is hanging. I'll try to get info from log.

@J0nnyMak0
Copy link
Contributor Author

Log attached.
sway.log

@emersion
Copy link
Member

00:00:02.470 [ERROR] [EGL] command: eglSwapBuffers, error: 0x300d, message: "eglSwapBuffers"
00:00:02.470 [ERROR] [render/egl.c:449] eglSwapBuffers failed
00:00:02.470 [ERROR] [backend/drm/renderer.c:276] Failed to swap buffers
00:00:02.470 [ERROR] [backend/drm/drm.c:727] Failed to initialize renderer on connector 'eDP-1': initial page-flip failed
00:00:02.470 [ERROR] [backend/drm/drm.c:816] Failed to initialize renderer for plane
00:00:02.471 [sway/config/output.c:423] Failed to commit output eDP-1

@J0nnyMak0
Copy link
Contributor Author

On exit, I get:
[backend/drm/atomic.c:36] eDP-1: Atomic commit failed (modset): Permission deniedl page-flip failed

ddevault pushed a commit that referenced this issue May 19, 2020
get_tex_for_bo changes the current EGL context. Rendering operations
must immediately follow drm_surface_make_current.

Closes: #2209
@emersion emersion reopened this May 19, 2020
@emersion
Copy link
Member

Abort fixed, but there's still this eglSwapBuffers failure to address.

@tchebb
Copy link
Contributor

tchebb commented May 20, 2020

I'm seeing the eglSwapBuffers failure and hang on latest master as well. Using a single GPU (Intel Haswell integrated graphics), kernel 5.6.13. Reverting commit d28a7da ("backend/drm: add missing wlr_egl_unset_current") gets rid of the problem for me.

emersion added a commit to emersion/wlroots that referenced this issue May 20, 2020
drm_fb_lock_surface swaps buffers. We need to make sure that the EGL
context is current before calling wlr_egl_swap_buffers.

Move the wlr_egl_unset_current call into drm_fb_lock_surface to avoid
other surprises like this.

Fixes: d28a7da ("backend/drm: add missing wlr_egl_unset_current")
Closes: swaywm#2209
@emersion
Copy link
Member

Can you try #2212?

@ghost
Copy link

ghost commented May 20, 2020

Can you try #2212?

It's fixed here with #2212.

@emersion
Copy link
Member

I've actually come up with a Better(tm) solution, can you try #2213?

@hensur
Copy link

hensur commented May 20, 2020

I just ran into this as well. I didn't try #2212, but I can report that #2213 fixes the issue for me.

@deprecated-dot
Copy link

Same issue on my end, log has similar failings and #2213 fixes it. Dual GPU setup (R9 Fury X + RX 5700 XT - both AMDGPU), Gentoo. Wanted to leave a comment so that there's confirmation from more than one person that #2213 fixes it.

@LaserEyess
Copy link

Another confirmation: #2213 fixes the issue for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.