php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5725 Resource hog.
Submitted: 2000-07-21 19:15 UTC Modified: 2000-08-23 09:56 UTC
From: marcelo at msm dot cl Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Release Candidate 2 OS: Nt 4 SP6 IIS4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marcelo at msm dot cl
New email:
PHP Version: OS:

 

 [2000-07-21 19:15 UTC] marcelo at msm dot cl
Hello,
I have a Win NT 4.0 which has SQL7.0 (with SQL service pack installed). Pentium III @ 450 Mhz with 256 in RAM
Using PHP 4.0.1 Patch Level 2 I have the following problem WITH ANY TYPE OF CODE.
Problem: After -navigating- the site for a few minutes the web server hangs. The php page which it hangs on is random. 
By hanging I mean the CPU jumps to 100%, ram to 200M taken and the Task manager shows inetinfo.exe taking up 98% of the CPU.

At first I thought it was SQL related, so I comented the code that calls SQL and the problem occured again.
I installed php3 and I have no problems.

In the following code, the case default would be displayed.
But when you would choose ANY of the options the system would go nuts.

Hope this helps, and I apologize if I made some mistake while doing this report. 

<?
function validacaracteres($bodytag)
{
	$bodytag = str_replace("\'", "*", $bodytag);
	return($bodytag);
}		


function conecta()
{ 
	$connection = mssql_connect("back","sa"); 
	mssql_select_db(bolsa); 
}


switch ($accion)
{

Case 1:
	?>
	<html>
	<head>
	</head>
	<body bgcolor="#cccccc">
	
	<center><h3><b>Preguntas Frecuentes</b></h3></center>
	<br><br><br><br>
	 
	<form name="formulario" action="./faq.php?accion=5" method="post">
	
	<center><table>
	<tr><td>Pregunta</td><td>:</td>
	<td><input type="text" name="pregunta"></td></tr>
	
	<tr><td>Respuesta</td><td>:</td>
	<td><input type="text" name="respuesta"></td></tr>
	</table></center>
	<center>
	<input type="submit" value="OK" name="submit">
	</center>	
	
	</form>
	
	
	</body>
	</html>
	<?
	break;

Case 2: 
	conecta();
	$sql = "SELECT id,pregunta,respuesta FROM faq;";
	$res = mssql_query($sql);
	
	echo "<body bgcolor='#cccccc'>";	
	
	while ($row=mssql_fetch_array($res))
	{
	  echo "<center><table><tr>";
	  echo "<td>Pregunta</td><td>:</td>";
	  echo "<td>$row[1]</td></tr>";
	  echo "<tr><td>Respuesta</td><td>:</td>";
	  echo "<td>$row[2]</td></tr>";
	  echo "</table></center>";
	  echo "<center><table><tr>";
	  echo "<td><a href='./faq.php?id=$row[0]&accion=3'>Eliminar</a><td>";
	  echo "<td><a href='./faq.php?id=$row[0]&accion=4'>Modificar</a><td>";
	  echo "</table></center>";
	}
	
	echo "</body>";
	break;

Case 3:
	conecta();
	$sql = "DELETE FROM faq WHERE id='$id';";
	$res = mssql_query($sql);

	Header("Location: http://192.168.1.24/bolsa/principal.php");	

	break;
Case 4:
	conecta();
	$sql = "SELECT id,pregunta,respuesta FROM faq WHERE id='$id';";
	$res = mssql_query($sql);
	
	echo "<body bgcolor='#cccccc'>\n";
	echo "<form name='formulario' action='./faq.php?accion=6' method='post'>\n";
	
	if ($row=mssql_fetch_array($res))
	{
	  echo "<center>\n<table>\n<tr>";
	  echo "<td>Pregunta</td><td>:</td><td>";
	  echo "<input type='text' name='pregunta' value='$row[1]'>";
	  echo "</td></tr>\n<tr><td>Respuesta</td><td>:</td><td>";
	  echo "<input type='text' name='respuesta' value='$row[2]'>";
	  echo "</td></tr>\n</table></center>";
	}
	echo "<center>";
	echo "<input type='hidden' name='id' value='$id'>";
	echo "<input type='submit' value='OK' name='submit'>";
	echo "<input type='reset' value='Limpiar' name='reset'>";
	echo "</center>";
	
	echo "</form>";
	echo "</body>";
	break;

	
Case 5:
	conecta();
	
	$pregunta=validacaracteres($pregunta);
	$respuesta=validacaracteres($respuesta);
	
	$sql = "INSERT INTO faq (pregunta,respuesta) VALUES ('$pregunta','$respuesta');";
	$res = mssql_query($sql);

	Header("Location: http://192.168.1.24/bolsa/principal.php");	
	break;

Case 6:
	conecta();
	
	$pregunta=validacaracteres($pregunta);
	$respuesta=validacaracteres($respuesta);
	
	$sql = "UPDATE faq SET pregunta='$pregunta',respuesta='$respuesta' WHERE id='$id';";
	$res = mssql_query($sql);

	Header("Location: http://192.168.1.24/bolsa/principal.php");	
	break;
	
Default:
	?>
	<html>
	<head>
	</head>
	<body bgcolor="#cccccc">
	
	<center><h3><b>Preguntas Frecuentes</b></h3></center>
	<br><br><br><br>
	
	<form name="formulario" action="./faq.php">
	<center>
	
	<select name="accion" size="1">
  	<option value="0" selected>Opciones</option>
  	<option value="1">Agregar</option>
  	<option value="2">Modificar</option>
  	</select>
	
	
	<input type="submit" value="OK" name="submit">
	</center>	
	
	</form>
	
	</body>
	</html>

	
	<?
}


?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-23 11:19 UTC] stas at cvs dot php dot net
reclassify
 [2000-07-23 20:35 UTC] marcelo at msm dot cl
I originally posted this in -Performance problem- where the only response I received was -reclassify-.
In what catefory it should go? there's -Scripting engine Problem-, could be -Dynamic Loading Related-, or even -Reproduceable Crash-,
If any one can help me help the development team in figuring out how to clasify this issue, I would be more than grateful.

 [2000-07-25 00:45 UTC] waldschrott@php.net
1) Are you using php4 RC2 (selected) or 4.0.1pl2 (mentioned in text)?
2) reclassify means it has been reclassified (to crash)
3) could you provide a small (<10 lines) code snipplet which reproduces this error?
 [2000-08-23 09:56 UTC] sniper@php.net
No feedback from user.

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 21:00:01 2026 UTC