ID:               47596
 Updated by:       paj...@php.net
 Reported By:      pahan at hubbitus dot info
-Status:           Closed
+Status:           Assigned
 Bug Type:         Reproducible crash
 Operating System: Linux
 PHP Version:      5.3.0beta1
-Assigned To:      scottmac
+Assigned To:      dmitry
 New Comment:

reopen as the fix is temporary and ugly :)




Previous Comments:
------------------------------------------------------------------------

[2009-03-26 17:32:31] dmi...@php.net

This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2009-03-22 01:19:06] sh...@php.net

This is being caused because of mis-use of mmap().  We are currently
relying on mmap to pad the end of our mmap'd file with zeros for
detection of EOF in the scanner and scanning ahead.  We specifically add
ZEND_MMAP_AHEAD to the len passed to mmap in zend_stream_fixup():

/*  *buf[size] is zeroed automatically by the kernel */
*buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE,
fileno(file_handle->handle.fp), 0);
 
But AFAIK mmap does not support this usage of the len parameter, as
it's a limit rather than able to extend the mmap region.  This appears
to work under most cases as mmap will pad zeroes up to PAGESIZE.  This
error will occur anytime we use mmap in this way on a file that is not
ZEND_MMAP_AHEAD bytes less than PAGESIZE and therefore attempt to access
a byte over PAGESIZE.

It will be easy to fix the mmap calls, however this will break the re2c
scanner.  Originally for the EOF checks I was going to re-implement
YYFILL to malloc additional space for the scanner after EOF, this may be
an option to correct this.




------------------------------------------------------------------------

[2009-03-10 18:23:04] scott...@php.net

Looks like something in the re2c stuff that's causing it to overread.

------------------------------------------------------------------------

[2009-03-10 18:13:53] pahan at hubbitus dot info

No, as I also mentioned abowe, this is not require any externul stuff 
(include_path=::::: even "." dir not contain!, so, can't be include 
files).

------------------------------------------------------------------------

[2009-03-10 16:59:28] j...@php.net

That script requires some external crap that is NOT included. At 
least provide ALL the files necessary to run the script. Otherwise 
the next status this report gets is Bogus.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/47596

-- 
Edit this bug report at http://bugs.php.net/?id=47596&edit=1

Reply via email to