View Issue Details

IDProjectCategoryView StatusLast Update
0001573libextractorlibextractor main librarypublic2010-10-21 15:47
ReporterLRN Assigned ToNDurner  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Summary0001573: Memory mapping offset misalignment
Descriptionlibextractor calls mmap() with an offset which is a multiple of the pagesize. This is correct for Linux ( http://linux.die.net/man/2/mmap ), but on Windows the equivalent function MapViewOfFile() requires the offset to be a multiple of the memory allocation granularity, which is obtained from dwAllocationGranularity member of a SYSTEM_INFO structure ( http://msdn.microsoft.com/en-us/library/aa366761%28VS.85%29.aspx ).
TagsNo tags attached.
Attached Files
win32_pagesize_to_allocationgranularity.diff (401 bytes)   
Index: src/main/extractor.c
===================================================================
--- src/main/extractor.c	(revision 11846)
+++ src/main/extractor.c	(working copy)
@@ -2254,7 +2254,7 @@
       pg = sysconf (_SC_PAGE_SIZE);
 #else
       GetSystemInfo(&sys);
-      pg = sys.dwPageSize;
+      pg = sys.dwAllocationGranularity;
 #endif
       if ( (pg > 0) &&
 	   (pg < MAX_READ) )

Activities

NDurner

2010-06-21 20:17

reporter   ~0004039

Fixed in plibc SVN HEAD. Please check.

Issue History

Date Modified Username Field Change
2010-06-21 15:46 LRN New Issue
2010-06-21 15:46 LRN File Added: win32_pagesize_to_allocationgranularity.diff
2010-06-21 20:17 NDurner Note Added: 0004039
2010-06-21 20:17 NDurner Assigned To => NDurner
2010-06-21 20:17 NDurner Status new => feedback
2010-07-29 15:59 Christian Grothoff Status feedback => resolved
2010-07-29 15:59 Christian Grothoff Resolution open => fixed
2010-10-21 15:47 Christian Grothoff Status resolved => closed