Re: Segfaults
| From: | Jonas Jochum | Date: | Sun, 13 Feb 2000 12:33:46 +0000 |
| Subject: | Re: Segfaults | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10211@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 13.02.00 um 11:50 schrob jemand namens thies@digicol.de etwa folgendes:
> plz try to create a tiny testcase an send it to me..
first of all, sorry about the problems with my host name. jonas-jochum.de
is my domain, but since I'm sitting behind a dialup link, mahatma doesn't
have a static ip.
Anyway, now to the test case:
- - The HTML page for cut'n paste:
<html><head><title>Upload Test</title></head>
<body>
<form method=post action="test.php3">
<input type=file name="datei">
<input type=submit value="Upload">
</form>
</body></html>
- - The php script:
<?
$fsize = filesize($datei); // size of the file
$fcont = addslashes( fread( fopen($datei,"r"),$fsize)); // content of file
$rname = $datei_name; // file name on the client
print "<html><head><title>Upload Test</title></head>\n";
print "<body><pre>";
print "Remote name : $rname<br>\n";
print "Local name : $datei<br>\n";
print "File size : $fsize<br>\n";
// the following prints the file content if enctype is multipart/form-data
// print "file content: $fcont<br>\n";
print "</pre></body></html>";
?>
- -----------------------------------------------------------------------
Now, what I just noticed: When "enctype=multipart/form-data" is given,
php leaks memory:
zend_hash.c(150) : Freeing 0x081B8CE4 (20 bytes),
script=/home/jonas/public_html/test.php3
zend_API.c(191) : Freeing 0x081CA6A4 (52 bytes),
script=/home/jonas/public_html/test.php3
php_variables.c(190) : Freeing 0x081B8CA4 (12 bytes),
script=/home/jonas/public_html/test.php3
if it's not given, memory is _not_ leaked, but the filenames are wrong.
But you'll probably notice that yourself ;-)
The question is, how much does that actually have to do with php. It might
also be the browser. However, php still shouldn't leak memory.
- --
MfG,
Jonas Jochum
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (FreeBSD)
Comment: Made with pgp4pine
iD8DBQE4pqSsa8XTcYR3za8RAtM/AJ9OydTKGeBX8QtksarsX4ED3TKPdwCgoIWy
p0TFgLT9NsXPubw20ARyWb4=
=wq7l
-----END PGP SIGNATURE-----