#19749 [Asn->Sus]: shouldn't mmap() files larger than memory_limit in _php_stream_passthru

From: Date: Mon, 30 Jun 2003 03:02:53 +0000
Subject: #19749 [Asn->Sus]: shouldn't mmap() files larger than memory_limit in _php_stream_passthru
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42804@lists.php.net to get a copy of this message
ID: 19749 Updated by: iliaa@php.net Reported By: rasmus@php.net -Status: Assigned +Status: Suspended Bug Type: Performance problem Operating System: All PHP Version: 4CVS-2002-10-04 Assigned To: wez Previous Comments: ------------------------------------------------------------------------ [2003-03-09 18:42:22] sniper@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2003-02-27 11:05:07] iliaa@php.net Is this really a problem, passthru will immidiately output the data to screen thus making hightened memory usage a very temporary thing. If the user tries to use buffering to 'hold' the data then the memory limit will kick-in anyway. The only way I could see a user trying to 'exploit' this is by writing a file that would load a large file to memory and then manually doctoring the request to read the data 1 byte at a time. But this is hardly different from allocating just shy of the memory limit and doing the same thing with multiple scripts. This is really no different then making SQL query create a huge temporary table consuming *any* amount of memory. ------------------------------------------------------------------------ [2002-10-05 10:17:30] rasmus@php.net Yup, we should do it in chunks of some fraction of memory-limit, I guess. quarters, fiths, tenths? It should be a decently big chunk size so there will be a good chance that many files fit into a single chunk for optimal speed. ------------------------------------------------------------------------ [2002-10-05 06:34:33] wez@php.net How do we tell when a file is too big? We can check if the file size exceeds the memory limit, but surely we should be checking for some size smaller than that so that we don't exceed the limit (by too much). ------------------------------------------------------------------------ [2002-10-04 03:21:22] rasmus@php.net We should check the memory limit before mmap()'ing a huge file in _php_stream_passthru() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19749&edit=1

« previous php.bugs (#42804) next »