https://bugs.winehq.org/show_bug.cgi?id=39885
Bug ID: 39885 Summary: Cannot allocate more than 32gb of memory Product: Wine Version: 1.9.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: blocker Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: rynzar@gmail.com Distribution: ---
Created attachment 53258 --> https://bugs.winehq.org/attachment.cgi?id=53258 wine debug
I am having issues mallocing more than 32GB of memory running RAM intensive Windows applications using Wine on an Ubuntu amazon EC2 cloud with 128 GB of RAM. When I run the c++ code http://stackoverflow.com/questions/34516616/wine-cant-use-more-than-32gb-of-... in linux it works.
If I run the .exe that does the same thing I can only allocate up to 32GB. I tried Wine 1.6, 1.7 and 1.9. I am using the 64 bit version as well.
I talked in the IRC chat #winehq and they told me to run the code with WINEDEBUG=+heap,+virtual,+tid flags.
He pointed out this line might be useful to look at in my logs:
0024:warn:heap:allocate_large_block Could not allocate block for 800000000 bytes
and told me to submit a bug report. The log is attached.
https://bugs.winehq.org/show_bug.cgi?id=39885
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|blocker |normal
https://bugs.winehq.org/show_bug.cgi?id=39885
--- Comment #1 from rynzar@gmail.com --- The code I used was:
#include <stdlib.h> #include <iostream>
int main() { size_t gb_in_bytes = size_t(1)<<size_t(30); // 1 GB in bytes (2^30). // try to allocate 1 block of 'i' GB. for (size_t i = 25; i < 35; ++ i) { size_t n = i * gb_in_bytes; void *p = ::malloc(n); std::cout << "allocation of 1 x " << (n/double(gb_in_bytes)) << " GB of data. Ok? " << ((p==0)? "nope" : "yes") << std::endl; ::free(p); } }
https://bugs.winehq.org/show_bug.cgi?id=39885
--- Comment #2 from Alexandre Julliard julliard@winehq.org --- The virtual heap is running out of space. Storing the page protection flags for 32Gb requires 8Mb, which is the heap limit. You can increase VIRTUAL_HEAP_SIZE in dlls/ntdll/virtual.c to work around it, but we probably want a different mechanism for such cases.
https://bugs.winehq.org/show_bug.cgi?id=39885
--- Comment #3 from rynzar@gmail.com --- Thanks Alexandre, this solved my issue. I updated Stack Overflow with the solution and credited you for the tip. http://stackoverflow.com/questions/34516616/wine-cant-use-more-than-32gb-of-...
https://bugs.winehq.org/show_bug.cgi?id=39885
Józef Kucia joseph.kucia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 CC| |joseph.kucia@gmail.com Status|UNCONFIRMED |NEW Component|-unknown |ntdll
--- Comment #4 from Józef Kucia joseph.kucia@gmail.com --- Witcher 3 is affected by this bug.
https://bugs.winehq.org/show_bug.cgi?id=39885
Shmerl shtetldik@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |shtetldik@gmail.com
--- Comment #5 from Shmerl shtetldik@gmail.com --- Can you please add Witcher 3 to the list of applications affected by this bug?
https://bugs.winehq.org/show_bug.cgi?id=39885
fjfrackiewicz@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fjfrackiewicz@gmail.com
--- Comment #6 from fjfrackiewicz@gmail.com --- (In reply to Shmerl from comment #5)
Can you please add Witcher 3 to the list of applications affected by this bug?
I submitted this bug to this AppDB application:
https://appdb.winehq.org/objectManager.php?sClass=application&iId=16884
Keep in mind, anyone can submit bug links and once they get accepted, they will get added as an affected application to this bug.
https://bugs.winehq.org/show_bug.cgi?id=39885
--- Comment #7 from Shmerl shtetldik@gmail.com --- (In reply to Alexandre Julliard from comment #2)
The virtual heap is running out of space. Storing the page protection flags for 32Gb requires 8Mb, which is the heap limit. You can increase VIRTUAL_HEAP_SIZE in dlls/ntdll/virtual.c to work around it, but we probably want a different mechanism for such cases.
Is it possible to include this workaround in Wine staging, until better solution will be found? It will help testing applications which are otherwise failing to launch because of it.
https://bugs.winehq.org/show_bug.cgi?id=39885
termac terror.macbeth.I@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |terror.macbeth.I@gmail.com
--- Comment #8 from termac terror.macbeth.I@gmail.com --- *** Bug 40858 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=39885
--- Comment #9 from termac terror.macbeth.I@gmail.com --- In contrast to the original report I only have 8GB of RAM. Doubling the value of VIRTUAL_HEAP_SIZE allowed me to launch a 64 bit application that would start previously. For logs have a look at https://bugs.winehq.org/show_bug.cgi?id=40858.
https://bugs.winehq.org/show_bug.cgi?id=39885
Józef Kucia joseph.kucia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39180
https://bugs.winehq.org/show_bug.cgi?id=39885
Adam Bolte abolte@systemsaviour.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |abolte@systemsaviour.com
https://bugs.winehq.org/show_bug.cgi?id=39885
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/ntdll-Grow_Vir | |tual_Heap Status|NEW |STAGED CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, michael@fds-team.de, | |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=39885
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #10 from winetest@luukku.com --- I just wonder if space engineers game needs this. It has garbage rating all recent efforts with wine and the latest appdb entry had this mentioned
preloader: Warning: failed to reserve range 00010000-00110000
https://bugs.winehq.org/show_bug.cgi?id=39885
Mathieu Comandon strider@strycore.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |strider@strycore.com
https://bugs.winehq.org/show_bug.cgi?id=39885
tokktokk fdsfgs@krutt.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fdsfgs@krutt.org
https://bugs.winehq.org/show_bug.cgi?id=39885
--- Comment #11 from Matteo Bruni matteo.mystral@gmail.com --- I think commit 3ecf069e45c12cf3cd79319a633acecba9a00553 from the latest Wine commit round might be a fix for this bug.
https://bugs.winehq.org/show_bug.cgi?id=39885
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |3ecf069e45c12cf3cd79319a633 | |acecba9a00553 Status|STAGED |RESOLVED Resolution|--- |FIXED
--- Comment #12 from Alexandre Julliard julliard@winehq.org --- Yes, it's fixed now.
https://bugs.winehq.org/show_bug.cgi?id=39885
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.17.