Edit report at https://bugs.php.net/bug.php?id=62716&edit=1
ID: 62716 Updated by: larue...@php.net Reported by: slangley at google dot com Summary: munmap() is called with the incorrect length -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: All PHP Version: 5.3.15 -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-08-01 11:55:48] slangley at google dot com Description: ------------ In zend_stream.cc the size passed to mmap is the size of the file + ZEND_MMAP_AHEAD. *buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE, fileno(file_handle->handle.fp), 0); However, when munmap() is called the incorrect size is passed. static void zend_stream_unmap(zend_stream *stream TSRMLS_DC) { /* {{{ */ #if HAVE_MMAP if (stream->mmap.map) { munmap(stream->mmap.map, stream->mmap.len); } else #endif The call to munmap should be munmap(stream->mmap.map, stream->mmap.len + ZEND_MMAP_AHEAD); Test script: --------------- N/A Expected result: ---------------- N/A Actual result: -------------- N/A ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62716&edit=1