Solved Emacs hanging system completely under wayland

Hello, after a problematic journey with drm-kmod, I finally managed to get wayland working on Renoir.
Currently, I am using Wayfire as my compositor, and everything works well.
Issue is, every time I try to start emacs GUI, the whole operating system hangs, with no possible input to kill it, logout or even switch TTY.
I have tried installing emacs, emacs-devel, installing emacs from ports with GTK2, and disabling DBUS, GCONF and GSETTINGS as an older thread suggested.
To no avail, my system keeps hanging and the only way to recover it is with a hard shutdown. emacs-nox and emacs-devel-nox work totally fine under a terminal emulator.

I would like to know if anyone has managed to get emacs GUI working under wayland, or should I wait a bit more for emacs-28 to come out as it supposedly will be more compatible with wayland.
Thanks beforehand.
 
if you can't even ssh in from another device it's probably caused by the video driver
if you can ssh in it's probably wayland and/or video driver
so even if the new emacs will work other desktop clients could trigger the problem
 
If you are in graphics mode, why don't you use a simple wysiwyg editor?
Graphics mode is not the question here, as I could also use GNU nano or ee. I like GUI emacs cause it gives me more flexibility for keybindings and features not present on terminal version. Not wanting to enter the editor wars.
 
If you are in graphics mode, why don't you use a simple wysiwyg editor?
Probably for the same reason I like to use gvim when I have a GUI available. It's the same editor as you're used to, in the OP's case emacs, just with added graphical menus and other useful GUI features.
 
OP, are you building emacs from ports or using prebuilt package?
FreeBSD-13 or FreeBSD-12? (just in case packages and not sure if it makes a difference)
If from ports, I'm assuming you updated ports tree and rebuilt? It looks like editors/emacs-devel is emacs-28.
Quick look at Makefile, there are config options for a bunch of X libs. Not sure how all that fits with Wayland.

maybe do "truss emacs" to see if you can get at least what syscalls are happening. Maybe give a clue.
 
OP, are you building emacs from ports or using prebuilt package?
FreeBSD-13 or FreeBSD-12? (just in case packages and not sure if it makes a difference)
If from ports, I'm assuming you updated ports tree and rebuilt? It looks like editors/emacs-devel is emacs-28.
Quick look at Makefile, there are config options for a bunch of X libs. Not sure how all that fits with Wayland.

maybe do "truss emacs" to see if you can get at least what syscalls are happening. Maybe give a clue.
I tried both ways.
I'm using FreeBSD-13, with a customized kernel (mostly just getting rid of extra eth and wifi drivers).
I updated ports tree yesterday, and I have tried both GTK2 and GTK3 for emacs.

I'm going to try with truss, thanks for the pointer
 
  • Like
Reactions: mer
It may not show anything, but since it will show the syscalls being done, you may get a little clue.
 
FWIW and as a datapoint, I am using emacs (from packages, currently 27.2,3) a lot on FreeBSD 13 and i915 with sway (Xwayland of course as emacs 27 does not yet support Wayland) and it is running rock solid.
 
Well, to whom this might interest. After some time of inactivity I decided today not to give up on emacs.
I proceeded to dump wayland and emacs logs, to rebuild with dbus, without, with GTK3, GTK2... Until I saw emacs did actually work under sway.

After hours of wrestling with it, I finally found the problem that actually made emacs hang the entire video up in Wayfire:
the cursor.
Literally, making the variable XCURSOR_THEME empty makes it run again. Turns out for some reason or another emacs does not actually like my animated cursor and decides to crash the entire display until I force it shut down.
Never in my life would have I believed a cursor theme would make me lose weeks in desperation to get emacs working.
Thanks everyone for the responses.
 
Back
Top