Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash under sway, but not weston #6

Open
boogerlad opened this issue Oct 31, 2016 · 3 comments
Open

crash under sway, but not weston #6

boogerlad opened this issue Oct 31, 2016 · 3 comments

Comments

@boogerlad
Copy link

Looks like the default makefile has the -g parameter, so debug symbols are included. Is this correct? I hope this is more useful.

[root@localhost st]# WAYLAND_DEBUG=1 gdb st
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from st...done.
(gdb) run
Starting program: /root/st/st 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[739345.719]  -> [email protected]_registry(new id wl_registry@2)
[739345.778]  -> [email protected]_registry(new id wl_registry@3)
[739345.804]  -> [email protected](new id wl_callback@4)
[739345.942] [email protected]_id(4)
[739345.998] [email protected](1, "wl_shm", 1)
[739346.026] [email protected](2, "wl_compositor", 3)
[739346.044] [email protected](3, "wl_subcompositor", 1)
[739346.063] [email protected](4, "wl_data_device_manager", 2)
[739346.083] [email protected](5, "wl_seat", 4)
[739346.119] [email protected](6, "wl_shell", 1)
[739346.140] [email protected](7, "zxdg_shell_v6", 1)
[739346.159] [email protected](8, "desktop_shell", 3)
[739346.179] [email protected](9, "lock", 1)
[739346.197] [email protected](10, "wl_output", 2)
[739346.217] [email protected](11, "wl_drm", 2)
[739346.239]  -> [email protected](11, "wl_drm", 2, new id [unknown]@5)
[739346.267] [email protected](20609)
[739346.280]  -> [email protected](new id wl_callback@4)
[739346.332] [email protected]_id(4)
[739346.343] [email protected]("/dev/dri/card0")
[739346.380]  -> [email protected](2)
[739346.389] [email protected](875713089)
[739346.401] [email protected](875713112)
[739346.409] [email protected](909199186)
[739346.419] [email protected](961959257)
[739346.428] [email protected](825316697)
[739346.440] [email protected](842093913)
[739346.449] [email protected](909202777)
[739346.456] [email protected](875713881)
[739346.463] [email protected](842094158)
[739346.469] [email protected](909203022)
[739346.476] [email protected](1448695129)
[739346.483] [email protected](1)
[739346.491] [email protected](20609)
[739346.498]  -> [email protected](new id wl_callback@4)
[739346.536] [email protected]_id(4)
[739346.546] [email protected]()
[739346.551] [email protected](20609)
# find_driver: Trying DRM driver `intel'
[739346.660]  -> [email protected](new id wl_callback@4)
[739346.673] [email protected](1, "wl_shm", 1)
[739346.691]  -> [email protected](1, "wl_shm", 1, new id [unknown]@6)
[739346.717] [email protected](2, "wl_compositor", 3)
[739346.733]  -> [email protected](2, "wl_compositor", 3, new id [unknown]@7)
[739346.753] [email protected](3, "wl_subcompositor", 1)
[739346.770] [email protected](4, "wl_data_device_manager", 2)
[739346.789]  -> [email protected](4, "wl_data_device_manager", 1, new id [unknown]@8)
[739346.813] [email protected](5, "wl_seat", 4)
[739346.831]  -> [email protected](5, "wl_seat", 4, new id [unknown]@9)
[739346.856] [email protected](6, "wl_shell", 1)
[739346.874] [email protected](7, "zxdg_shell_v6", 1)
[739346.922] [email protected](8, "desktop_shell", 3)
[739346.949] [email protected](9, "lock", 1)
[739346.988] [email protected](10, "wl_output", 2)
[739347.019]  -> [email protected](10, "wl_output", 2, new id [unknown]@10)
[739347.056] [email protected](11, "wl_drm", 2)
[739351.894] [email protected]_id(4)
[739351.942] [email protected](20609)
[739351.964]  -> [email protected]_keyboard(new id wl_keyboard@4)
[739351.977]  -> [email protected]_pointer(new id wl_pointer@11)
[739351.987]  -> [email protected]_data_device(new id wl_data_device@12, wl_seat@9)
# wld_font_open_pattern: Loading font file: /usr/share/fonts/TTF/DejaVuSans.ttf
# wld_font_open_pattern: Loading font file: /usr/share/fonts/TTF/DejaVuSans-Oblique.ttf
# wld_font_open_pattern: Loading font file: /usr/share/fonts/TTF/DejaVuSans-BoldOblique.ttf
# wld_font_open_pattern: Loading font file: /usr/share/fonts/TTF/DejaVuSans-Bold.ttf
[739371.215]  -> [email protected]_pool(new id wl_shm_pool@13, fd 6, 4096)
[739371.532]  -> [email protected](12288)
[739371.679]  -> [email protected](28672)
[739371.892]  -> [email protected](61440)
[739372.242]  -> [email protected](126976)
[739374.442]  -> [email protected](258048)
[739374.588]  -> [email protected](520192)
[739376.575]  -> [email protected](1044480)
[739380.052]  -> [email protected](2093056)
[739404.413]  -> [email protected]_surface(new id wl_surface@14)
[739404.465]  -> [email protected]_surface(new id wl_surface@15)

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7124396 in wl_proxy_marshal_constructor () from /usr/lib/libwayland-client.so.0
(gdb) bt
#0  0x00007ffff7124396 in wl_proxy_marshal_constructor () from /usr/lib/libwayland-client.so.0
#1  0x000000000040324a in xdg_shell_get_xdg_surface (surface=<optimized out>, xdg_shell=<optimized out>)
    at xdg-shell-client-protocol.h:359
#2  wlinit () at st.c:3247
#3  main (argc=0, argv=<optimized out>) at st.c:4353

@boogerlad
Copy link
Author

boogerlad commented Nov 3, 2016

Just tested st@8c99915 and your latest patch in oasis, same problem. Are you able to reproduce with sway? If you're not interested in fixing this, any pointers?

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7124396 in wl_proxy_marshal_constructor () from /usr/lib/libwayland-client.so.0
(gdb) bt
#0  0x00007ffff7124396 in wl_proxy_marshal_constructor () from /usr/lib/libwayland-client.so.0
#1  0x00000000004034b5 in xdg_shell_get_xdg_surface (surface=<optimized out>, xdg_shell=<optimized out>)
    at xdg-shell-unstable-v5-client-protocol.h:421
#2  wlinit () at st.c:3394
#3  main (argc=0, argv=<optimized out>) at st.c:4537

@michaelforney
Copy link
Owner

It looks like sway only implements xdg-shell-v6 (which is fairly new), while this st port currently only supports v5.

So, we never see a shell global, and wl.shell is left at NULL. I seem to have missed a NULL check after the first roundtrip in wlinit, causing a crash later on when we try to use wl.shell. Probably if you build st without optimizations, the gcc backtrace will make this clear.

You can try to port to v6 and send a pull request. I'd probably put it in a separate branch for now until I have time to support v6 in swc.

@etherealvisage
Copy link

I just created a pull request that changes st to use xdg v6. @boogerlad, if you give #8 a try and report back if it works for you, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants