#19886 [Fbk->Opn]: readfile, fread, fpassthru won't work with large files!!!

From: Date: Sun, 13 Oct 2002 15:19:11 +0000
Subject: #19886 [Fbk->Opn]: readfile, fread, fpassthru won't work with large files!!!
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22300@lists.php.net to get a copy of this message
 ID:               19886
 Updated by:       spic@php.net
 Reported By:      spic@php.net
-Status:           Feedback
+Status:           Open
-Bug Type:         Performance problem
+Bug Type:         Reproducible crash
 Operating System: Windows, any Version
 PHP Version:      4CVS-2002-10-13
 New Comment:

The following snippets illustrate the environment


[frameset.php]
->frame1.php
->frame2.php
->frame3.php


[frame1.php]
<?
header("Content-type: application/pdf\n");
readfile("some_100k_large.pdf");
?>

[frame2.php]
<?
echo "Something";
?>

[frame3.php]
<?
echo "else";
?>


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

[2002-10-13 10:16:01] spic@php.net

@wez: These scripts don't use sessions. They run of a CD in a
single-user-environment.

@nicos: Calling the "passthrough"-script directly works without errors.
But calling it in an frameset (together with two other scripts) crashes
when outputting a file > 100k,

The php_stream_read() returns the correct filesize.
The fact, that the parrallel execution of three scripts of one handles
a big file may be the source of the problem.

There are no write-accesses. Only Read-Accesses to small config-files.

Removing the "big-files-passthrough" let the scripts run properly.

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

[2002-10-13 10:02:11] wez@php.net

Can you reduce this to the simplest combination of scripts?
(That don't use sessions).

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

[2002-10-13 09:37:40] nicos@php.net

did you checked if php_stream_read() was returning the right filesize
value? that was the first bug.

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

[2002-10-13 09:10:57] spic@php.net

Note: Calling sleep(5) before dumping the PDF solves the problem, so I
think the bug is related to a memory management/multithreading
problem...

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

[2002-10-13 09:08:03] spic@php.net

Environment: Windows
WebServer: Microweb (CD-WebServer)
PHP-Version: Latest CVS and 4.2.4-dev
PHP is installed as CGI

In a frameset-environment, PHP hangs while outputting large PDF-Files.
The Frameset consists of three Frames. Every Frame is PHP-generated.
One functions as "PDF-Passthrough".

All works fine, if the Passthrough-File is smaller than approx. 100k.
Files >100k make the system hang.

Calling the passthrough-script directly (w/o frameset) causes no
problems.

There is no difference between using readfile, fpassthru, or fread.


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


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



Thread (21 messages)

« previous php.bugs (#22300) next »