https://bugs.winehq.org/show_bug.cgi?id=49656
Bug ID: 49656 Summary: SAP GUI - Ws2_32.getaddrinfo crashes with non-standard service (/etc/services) Product: Wine Version: 5.14 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: winsock Assignee: wine-bugs@winehq.org Reporter: guimaeda@gmail.com
Created attachment 67890 --> https://bugs.winehq.org/attachment.cgi?id=67890 Terminal output (both success and crash)
Calling getaddrinfo with pNodeName = NULL and a non-standard pServiceName that is not present in /etc/services causes an Unhandled page fault.
I noticed this issue using SAP GUI, a Windows client for a corporate ERP system that uses unusual TCP ports for some of its connections to servers. These port numbers are registered in %WINDIR%\system32\drivers\etc\services during installation, and after going through some traces I noticed the error stopped after adding the same entries to the host's (macOS) /etc/services file.
Since SAP GUI is licensed software, I created a little C program that simulates the same problem. It simply calls getaddrinfo with a service name "I_dont_exist". If this entry is not present in /etc/services, the program crashes.
Tested on Wine 5.14 upstream binaries downloaded from PlayOnLinux/Phoenicis Wine building service. I also tested in other Wine version I use, namely 5.14-staging, 5.0 (WineHQ Homebrew), 5.7-staging (WineHQ Homebrew) and CrossOver 19.0.1. All had the same result.
Sample C program with .exe and source code: https://abap.ninja/bugreport/wine_getaddrinfo_crash.zip
https://bugs.winehq.org/show_bug.cgi?id=49656
--- Comment #1 from Hans Leidekker hans@meelstraat.net --- Created attachment 67897 --> https://bugs.winehq.org/attachment.cgi?id=67897 patch
Thanks for the bug report. Here's a patch that should fix the crash. It doesn't address the issue of getaddrinfo ignoring entries added to %WINDIR%\system32\drivers\etc\services.
https://bugs.winehq.org/show_bug.cgi?id=49656
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |a6d9f46b25a481648a2a06ed8d1 | |594fc59a4e313 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #2 from Hans Leidekker hans@meelstraat.net --- Fixed with a6d9f46b25a481648a2a06ed8d1594fc59a4e313.
https://bugs.winehq.org/show_bug.cgi?id=49656
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.15.
https://bugs.winehq.org/show_bug.cgi?id=49656
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |5.0.x
https://bugs.winehq.org/show_bug.cgi?id=49656
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.3.