http://bugs.winehq.org/show_bug.cgi?id=59991 Bug ID: 59991 Summary: ntdll-ForceBottomUpAlloc: MEM_TOP_DOWN allocations can return addresses above the user address limit Product: Wine-staging Version: 11.12 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@list.winehq.org Reporter: iviv@etersoft.ru CC: leslie_alistair@hotmail.com, z.figura12@gmail.com Target Milestone: --- Distribution: --- Created attachment 81394 --> http://bugs.winehq.org/attachment.cgi?id=81394 Suggested fix Expected behavior: Top-down allocation should either return a valid address range below lpMaximumApplicationAddress or fail with a Windows-compatible status code. Actual behavior: Wine returns STATUS_SUCCESS with an address range above lpMaximumApplicationAddress. Error occurs after applying patches from https://gitlab.winehq.org/wine/wine-staging/-/blob/master/patches/ntdll-Forc... 32-bit applications can receive top-down allocations above the process user address limit. I used an app that shows an error on exit: Application made attempt to free invalid or unknown memory block: $FFFF00E0 The problem appears when a 32-bit process uses top-down virtual memory allocation. Wine may return an address above max, for example, in a 32-bit process: MaxAppAddress = 7ffeffff NtAllocateVirtualMemory(... MEM_TOP_DOWN ...) = 7fff0000 The returned address range is outside the valid user address range. VirtualQuery() does not recognize the returned address, but NtAllocateVirtualMemory still reports STATUS_SUCCESS. Native Windows does not return such addresses. I am attaching an example of a fix that works for me. It comes down to setting address limit via get_wow_user_space_limit() when wow64 is used. -- 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.