Enerccio / ewlc

Wayland compositor library - extended
MIT License
20 stars 3 forks source link

Segfault on terminate with seat input #52

Open WLCIssuesBot opened 7 years ago

WLCIssuesBot commented 7 years ago

Issue by crondog Saturday Mar 05, 2016 at 04:17 GMT Originally opened as https://github.com/Cloudef/wlc/issues/134


I have noticed that if you are moving the mouse while exiting sway cleanly a segfault occurs. This is due to input_event still triggering while wlc is terminating.

[commands.c:2793] find_handler(exit) 0
[main.c:43] [wlc] Terminating wlc...
[main.c:43] [wlc] Terminating compositor...
[main.c:43] [wlc] Output (1) terminated...
[container.c:350] OUTPUT: Destroying output '1'
[main.c:43] [wlc] Removed bsurface from output (1)
[main.c:43] [wlc] Removed output (1)
[main.c:43] [wlc] Compositor terminated...
[log.c:150] Error: Signal 11. Printing backtrace
[log.c:160] Backtrace: sway(error_handler+0xb7) [0x4239ee]
[log.c:160] Backtrace: /usr/lib/libc.so.6(+0x33330) [0x7f8735958330]
[log.c:160] Backtrace: sway() [0x41917e]
[log.c:160] Backtrace: wlc/src/libwlc.so.0(+0x157b7) [0x7f8736ad77b7] seat.c:169
[log.c:160] Backtrace: wlc/src/libwlc.so.0(+0x1b6dd) [0x7f8736add6dd]
[log.c:160] Backtrace: wlc/src/libwlc.so.0(+0x1bf18) [0x7f8736addf18]
[log.c:160] Backtrace: /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch+0xc8) [0x7f87361fe888]
[log.c:160] Backtrace: /usr/lib/libwayland-server.so.0(wl_display_run+0x25) [0x7f87361fcee5]
[log.c:160] Backtrace: wlc/src/libwlc.so.0(wlc_run+0xc3) [0x7f8736aea967]
[log.c:160] Backtrace: sway(main+0x49f) [0x42050b]
[log.c:160] Backtrace: /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f8735945710]
[log.c:160] Backtrace: sway(_start+0x29) [0x406b99]

I can think of 2 ways to fix this issue.

I have tried the first option and it works. Would you prefer a terminate listener or do you have a better way?

WLCIssuesBot commented 7 years ago

Comment by Cloudef Saturday Mar 05, 2016 at 11:35 GMT


What if you move wlc_input_terminate before wlc_compositor_release in wlc.c @ wlc_cleanup? Does this happen under X11 backend?

WLCIssuesBot commented 7 years ago

Comment by crondog Saturday Mar 05, 2016 at 11:40 GMT


Moving wlc_input_terminate does not help. Yes it is under the X11 backend

WLCIssuesBot commented 7 years ago

Comment by Cloudef Saturday Mar 05, 2016 at 12:10 GMT


What is exact trace for this? As that track is missing important symbols. If this is under X11 the proper fix is to have the terminating order corrected in compositor.c.

WLCIssuesBot commented 7 years ago

Comment by crondog Saturday Mar 05, 2016 at 12:23 GMT


[log.c:150] Error: Signal 11. Printing backtrace
[log.c:160] Backtrace: sway(error_handler+0xb7) [0x4239ee]
[log.c:160] Backtrace: /usr/lib/libc.so.6(+0x33330) [0x7f70f2db0330]
[log.c:160] Backtrace: sway() [0x41917e] sway/sway/handlers.c:534
[log.c:160] Backtrace: wlc/src/libwlc.so.0(+0x157b7) [0x7f70f3f2f7b7] src/compositor/seat/seat.c:166
[log.c:160] Backtrace: wlc/src/libwlc.so.0(+0x1b6dd) [0x7f70f3f356dd] /usr/include/wayland-server-core.h:329
[log.c:160] Backtrace: wlc/src/libwlc.so.0(+0x1bf18) [0x7f70f3f35f18] wlc/src/platform/backend/x11.c:224
[log.c:160] Backtrace: /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch+0xc8) [0x7f70f3656888]
[log.c:160] Backtrace: /usr/lib/libwayland-server.so.0(wl_display_run+0x25) [0x7f70f3654ee5]
[log.c:160] Backtrace: wlc/src/libwlc.so.0(wlc_run+0xc3) [0x7f70f3f42967]
[log.c:160] Backtrace: sway(main+0x49f) [0x42050b] sway/sway/main.c:225
[log.c:160] Backtrace: /usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f70f2d9d710]
[log.c:160] Backtrace: sway(_start+0x29) [0x406b99]