mmap of entire address space failed

John Birrell jb at
Thu Jun 17 18:10:45 CDT 2004

On Wed, Jun 16, 2004 at 07:45:47PM +0200, Gerald Pfeifer wrote:
> On Tue, 15 Jun 2004, Alexandre Julliard wrote:
> > WHAT'S NEW with Wine-20040615: (see ChangeLog for details)
> >         - Major winedbg rewrite using the dbghelp dll.
> >         - New Wine preloader to reserve memory areas at startup.
> On FreeBSD 4.x, I'm now getting the following when trying to invoke
> Wine, even without any parameters:
>   wine: failed to initialize: /swtest/wine/dlls/ mmap of
>   entire address space failed: Cannot allocate memory

I think this is caused by FreeBSD's mmap behaviour differing from that
of Linux. From my reading of the code, it looks like Wine (now) tries
to snaffle as much memory above 0x80000000 as it can to reserve it.
When allocating memory without specifying a base address, FreeBSD
appears to try to allocate memory above the locations it has allocated
before, i.e. up in the region beyond where it has snaffled everything.
The error quoted above comes from the dlopen() function in rtld.

Using the current CVS sources, I tried nobbling the reservation code by
turning the functions into nops. I also had to comment out the section
in map_view() where there is a test if the allocated memory is above
the user address limit. That allows notepad to get through all the
initialisation without barfing. [ It then goes into an infinite loop
trying to open the display. 8-( ]

John Birrell

More information about the wine-devel mailing list