Bug in VirtualAlloc

Robert Lunnon bob at yarrabee.net.au
Mon Aug 19 05:42:22 CDT 2002


An Interesting one, on my system wine has been broken for a little while 
failing with a bad heap message I have tracked it down to one solitary line 
in Virtual.c:(115) and here it is :


#define ADDRESS_SPACE_LIMIT  ((void *)0xc0000000)  /* top of the user address 
space */

when making an anonymous mmap Solaris returns 
(gdb) disp ptr
11: ptr = (void *) 0xdf620000 (ptr gets copied to base later)

Which is somewhat larger than 0xc0000000 and a comparison at around line 1010
       if ((base <= (char *)granularity_mask) ||
            (base + size < base) ||
            (base + size > (char *)ADDRESS_SPACE_LIMIT))
        {
            SetLastError( ERROR_INVALID_PARAMETER );
            return NULL;
        }
   
Fails

Q. Why is there a hard limit on this ? Is this a Windows thing or a Linux 
thing. My only way to work around it would be to "strongly Suggest* mapping 
addresses to the OS which would be very messy.

Suggestions (Constructive ones) warmly received 

Bob





More information about the wine-devel mailing list