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

5 second delay when opening Xt dialogs #307

Closed
badjames opened this issue Jun 17, 2021 · 5 comments
Closed

5 second delay when opening Xt dialogs #307

badjames opened this issue Jun 17, 2021 · 5 comments
Labels
bug Something isn't working fixinbound weston-upstream-bug same issue can be observed with original weston compositor running on other Linux native environment

Comments

@badjames
Copy link

badjames commented Jun 17, 2021

Environment

Windows build number: 10.0.21390.2025
Your Distribution version: Ubuntu 20.04 LTS
Your WSLg version: 1.0.22 (Windows Subsystem for Linux WSLg Preview)

Steps to reproduce

  1. Install "nedit" with:

sudo apt install nedit

  1. Run "nedit"
  2. Press CTRL+s to save file

This should imediately display a file save dialog, but there is a 5 second delay before it appears. This does not occur on Ubuntu 20.04 running Wayland in a standard VM or bare metal. The Xt call that is blocking is "XtManageChild":

#0 0x00007ffff7527ac7 in __GI___poll (fds=0x7fffffff7b40, nfds=1, timeout=4289)
at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007ffff78bce7a in _XtWaitForSomething () from /lib/x86_64-linux-gnu/libXt.so.6
#2 0x00007ffff78ca8a8 in ?? () from /lib/x86_64-linux-gnu/libXt.so.6
#3 0x00007ffff7c6c5ad in ?? () from /lib/x86_64-linux-gnu/libXm.so.4
#4 0x00007ffff78b4d56 in _XtMakeGeometryRequest () from /lib/x86_64-linux-gnu/libXt.so.6
#5 0x00007ffff78b4f80 in XtMakeGeometryRequest () from /lib/x86_64-linux-gnu/libXt.so.6
#6 0x00007ffff7b854c8 in ?? () from /lib/x86_64-linux-gnu/libXm.so.4
#7 0x00007ffff78bbdb9 in ?? () from /lib/x86_64-linux-gnu/libXt.so.6
#8 0x00007ffff78bc26e in XtManageChildren () from /lib/x86_64-linux-gnu/libXt.so.6
#9 0x00007ffff78bc378 in XtManageChild () from /lib/x86_64-linux-gnu/libXt.so.6
#10 0x0000555555620177 in ?? ()
#11 0x000055555561cb2d in ?? ()
#12 0x000055555558e281 in ?? ()
#13 0x000055555558f0f6 in ?? ()
#14 0x00007ffff78d047b in XtCallActionProc () from /lib/x86_64-linux-gnu/libXt.so.6
#15 0x00007ffff7bd1ec2 in ?? () from /lib/x86_64-linux-gnu/libXm.so.4
#16 0x00007ffff7c79731 in ?? () from /lib/x86_64-linux-gnu/libXm.so.4
#17 0x00007ffff7c7990d in ?? () from /lib/x86_64-linux-gnu/libXm.so.4
#18 0x00007ffff7c799dc in _XmRC_KeyboardInputHandler () from /lib/x86_64-linux-gnu/libXm.so.4
#19 0x00007ffff78b22be in XtDispatchEventToWidget () from /lib/x86_64-linux-gnu/libXt.so.6
#20 0x00007ffff78b283d in ?? () from /lib/x86_64-linux-gnu/libXt.so.6
#21 0x00007ffff78b2919 in XtDispatchEvent () from /lib/x86_64-linux-gnu/libXt.so.6
#22 0x00007ffff78be5cf in XtAppProcessEvent () from /lib/x86_64-linux-gnu/libXt.so.6
#23 0x00007ffff78b2d2d in XtAppMainLoop () from /lib/x86_64-linux-gnu/libXt.so.6

WSL logs:

pulseaudio.log
weston.log
versions.txt

Expected behavior

Dialog should appear immediately

Actual behavior

Dialog appears after a 5 second delay.

@badjames badjames added the bug Something isn't working label Jun 17, 2021
@dpeterc
Copy link

dpeterc commented Jun 17, 2021

I confirm this bug also in other X11 applications on WSLG. The delay to pop-up dialog windows can be even longer than 5 seconds.

@hideyukn88
Copy link
Member

@badjames, thanks for reporting the issue, I confirmed this does repro with the latest WSLg. Using nedit, it doesn't occur to every dialog, like CTRL+O and ALT+I come up immediately, but it does have delay like CTRL+S, SHIFT+CTRL+F and SHIFT+CTRL+R,

@dpeterc, thanks for info, would you please share what-else X11 applications do you observe this issue? thanks!

@badjames
Copy link
Author

badjames commented Jun 25, 2021

I'm not sure what the difference between the nedit file "open" and "save" actions are that cause the delay in one but not the other.

I did run nedit under xtruss and it appears the hang is at the point that the WM_SIZE_HINTS property is set:

ChangeProperty(window=w#0040025F, property=a"WM_NORMAL_HINTS", type=a"WM_SIZE_HINTS", format=32, mode=Replace, data=0000022C:000004FF:000002CF:000001F4:000001B0:00000000:00000000:00000EE7:00000497:00000000:00000000:00000000:00000000:00000000:00000000:...)

In the code, it is the XtManageChild call at line 786 that hangs:

https://sourceforge.net/p/nedit/git/ci/master/tree/util/misc.c#l786

If you want a simple application that reproduces the issue, try this:

https://github.com/badjames/wslg/blob/main/hello_dialog.c

It is a simple program that attempts to display a dialog using XmCreateInformationDialog. It hangs on XtManageChild as well, and xtruss shows it hanging at the point of the ChangeProperty X11 call.

Hope this helps!

@dpeterc
Copy link

dpeterc commented Jun 29, 2021

The other X11 applications where I observe this issue are
ddd (data display debugger)
grace (xmgrace scientific visualization software)
These are all Motif applications, so menus do not work (already reported in a different bug report), so menu entries need to be called from the shortcut while the menu is open by mouse (for example Ctrl+o).
Popup windows open after considerable delay (several seconds). But if you call them the next time, it is fast.
Usually these programs create the whole user interface widget tree at the startup, so opening of dialog windows should be instant, once the main application window is up and running.

@hideyukn88 hideyukn88 added the weston-upstream-bug same issue can be observed with original weston compositor running on other Linux native environment label Sep 27, 2021
@hideyukn88
Copy link
Member

Fixed in WSLg 1.0.40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixinbound weston-upstream-bug same issue can be observed with original weston compositor running on other Linux native environment
Projects
None yet
Development

No branches or pull requests

3 participants