http://bugs.winehq.org/show_bug.cgi?id=60484 Bug ID: 60484 Summary: wine 11.19 dnsapi parsing a large /etc/hosts stalls fresh prefix initialization Product: Wine Version: 11.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: dnsapi Assignee: wine-bugs@list.winehq.org Reporter: xash@riseup.net Target Milestone: --- Distribution: --- Created attachment 82331 --> http://bugs.winehq.org/attachment.cgi?id=82331 bash script to repro the issue Steps to reproduce: 1. Run the attached repro-wine-hosts.sh script. It generates two synthetic hosts files, one with two lines and one with 434,612 lines, then starts wineboot -i with a fresh prefix for each. bubblewrap bind-mounts each file as /etc/hosts only for Wine. 2. Compare the two prefixes and the script output after the 30-second timeout. Actual results on my machine: - Both wineboot commands hit the 30-second timeout (exit 124). - With the two-line hosts file, the prefix reaches a 2,226,829-byte system.reg and has a .update-timestamp file before the timeout. - With the 434,612-line hosts file (13,038,334 bytes), the prefix only reaches a 1,212-byte system.reg and has no .update-timestamp file before the timeout. - A separate WINEDEBUG=trace+dnsapi capture using my real 434,612-line hosts file shows wineboot calling DnsQuery_UTF8 for the local computer name, followed by thousands of get_next_host_entry "parsing line" messages. The 20-second capture timed out while those messages were still being emitted. Expected result: The size of /etc/hosts should not prevent a fresh Wine prefix from initializing. The application executable is not needed to reproduce this. Workaround: Starting Wine with a minimal /etc/hosts bind-mounted via bubblewrap lets the prefix initialize. My real hosts file is 12,476,010 bytes and has 434,612 lines. Related source: The 11.19 dnsapi implementation parses /etc/hosts during DNS queries: https://github.com/wine-mirror/wine/blob/wine-11.19/dlls/dnsapi/query.c The raw WINEDEBUG log contains the contents of my actual /etc/hosts and was not attached. Output of the script: ``` wine-11.19 (Staging) Linux 7.2.9-arch1-1 2 34 /tmp/wine-hosts-repro.bikl8L/hosts-small 434612 13038334 /tmp/wine-hosts-repro.bikl8L/hosts-large 434614 13038368 total small: wineboot exit=124 elapsed=30s large: wineboot exit=124 elapsed=30s ``` -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.