Cloudef / wlc

High-level Wayland compositor library
MIT License
330 stars 58 forks source link

wlc sigabort #122

Closed podhorsky-ksj closed 8 years ago

podhorsky-ksj commented 8 years ago

Hi, During run of sway I got SIGABRT in wlc. I caught it in gdb and I still have exec and wlc library. wlc commit id: faa4d3c Can be issue found from gdb backtrace, or should I attach something else?

0 0x00007ffff6cb25f8 in raise () from /usr/lib/libc.so.6

1 0x00007ffff6cb3a7a in abort () from /usr/lib/libc.so.6

2 0x00007ffff6cf105a in __libc_message () from /usr/lib/libc.so.6

3 0x00007ffff6cf69a6 in malloc_printerr () from /usr/lib/libc.so.6

4 0x00007ffff6cf718e in _int_free () from /usr/lib/libc.so.6

5 0x00007ffff7bc7506 in chck_lut_flush (lut=0xc594f0) at /home/ksj/wlc-git/src/wlc/lib/chck/chck/lut/lut.c:94

6 chck_hash_table_flush (table=table@entry=0x7ffff7dd9dd0 <wlc+2288>) at /home/ksj/wlc-git/src/wlc/lib/chck/chck/lut/lut.c:323

7 0x00007ffff7bc756e in chck_hash_table_release (table=table@entry=0x7ffff7dd9dd0 <wlc+2288>)

at /home/ksj/wlc-git/src/wlc/lib/chck/chck/lut/lut.c:339

8 0x00007ffff7bc41a4 in wlc_xwm_release (xwm=xwm@entry=0x7ffff7dd9d60 <wlc+2176>) at /home/ksj/wlc-git/src/wlc/src/xwayland/xwm.c:920

9 0x00007ffff7bace20 in xwayland_event (listener=0x7ffff7dda1e0 <wlc+3328>, data=)

at /home/ksj/wlc-git/src/wlc/src/compositor/compositor.c:254

10 0x00007ffff7bc1b1c in wl_signal_emit (data=0x7fffffffe7df, signal=0x7ffff7dda3a8 <wlc+3784>) at /usr/include/wayland-server-core.h:264

11 wlc_xwayland_terminate () at /home/ksj/wlc-git/src/wlc/src/xwayland/xwayland.c:220

12 0x00007ffff7bc23c2 in destroy_event (listener=, data=)

at /home/ksj/wlc-git/src/wlc/src/xwayland/xwayland.c:204

13 0x00007ffff754b1ec in wl_client_destroy () from /usr/lib/libwayland-server.so.0

14 0x00007ffff754b955 in wl_display_flush_clients () from /usr/lib/libwayland-server.so.0

15 0x00007ffff754b998 in wl_display_run () from /usr/lib/libwayland-server.so.0

16 0x00007ffff7bc14ec in wlc_run () at /home/ksj/wlc-git/src/wlc/src/wlc.c:260

17 0x00000000004071bc in main (argc=2, argv=0x7fffffffea08) at /home/ksj/sway-git/src/sway/sway/main.c:214

Cloudef commented 8 years ago

Use code snippets for pastes, the # will reference other issues / PRs. Not sure what specific conditions cause this bug to happen, but if you manage to catch it in tool like http://rr-project.org/ it might help.

podhorsky-ksj commented 8 years ago

Ok, I will try it. But It seems to be similar tool, dependent on gdb. Are current data, which I have (backtrace, core file, exec, libraries files) useless? I didn't check this tool closely yet, but maybe it can use core and exec file for tracing just like gdb.

Cloudef commented 8 years ago

The coredump only contains state of program during the failure, while rr replays the session, allowing you to see how the state was produced. But I haven't tried how well it works, might be good way to try.

podhorsky-ksj commented 8 years ago

I'm afraid I'm not able to run it with rr. But when I saw the manual it seems to be great tool.

With gdb I use command gdb -batch -ex "run -d" -ex "continue" -ex "generate-core-file" /usr/bin/sway

But it not works there. When I use: rr replay /usr/bin/sway or rr replay /usr/bin/sway -- -batch -ex "continue" It will freeze or fail before it runs sway (I can see it from backtrace)

Anyway I got two segfaults with core files during writing this message. Can they help to you?

#0  0x00007ffff6cf87ad in _int_malloc () from /usr/lib/libc.so.6
#1  0x00007ffff6cfa3d4 in malloc () from /usr/lib/libc.so.6
#2  0x00007ffff627d0bf in ?? () from /usr/lib/libxcb.so.1
#3  0x00007ffff627ad51 in ?? () from /usr/lib/libxcb.so.1
#4  0x00007ffff627c497 in ?? () from /usr/lib/libxcb.so.1
#5  0x00007ffff627c5a1 in xcb_wait_for_reply () from /usr/lib/libxcb.so.1
#6  0x00007ffff7bc3402 in read_properties (xwm=0x7ffff7dd9d60 <wlc+2176>, win=0x7e8b10) at /home/ksj/wlc-git/src/wlc/src/xwayland/xwm.c:222
#7  0x00007ffff7bc390e in link_surface (xwm=xwm@entry=0x7ffff7dd9d60 <wlc+2176>, win=0x0, win@entry=0x676034, resource=<optimized out>)
    at /home/ksj/wlc-git/src/wlc/src/xwayland/xwm.c:374
#8  0x00007ffff7bc3ff6 in handle_client_message (ev=0x677a70, xwm=0x7ffff7dd9d60 <wlc+2176>)
    at /home/ksj/wlc-git/src/wlc/src/xwayland/xwm.c:504
#9  x11_event (fd=<optimized out>, mask=<optimized out>, data=0x7ffff7dd9d60 <wlc+2176>) at /home/ksj/wlc-git/src/wlc/src/xwayland/xwm.c:589
#10 0x00007ffff754d242 in wl_event_loop_dispatch () from /usr/lib/libwayland-server.so.0
#11 0x00007ffff754b9a5 in wl_display_run () from /usr/lib/libwayland-server.so.0
#12 0x00007ffff7bc14ec in wlc_run () at /home/ksj/wlc-git/src/wlc/src/wlc.c:260
#13 0x00000000004071bc in main (argc=2, argv=0x7fffffffea08) at /home/ksj/sway-git/src/sway/sway/main.c:214
#0  0x00007ffff6cf6b72 in malloc_consolidate () from /usr/lib/libc.so.6
#1  0x00007ffff6cf88a0 in _int_malloc () from /usr/lib/libc.so.6
#2  0x00007ffff6cfa3d4 in malloc () from /usr/lib/libc.so.6
#3  0x00007ffff0d285ca in ?? () from /usr/lib/libdrm_intel.so.1
#4  0x00007ffff0d2874d in ?? () from /usr/lib/libdrm_intel.so.1
#5  0x00007ffff12db285 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#6  0x00007ffff12b55d3 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#7  0x00007ffff12bf260 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#8  0x00007ffff12a9ea3 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#9  0x00007ffff12af042 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#10 0x00007ffff12afb18 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#11 0x00007ffff129a868 in ?? () from /usr/lib/xorg/modules/dri/i965_dri.so
#12 0x00007ffff7bb9a0e in clear (context=<optimized out>) at /home/ksj/wlc-git/src/wlc/src/platform/render/gles2.c:847
#13 0x00007ffff7baff05 in repaint (output=<optimized out>) at /home/ksj/wlc-git/src/wlc/src/compositor/output.c:303
#14 cb_idle_timer (data=<optimized out>) at /home/ksj/wlc-git/src/wlc/src/compositor/output.c:359
#15 0x00007ffff754cb67 in ?? () from /usr/lib/libwayland-server.so.0
#16 0x00007ffff754d242 in wl_event_loop_dispatch () from /usr/lib/libwayland-server.so.0
#17 0x00007ffff754b9a5 in wl_display_run () from /usr/lib/libwayland-server.so.0
#18 0x00007ffff7bc14ec in wlc_run () at /home/ksj/wlc-git/src/wlc/src/wlc.c:260
#19 0x00000000004071bc in main (argc=2, argv=0x7fffffffea08) at /home/ksj/sway-git/src/sway/sway/main.c:214
Cloudef commented 8 years ago

You are getting very weird crashes in several core libraries. I think your system may be using binary incompatible libraries.

Cloudef commented 8 years ago

Make sure everything is up-to-date and you are not forcing linkage for ABI incompatible libs.

podhorsky-ksj commented 8 years ago

Hmmm, I got another one and I'm pretty sure everything is updated correctly and I'm using the latest version of wlc and sway.

#0  0x00007ffff561a90c in ?? () from /usr/lib/libEGL.so.1
#1  0x00007ffff5612f88 in ?? () from /usr/lib/libEGL.so.1
#2  0x00007ffff7bc3b32 in surface_attach.lto_priv.157 (context=0x7b7f50, bound=0x78dda0, surface=0xca1ac0, buffer=0x7f9750)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/platform/render/gles2.c:646
#3  0x00007ffff7bb35f6 in wlc_render_surface_attach (buffer=0x7f9750, surface=0xca1ac0, bound=0x78dda0, render=0x78dde8)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/platform/render/render.c:38
#4  wlc_output_surface_attach (buffer=0x7f9750, surface=0xca1ac0, output=0x78dc10)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/compositor/output.c:442
#5  wlc_surface_attach_to_output (surface=0xca1ac0, output=0x78dc10, buffer=0x7f9750)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/resources/types/surface.c:261
#6  0x00007ffff7bc652b in attach_view () at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/compositor/output.c:690
#7  wlc_output_link_view (output=0x78dc10, view=0x7d1b48, link=<optimized out>, other=<optimized out>)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/compositor/output.c:708
#8  0x0000000000415bae in update_visibility_output (container=0xc99120, output=1)
    at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/container.c:731
#9  0x0000000000415c02 in update_visibility_output (container=0xc5f420, output=1)
    at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/container.c:739
#10 0x0000000000415d5b in update_visibility (container=0xc394d0) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/container.c:769
#11 0x000000000041fda7 in arrange_windows (container=0xc394d0, width=-1, height=-1)
    at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/layout.c:615
#12 0x0000000000422e06 in workspace_switch (workspace=0x64fa10) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/workspace.c:283
#13 0x000000000040dc80 in cmd_workspace (argc=1, argv=0xc924e8) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/commands.c:1960
#14 0x0000000000410a84 in handle_command (_exec=0x694400 "workspace 2") at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/commands.c:2893
#15 0x0000000000419297 in handle_binding_command (binding=0x684d30) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/handlers.c:389
#16 0x00000000004193e1 in handle_bindsym (binding=0x684d30) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/handlers.c:420
#17 0x0000000000419601 in handle_key (view=2, time=210746625, modifiers=0x7ffff7dd9f78 <wlc.lto_priv+920>, key=3, 
    state=WLC_KEY_STATE_PRESSED) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/handlers.c:491
#18 0x00007ffff7bb94df in wlc_keyboard_request_key (state=WL_KEYBOARD_KEY_STATE_PRESSED, key=<optimized out>, mods=<optimized out>, 
    time=<optimized out>, keyboard=0x7ffff7dd9e48 <wlc.lto_priv+616>)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/compositor/seat/keyboard.c:354
#19 seat_handle_key (ev=0x7fffffffe650, seat=<optimized out>) at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/compositor/seat/seat.c:127
#20 input_event.lto_priv.114 (listener=0x7ffff7dda168 <wlc.lto_priv+1416>, data=0x7fffffffe650)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/compositor/seat/seat.c:195
#21 0x00007ffff7bb422c in wl_signal_emit () at /usr/include/wayland-server-core.h:264
#22 input_event (fd=<optimized out>, mask=<optimized out>, data=0x7ffff7dd94b0 <input.lto_priv>)
    at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/session/udev.c:197
#23 0x00007ffff7549832 in wl_event_loop_dispatch () from /usr/lib/libwayland-server.so.0
#24 0x00007ffff7547ee5 in wl_display_run () from /usr/lib/libwayland-server.so.0
#25 0x00007ffff7bc7e6c in wlc_run () at /tmp/yaourt-tmp-ksj/aur-wlc-git/src/wlc/src/wlc.c:260
#26 0x0000000000420875 in main (argc=2, argv=0x7fffffffea08) at /tmp/yaourt-tmp-ksj/aur-sway-git/src/sway/sway/main.c:214

I don't know if full backtrace will help, but I'm going to attach it too. bt_full.txt

podhorsky-ksj commented 8 years ago

I haven't seen this issue for a long time. I will close this ticket