sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

ST hangs every few seconds under Gnome Wayland

Open SamiBenChaabane opened this issue 3 years ago • 11 comments
trafficstars

Description of the bug

The issue seems to occur under two circumstances, the first one is when opening a second window/instance of ST the second window/instance starts hanging once every 10 to 20 seconds, the system suggests to kill or wait for the process but after a couple of seconds ST unfreezes and the cycle repeats, the second circumstance is when using split view with 2 or more columns and trying to resize the window results in the exact same hanging described above (This issue occurs only under wayland and happens both with hardware/software rendering).

Steps to reproduce

  1. Start sublime text in safe mode
  2. Open a second window/instance OR go in view, select 2 or more columns and resize the window.

Expected behavior

  • No hangs or freezes should occur when using the second window/instance.
  • No hangs or freezes should occur when resizing a window with two or more columns.

Actual behavior

  • The second window/instance hangs every 10 to 20 seconds for a few seconds.
  • Resizing a window with two or more columns results in hanging for a few seconds.

Sublime Text build number

4134

Operating system & version

Arch linux

(Linux) Desktop environment and/or window manager

Gnome 42.3

Additional information

  1. I’m using a GTX 1060 with the proprietary drivers.
  2. Windowing system is wayland.
  3. The only packages installed are A file icon and Rustfmt.

OpenGL context information

OpenGL Context Information:
GL API Version: 4.1.0 NVIDIA 515.57
GLSL Version:
4.10 NVIDIA via Cg compiler
Vendor: NVIDIA Corporation
Renderer: NVIDIA GeForce GTX 1060/PCIe/SSE2

SamiBenChaabane avatar Jul 12 '22 18:07 SamiBenChaabane

Just to confirm: this doesn't happen if you use X11 instead of Wayland? I'm unable to reproduce this under Manjaro with Gnome 42.2.

BenjaminSchaaf avatar Jul 13 '22 03:07 BenjaminSchaaf

Just to confirm: this doesn't happen if you use X11 instead of Wayland? I'm unable to reproduce this under Manjaro with Gnome 42.2.

Correct, this only happens under wayland.

ghost avatar Jul 13 '22 07:07 ghost

Can you run ST under a debugger: gdb /opt/sublime_text/sublime_text --debug --multiinstance, break (ctrl+c) while it's hanging and do a traceback (bt)?

BenjaminSchaaf avatar Jul 13 '22 07:07 BenjaminSchaaf

Can you run ST under a debugger: gdb /opt/sublime_text/sublime_text --debug --multiinstance, break (ctrl+c) while it's hanging and do a traceback (bt)?

Just tried that but gdb is not printing a stack trace, could that be because ST is not actually crashing?

ghost avatar Jul 13 '22 14:07 ghost

Can you provide the full output?

BenjaminSchaaf avatar Jul 14 '22 10:07 BenjaminSchaaf

Can you provide the full output?

Apologies for the delay:


Starting program: /opt/sublime_text/sublime_text 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Detaching after fork from child process 2147]
[Inferior 1 (process 2144) exited normally]
(gdb) Quit
(gdb) bt
No stack.

ghost avatar Jul 15 '22 15:07 ghost

Ah sorry, the command for gdb is: gdb --args /opt/sublime_text/sublime_text --debug --multiinstance. You then type r to start the process, break with ctrl+c once it's hanging and then type bt.

BenjaminSchaaf avatar Jul 15 '22 17:07 BenjaminSchaaf

Ah sorry, the command for gdb is: gdb --args /opt/sublime_text/sublime_text --debug --multiinstance. You then type r to start the process, break with ctrl+c once it's hanging and then type bt.

(gdb) bt
#0  0x00007ffff7905c3f in poll () at /usr/lib/libc.so.6
#1  0x00007ffff7ea6f68 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7e501cf in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff53d8e2f in gtk_main () at /usr/lib/libgtk-3.so
#4  0x000000000074a130 in  ()
#5  0x000000000058fcfa in  ()
#6  0x00007ffff7829290 in  () at /usr/lib/libc.so.6
#7  0x00007ffff782934a in __libc_start_main () at /usr/lib/libc.so.6
#8  0x00000000004e342a in  ()

This is when the "wait or kil" dialog shows up

ghost avatar Jul 15 '22 18:07 ghost

That looks like it's just sitting idle with all events processed, ie. not hanging. Are you sure that's a traceback from when it's hanging?

BenjaminSchaaf avatar Aug 09 '22 04:08 BenjaminSchaaf

That looks like it's just sitting idle with all events processed, ie. not hanging. Are you sure that's a traceback from when it's hanging?

Absolutely, I did it multiple times with the same output,could this be mutter not playing nice with Nvidia's proprietary driver if sublime is not to blame? I'm not that involved in the inner workings of rendering but I have encountered many bugs across many programs that just worked fine on X11.

ghost avatar Aug 09 '22 06:08 ghost

Certainly possible. You could try checking apps that work similarly to ST like libreoffice, firefox, chrome and see if it happens anywhere else.

BenjaminSchaaf avatar Aug 09 '22 06:08 BenjaminSchaaf

I have the same issue, it seems it is related to resizing sublime text to maximum window size.

If I maximize sublime-text window via double click on the window bar it becomes too wide for the screen. If I un-maximize sublime-text again, the laggyness stops.

image

bf avatar Nov 13 '22 13:11 bf

@SamiBenChaabane did you check if sublime-text window is maximized? maybe also your "x" button in menu bar is missing/hidden outside viewport?

bf avatar Nov 16 '22 09:11 bf

If I maximize sublime-text window via double click on the window bar it becomes too wide for the screen. If I un-maximize sublime-text again, the laggyness stops.

That just sounds like a rendering performance issue - my guess is you have a high-resolution display. You can solve this by using the "hardware_acceleration": "opengl" setting.

BenjaminSchaaf avatar Mar 19 '24 06:03 BenjaminSchaaf

Closing for now due to inactivity; the original issue could not be reproduced.

BenjaminSchaaf avatar Mar 19 '24 06:03 BenjaminSchaaf