https://bugs.winehq.org/show_bug.cgi?id=50297
Bug ID: 50297 Summary: Blindwrite 7 crashes with a stack overflow (followup to #49092) Product: Wine Version: 5.7 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: bernhardu@mailbox.org Distribution: ---
Created attachment 68867 --> https://bugs.winehq.org/attachment.cgi?id=68867 Do wineserver calls on a different stack by using fibers.
I still can reproduce this issue with wine-6.0-rc1.
00f0:err:virtual:virtual_setup_exception stack overflow 4548 bytes in thread 00f0 addr 0x40e68e stack 0x21fe3c (0x220000-0x221000-0x320000)
(rr) bt 30 #0 0xb7db9b5e in __libc_disable_asynccancel (oldtype=0) at ../nptl/cancellation.c:72 #1 0xb7e35705 in __GI___writev (iovcnt=2, iov=0x222058, fd=3) at ../sysdeps/unix/sysv/linux/writev.c:26 #2 __GI___writev (fd=3, iov=0x222058, iovcnt=2) at ../sysdeps/unix/sysv/linux/writev.c:24 #3 0xb7bd68ae in send_request (req=0x2221ac) at .../wine-git/dlls/ntdll/unix/server.c:213 #4 0xb7bd69f0 in server_call_unlocked (req_ptr=0x2221ac) at .../wine-git/dlls/ntdll/unix/server.c:273 #5 0xb7bd6a4b in wine_server_call (req_ptr=0x2221ac) at .../wine-git/dlls/ntdll/unix/server.c:289 #6 0xb7bcf1cd in NtOpenKeyEx (key=0x222340, access=131097, attr=0x2222b8, options=0) at .../wine-git/dlls/ntdll/unix/registry.c:112 #7 0xb7bb11be in __wine_syscall_dispatcher () from /home/benutzer/.local/share/rr/wine-1/mmap_pack_2_ntdll.so #8 0x7bc0bdcc in NtOpenKeyEx@16 () from /home/benutzer/.local/share/rr/wine-1/mmap_pack_343_ntdll.dll #9 0x7b0561af in RegOpenKeyExW@20 (hkey=<optimized out>, name=0x46c06dc, options=0, access=131097, retkey=0x222340) at .../wine-git/dlls/kernelbase/registry.c:208 #10 0x006996a6 in ?? () #11 0x0069ab41 in ?? () #12 0x00699e14 in ?? () #13 0x0069a89b in ?? () #14 0x0069a84f in ?? () #15 0x0073bb4b in ?? () #16 0x007354d2 in ?? () #17 0x00736cc5 in ?? () #18 0x00736f53 in ?? () #19 0x00737f77 in ?? () #20 0x007384a9 in ?? () #21 0x00a9a1a7 in ?? () #22 0x00a99388 in ?? () #23 0x00a99394 in ?? () #24 0x00a99394 in ?? () #25 0x00a99394 in ?? () #26 0x00a99394 in ?? () #27 0x00a99394 in ?? () #28 0x00a99394 in ?? () ...
I tried to have another look and got to the impression that blindwrite expects RegOpenKeyExW and RegSetValueExW too use less stack. I experimented a bit and one way to achive this was to do the work in these functions on a different stack. Attached proof of concept uses fibers for this. With this patch blindwrite can finish its stack exhaustion without visible error and shows the trial option dialog. After one successful start that patch is no longer necessarry.
Another option to might be to use some more guard pages and switch them to regular pages when we are inside wine code?