https://bugs.winehq.org/show_bug.cgi?id=52335
Bug ID: 52335 Summary: StarCraft Remastered hangs in Multiplayer screen Product: Wine-staging Version: 7.0-rc4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: dimich.dmb@gmail.com CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Distribution: ---
Created attachment 71502 --> https://bugs.winehq.org/attachment.cgi?id=71502 Screenshot
With wine-staging 7.0rc4 run StarCraft Remastered from Battle.net launcher, in main menu select "Multiplayer" -> "Expansion". The game hangs. "Select Connection" list is empty, buttons are empty (see attached screenshot).
After downgrading wine-staging to 7.0rc3 the issue disappears and everything works fine.
Distro: Arch Linux.
https://bugs.winehq.org/show_bug.cgi?id=52335
--- Comment #1 from Dmytro Bagrii dimich.dmb@gmail.com --- Created attachment 71503 --> https://bugs.winehq.org/attachment.cgi?id=71503 Output when error occures
https://bugs.winehq.org/show_bug.cgi?id=52335
--- Comment #2 from Dmytro Bagrii dimich.dmb@gmail.com --- Created attachment 71504 --> https://bugs.winehq.org/attachment.cgi?id=71504 Output when error doesn't occur
https://bugs.winehq.org/show_bug.cgi?id=52335
Maciej Stanczew maciej.stanczew+b@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maciej.stanczew+b@gmail.com
--- Comment #3 from Maciej Stanczew maciej.stanczew+b@gmail.com --- For me the game hangs even earlier, on the main menu just after clicking "Expansion". It also reproduces on non-staging Wine.
I think it might be related to Bonjour (which the game offers to install for you). When I created a fresh prefix, so that Bonjour was not installed, then I could successfully reach the "Select Connection" screen. Agreeing to install Bonjour when on rc4 hanged the game. I then went back to rc3 and (successfully) installed Bonjour there, and then updated to rc4 and got the hang again.
https://bugs.winehq.org/show_bug.cgi?id=52335
--- Comment #4 from Maciej Stanczew maciej.stanczew+b@gmail.com --- Bisection result:
b1a2238a10413af1437982dd80f0c61d216ec12e is the first bad commit commit b1a2238a10413af1437982dd80f0c61d216ec12e Author: Zebediah Figura zfigura@codeweavers.com Date: Wed Dec 29 17:15:33 2021 -0600
server: Reselect the socket returned from accept_socket().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52024 Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
dlls/ws2_32/tests/sock.c | 4 ++-- server/sock.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
https://bugs.winehq.org/show_bug.cgi?id=52335
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|leslie_alistair@hotmail.com | Keywords| |regression Component|-unknown |winsock Product|Wine-staging |Wine Regression SHA1| |b1a2238a10413af1437982dd80f | |0c61d216ec12e
https://bugs.winehq.org/show_bug.cgi?id=52335
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #5 from Zebediah Figura z.figura12@gmail.com --- I can reproduce the problem and I think I see why it happens.
The basic problem is that the game does a mDNS query to the Bonjour process and hangs when it doesn't respond. Not great design there (you should really put a reasonable timeout on these things), but anyway, the Bonjour socket hangs because it essentially does this:
event1 = CreateEvent(...); WSAEventSelect(listener, event1, FD_ACCEPT); when event1 is signaled: s = accept(listener, ...); event2 = CreateEvent(...); WSAEventSelect(s, event2, FD_READ); when event2 is signaled: read data etc.
The effect of b1a2238a1 is that when data is already available in the pipe for the newly accepted socket (which seems to be always true for this program) the socket will have its pending_events and reported_events include AFD_POLL_READ. WSAEventSelect() will try to reselect the socket, but the problem is that it already has reported pending events via event1 and therefore won't actually select for POLLIN.
It turns out that we're always supposed to signal the event in WSAEventSelect() if there are pending events to be read (that match the mask), so technically this is a case of a fix exposing another bug. I've sent a patch.
https://bugs.winehq.org/show_bug.cgi?id=52335
--- Comment #6 from Maciej Stanczew maciej.stanczew+b@gmail.com --- I can confirm that the game doesn't hang anymore on 7.0-rc4 with the patch (the one adding 'sock_wake_up' call), both on Wine and Staging. As always, many thanks for your work.
https://bugs.winehq.org/show_bug.cgi?id=52335
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |9632048c689801abb7482111773 | |c7714e0f1581a
--- Comment #7 from Zebediah Figura z.figura12@gmail.com --- Fixed by https://source.winehq.org/git/wine.git/commitdiff/9632048c689801abb7482111773c7714e0f1581a.
https://bugs.winehq.org/show_bug.cgi?id=52335
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.0-rc6.
https://bugs.winehq.org/show_bug.cgi?id=52335
--- Comment #9 from Dmytro Bagrii dimich.dmb@gmail.com --- It worked fine with 7.0-rc6 but after update to 7.0 release it's asking about starting Bonjour and then "Failed to start the Bonjour service". Should this ticket be reopened or it's better to create another one?
https://bugs.winehq.org/show_bug.cgi?id=52335
--- Comment #10 from Zebediah Figura z.figura12@gmail.com --- (In reply to Dmytro Bagrii from comment #9)
It worked fine with 7.0-rc6 but after update to 7.0 release it's asking about starting Bonjour and then "Failed to start the Bonjour service". Should this ticket be reopened or it's better to create another one?
It would be better to file a new bug for that, yes.