https://bugs.winehq.org/show_bug.cgi?id=49643
Bug ID: 49643 Summary: Calling ClipCursor too frequently can cause stack overflow in foreground window thread. Product: Wine Version: 5.13 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: rbernon@codeweavers.com Distribution: ---
Created attachment 67845 --> https://bugs.winehq.org/attachment.cgi?id=67845 Reproducing sample application
Calling ClipCursor too frequently in a non-foreground thread may cause the foreground window thread to overflow its stack. This is happening under some circumstances with CoD: WWII.
This is inherent to the current implementation where every ClipCursor request from a non-foreground thread involves synchronously sending internal messages to the foreground window thread, then to the desktop thread. Each ClipCursor request is processed when the desktop thread is notified, growing the stack every time, until it overflows.
The attached program can be used to easily reproduce the issue.
https://bugs.winehq.org/show_bug.cgi?id=49643
--- Comment #1 from Rémi Bernon rbernon@codeweavers.com --- Created attachment 67988 --> https://bugs.winehq.org/attachment.cgi?id=67988 Workaround
The attached patch should fix the problem by making ClipCursor requests synchronous, but it would require some more testing to be sure it's not going to end up locking other applications.
https://bugs.winehq.org/show_bug.cgi?id=49643
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |432858b285d2b63eca6f99a162c | |9a13dd6e6ac71 Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Gijs Vermeulen gijsvrm@gmail.com --- Rémi confirmed on Discord that this was fixed by https://source.winehq.org/git/wine.git/commit/432858b285d2b63eca6f99a162c9a13dd6e6ac71, marking as such.
https://bugs.winehq.org/show_bug.cgi?id=49643
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.18.
https://bugs.winehq.org/show_bug.cgi?id=49643
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |5.0.x
https://bugs.winehq.org/show_bug.cgi?id=49643
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|5.0.x |---
--- Comment #4 from Michael Stefaniuc mstefani@winehq.org --- Removing the 5.0.x milestone from bug fixes included in 5.0.4.