wlmaker icon indicating copy to clipboard operation
wlmaker copied to clipboard

Emacs-gtk crashes wlmaker

Open rjhorniii opened this issue 11 months ago • 6 comments

Starting emacs-gtk crashes wlmaker before any visible change on windows. The same machine and code using Plasma (wayland) runs emacs-gtk. The crash is before any kind of visible user interaction by emacs.

The wlmaker error log is

errors2.txt

The emacs information is

This is GNU Emacs 30.1 (build 2, x86_64-suse-linux-gnu, GTK+ Version
3.24.50, cairo version 1.18.4)
Copyright (C) 2025 Free Software Foundation, Inc.

emacs -nw behaves as expected, so this is entirely the GUI code.

rjhorniii avatar May 24 '25 14:05 rjhorniii

Hm, that's bad. I only have an older version of emacs (still using the X11 client), no crash there. Unfortunately, the error log doesn't give much detail.

Can you try obtaining a richer backtrace?

  • Option 1: Run wlmaker in gdb.
  • Option 2: If you can install https://github.com/ianlancetaylor/libbacktrace (for Debian: https://packages.debian.org/sid/libbacktrace0).

Either approach should give a backtrace to what & where it crashed.

phkaeser avatar May 24 '25 19:05 phkaeser

Not much more information, but CMake says -- Found libbacktrace: /usr/lib64/libbacktrace.so.

errors3.txt

rjhorniii avatar May 24 '25 19:05 rjhorniii

Thanks! That helps -- I think I have a way to reproduce.

phkaeser avatar May 24 '25 19:05 phkaeser

A tiny bit more info from gdb but basically the same. gdb results:

2025-05-24 15:30:58.631 (INFO) src/xdg_decoration.c:315 XDG decoration request_mode for XDG surface 0x120e6d0, content 0x1211be0: Current 0, pending 0, scheduled 2, requested 2. Set: 2
2025-05-24 15:31:20.567 (INFO) src/xdg_toplevel.c:199 Created window 0x128da90 for wlmtk XDG toplevel surface 0x128d540
2025-05-24 15:31:20.567 (INFO) src/xdg_shell.c:145 XDG shell: Toolkit window 0x128da90 for toplevel 0x120aea0
2025-05-24 15:31:20.567 (WARNING) src/xdg_toplevel.c:739 Unimplemented: set_parent for XDG toplevel 0x128d540
2025-05-24 15:31:20.567 (WARNING) src/xdg_toplevel.c:781 Unimplemented: set_app_id for XDG toplevel 0x128d540
2025-05-24 15:31:20.567 (FATAL) src/toolkit/window.c:516 ASSERT failed: NULL != wlmtk_window_get_workspace(window_ptr)

Thread 1 "wlmaker" received signal SIGTRAP, Trace/breakpoint trap.
bs_log_vwrite (severity=BS_FATAL, file_name_ptr=0x4844a4 "./src/toolkit/window.c", line_num=516, 
    fmt_ptr=0x484526 "ASSERT failed: %s", ap=0x7fffffffca88)
    at /home/hornrj/wlmaker/submodules/libbase/src/log.c:150
150     }
Missing separate debuginfos, use: zypper install libncurses6-debuginfo-6.5.20250503-69.1.x86_64 libgcc_s1-debuginfo-15.1.1+git9595-1.1.x86_64 libgbm1-debuginfo-25.0.5-1699.415.pm.3.x86_64 Mesa-libEGL1-debuginfo-25.0.5-1699.415.pm.3.x86_64 Mesa-dri-debuginfo-25.0.5-1699.415.pm.5.x86_64 libstdc++6-debuginfo-15.1.1+git9595-1.1.x86_64
(gdb) 

rjhorniii avatar May 24 '25 19:05 rjhorniii

wlmaker mistakenly requires a window to be mapped when the client sets fullscreen mode (even if the client specifies fullscreen = false). Instead, the window should accept the request, and apply the state once it becomes mapped.

https://github.com/phkaeser/wlmaker/blob/main/src/toolkit/window.c#L516

A short-term hack may be to simply ignore the request when the window isn't mapped yet; since state tracking will be a bit more work.

phkaeser avatar May 24 '25 19:05 phkaeser

Thks. For now it's easiest for me to use emacsclient -nw in a terminal and use an emacs server. I only caught this one because the default behavior for emacs was to bring up the gtk support. I typed emacs out of habit. There's something a bit wonky or different about the GTK behavior on Plasma (Wayland). I'll figure that out later.

rjhorniii avatar May 24 '25 19:05 rjhorniii