From:             t dot schoebel at hamburg dot de
Operating system: Debian 3.0 Woody
PHP version:      4.3.10
PHP Bug Type:     Reproducible crash
Bug description:  Apache crashing while someone Upload an Image

Description:
------------
I'm hosting a costumer, who uses an old script written for php 3.x.
If at the same time some visitors uploads an image, apache "crashed".
The load average jumps to 50 > an there is no possible to connect to the
server via ssh anymore.
In the error.log i get i.e. the following messages:

[Sat Jan 29 01:35:30 2005] [warn] child process 24784 still did not exit,
sending a SIGTERM

Reproduce code:
---------------
<form ENCTYPE="multipart/form-data" name=info method=post
ACTION="page.upload.php">
<table>
<tr>
<td>Datei:</td>
<td> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000"><input
name="userfile" type="file" <? echo $styleform3; ?>>
<INPUT TYPE="hidden" NAME="code" value="1"><br>
<INPUT TYPE="hidden" NAME="user" value="<? echo $user;?>"></td>
</tr>


...

if (is_uploaded_file ($userfile)){
$dir = "/var/kunden/webs/web1/tmp/";
  move_uploaded_file($userfile,$dir.$userfile_name) ;
}

Expected result:
----------------
When I upload an image, which is more than 100000 bytes big, cause of the
html-code <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000"> it's
given, i get an php error, that the script gets no data.
Apache breaks the transfer to php, cause the image is bigger then 100000
bytes.

Actual result:
--------------
If you delete the hmtl-tag <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
value="100000"> an add in your script a check, written in php, for the
size and may be the type of the file, you won't get an apache "crash".

-- 
Edit bug report at http://bugs.php.net/?id=31764&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31764&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31764&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31764&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31764&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31764&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31764&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31764&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31764&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31764&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31764&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31764&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31764&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31764&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31764&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31764&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31764&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31764&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31764&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31764&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31764&r=mysqlcfg

Reply via email to