1.3.20: mmap with nonzero file offset results in seg fault (Win2k )"

brett.matson@csiro.au brett.matson@csiro.au
Tue Feb 25 05:09:00 GMT 2003


Accessing the mapped region of memory after an mmap call 
with a non-zero offset results in a seg fault. A zero 
offset will not result in a seg fault.

Cygwin1.dll version 1.3.19 doesn't experience this problem.  
Cygcheck output is attached.

Example:

if (rslt = mmap(0, size, prot, MAP_SHARED,  fd, offset)) 
    == MAP_FAILED) {
} else {
    printf("%d", rslt[0]); // seg fault
}
AND
if (rslt = mmap(0, size, prot, MAP_SHARED,  fd, 0)) 
    == MAP_FAILED) {
} else {
    printf("%d", rslt[0]); // no seg fault (zero offset)
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 10344 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20030225/2966c253/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list