weird linux/solaris problem.

Roger Fujii rmf at
Tue Nov 13 15:47:30 CST 2001

Well, I finally figured out the major problem I've been having with
wine and virtualdub under solaris, but I'm not sure what to do about it.

In memory/virtual.c, there are 2 problems:
  1) in function anon_mmap_aligned, there is a 
     section that tries to release extra memory.  The problem is that
     under solaris, munmap length parameter is defined as:

     The munmap() function removes the mappings for pages in  the
     range  [addr,  addr  + len), rounding the len argument up to
     the  next  multiple  of  the  page  size  as   returned   by

     It's not exactly clear what the linux munmap does, but I think
     that the linux one does what you think it SHOULD do, and the
     solaris one does what is documented (i.e. will unmap more pages
     than what the linux one thinks it would since it rounds UP the len).
     Now, I can see 2 fixes:  1 is to #ifdef __svr4 and compute the
     compensated len before unmapping.  The other is to just not do
     this release (or at least not do it for __svr4). 

     Any comments?

  2) For some reason I don't quite understand, a call is made
     to VirtualProtect with a READONLY protection, and soon after,
     something tries to memcpy into that block.  I'm not sure if
     this is a thread sync issue, or maybe this is supposed to
     work like c's const (ie, it's readonly AFTER the first write).
     Kind of puzzling, since it does work under linux.   Any
     suggestions? (my current fix is to treat READONLY as RW, which
     works, but I know is wrong).



Roger Fujii <rmf at>
Underemployed, and trying to keep it that way....

More information about the wine-devel mailing list