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

Maximized X11 app crashes Sway #5488

Closed
jbeich opened this issue Jun 28, 2020 · 5 comments · Fixed by #5506
Closed

Maximized X11 app crashes Sway #5488

jbeich opened this issue Jun 28, 2020 · 5 comments · Fixed by #5506
Labels
bug Not working as intended
Milestone

Comments

@jbeich
Copy link
Contributor

jbeich commented Jun 28, 2020

Regressed by 8d5e627

$ mkdir -p /tmp/ffprofile/xulstore
$ mdb_load -s db -T /tmp/ffprofile/xulstore <<\EOF
chrome://browser/content/browser.xhtml\09main-window\09width
\07\04\00\00\00\00\00\00\001024
chrome://browser/content/browser.xhtml\09main-window\09height
\07\03\00\00\00\00\00\00\00768
chrome://browser/content/browser.xhtml\09main-window\09sizemode
\07\09\00\00\00\00\00\00\00maximized
EOF

$ cat >/tmp/sway.conf
exec env -u MOZ_ENABLE_WAYLAND firefox --profile /tmp/ffprofile about:blank

$ sway --version
sway version 1.5-rc1-1-gc8224270
wlroots version 0.10.0-216-g6c8f66ff

$ sway -c /tmp/sway.conf
Process 62085 stopped
* thread #1, name = 'sway', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x0000000800bb457f libc.so.7`strlen(str=0x0000000000000000) at strlen.c:101:8
   98            * boundaries is integral multiple of word size.
   99            */
   100          lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK);
-> 101          va = (*lp - mask01);
   102          vb = ((~*lp) & mask80);
   103          lp++;
   104          if (va & vb)
(lldb) bt
* thread #1, name = 'sway', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x0000000800bb457f libc.so.7`strlen(str=0x0000000000000000) at strlen.c:101:8
    frame #1: 0x0000000800abe182 libc.so.7`strdup(str=0x0000000000000000) at strdup.c:48:8
    frame #2: 0x0000000800903d56 libwlroots.so.5`wlr_foreign_toplevel_handle_v1_set_title(toplevel=0x00000008039e0700, title=0x0000000000000000) at wlr_foreign_toplevel_management_v1.c:197:20
    frame #3: 0x000000000028aa81 sway`view_update_title(view=0x0000000802d59b00, force=false) at view.c:1148:3
    frame #4: 0x00000000002916d3 sway`handle_set_title(listener=0x0000000802d59cc0, data=0x0000000801c73080) at xwayland.c:561:2
    frame #5: 0x0000000800929fed libwlroots.so.5`wlr_signal_emit_safe(signal=0x0000000801c73208, data=0x0000000801c73080) at signal.c:29:3
    frame #6: 0x00000008009372eb libwlroots.so.5`read_surface_title(xwm=0x0000000803965300, xsurface=0x0000000801c73080, reply=0x0000000802f06d60) at xwm.c:455:2
    frame #7: 0x0000000800936e76 libwlroots.so.5`read_surface_property(xwm=0x0000000803965300, xsurface=0x0000000801c73080, property=259) at xwm.c:714:3
    frame #8: 0x00000008009361cf libwlroots.so.5`xwm_handle_property_notify(xwm=0x0000000803965300, ev=0x0000000803630fa0) at xwm.c:992:2
    frame #9: 0x00000008009343c4 libwlroots.so.5`x11_event_handler(fd=15, mask=1, data=0x0000000803965300) at xwm.c:1372:4
    frame #10: 0x00000008008615a7 libwayland-server.so.0`wl_event_source_fd_dispatch(source=0x0000000802ddc340, ep=0x00007fffffffde40) at event-loop.c:112:9
    frame #11: 0x0000000800862d48 libwayland-server.so.0`wl_event_loop_dispatch(loop=0x0000000801c3f320, timeout=-1) at event-loop.c:1027:4
    frame #12: 0x000000080085e8df libwayland-server.so.0`wl_display_run(display=0x0000000801c59000) at wayland-server.c:1401:3
    frame #13: 0x000000000023afa5 sway`server_run(server=0x000000000029cfd0) at server.c:233:2
    frame #14: 0x000000000023a01d sway`main(argc=3, argv=0x00007fffffffe110) at main.c:410:2
    frame #15: 0x00000000002291af sway`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:75:7
@emersion emersion added the bug Not working as intended label Jun 28, 2020
@Emantor
Copy link
Contributor

Emantor commented Jun 29, 2020

Not sure whether we should catch the title being NULL within sway or teach wlr_foreign_toplevel_handle_v1_set_title to handle the title being NULL, other set_title functions seem to be able to handle a NULL title.

@emersion
Copy link
Member

teach wlr_foreign_toplevel_handle_v1_set_title to handle the title being NULL

Sounds like a better idea to me: toplevels are not guaranteed to have a title at all.

@emersion emersion added this to the 1.5 milestone Jun 30, 2020
@japhir
Copy link
Contributor

japhir commented Jun 30, 2020

this may be a much better version of the bugreport that I was going to write, where sway-git from the AUR was crashing with segfaults whenever I opened spotify at fullscreen (moved to a specific workspace in my config) but also click certain menu-items (such as upload file -> select file) in Microsoft Teams. Both spotify and Teams run under X11.

I'll write down what my tty session said after the segfault occurred:

segmentation fault (core dumped) swayents from display: Broken pipereset by peer (::std::macros::panic macors>:5:6 error from previous GL  common<.. illegible on picture I took>

and another crash:

zsh: segmentation fault (core dumped) swayents from display: Broken pipeERROR    :GL_INVALID_OPERATION :glBufferData: <- error from previous GL commandady registered_opacity': 1.0, 'rules' : None}

and one more this morning, before I downgraded to the stable package in Arch's community repo:

zsh: segmentation fault (core dumped)  swayents from display: Broken pipeue: 0s { code: 32, kind: BrokenPipe, message: "Broken pipe" }, /build/.cargo/registry/src/github.com-1ecc6299db9ec023/smithay-clipboard-0.4.0/src/threaded.rs:511:30

I hope these help isolate it, I'm sorry for not reporting logs, but I need to focus on work for now.

emersion added a commit to emersion/sway that referenced this issue Jul 2, 2020
xdg-shell doesn't allow clients to set the title to NULL, so we
shouldn't need to call wlr_foreign_toplevel_handle_v1_set_title with an
empty string to reset the old one.

Closes: swaywm#5488
@emersion
Copy link
Member

emersion commented Jul 2, 2020

Can you try #5506?

@jbeich
Copy link
Contributor Author

jbeich commented Jul 2, 2020

Can you try #5506?

I confirm, no longer crashes after applying.

emersion added a commit to emersion/sway that referenced this issue Jul 3, 2020
xdg-shell doesn't allow clients to set the title to NULL, so we
shouldn't need to call wlr_foreign_toplevel_handle_v1_set_title with an
empty string to reset the old one.

Closes: swaywm#5488
emersion added a commit that referenced this issue Jul 3, 2020
xdg-shell doesn't allow clients to set the title to NULL, so we
shouldn't need to call wlr_foreign_toplevel_handle_v1_set_title with an
empty string to reset the old one.

Closes: #5488
emersion added a commit to emersion/sway that referenced this issue Jul 15, 2020
xdg-shell doesn't allow clients to set the title to NULL, so we
shouldn't need to call wlr_foreign_toplevel_handle_v1_set_title with an
empty string to reset the old one.

Closes: swaywm#5488
(cherry picked from commit b5a35c4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

Successfully merging a pull request may close this issue.

4 participants