|
커피향이 나는 *NIX
커피닉스
시스템/네트웍/보안을 다루는 곳
|
|
|
|
| 이전 주제 보기 :: 다음 주제 보기 |
| 글쓴이 |
메시지 |
truefeel 카페 관리자
가입: 2003년 7월 24일 올린 글: 1277 위치: 대한민국
|
올려짐: 2011.1.07 금, 11:43 am 주제: php가 hang되는 버그 (PHP 5.3.5/5.2.17 릴리즈) |
|
|
최근 php가 hang되는 흥미로운(?)버그가 발견되어 PHP 5.3.5과 5.2.17 릴리즈 되었다.
* PHP 5.3.5 Release Announcement
* PHP 5.2.17 Release Announcement
| 인용: |
This release resolves a critical issue, reported as PHP bug #53632, where conversions from string to double might cause the PHP interpreter to hang on systems using x87 FPU registers.
The problem is known to only affect x86 32-bit PHP processes, regardless of whether the system hosting PHP is 32-bit or 64-bit.
Security Enhancements and Fixes in PHP 5.3.5:
* Fixed bug #53632 (PHP hangs on numeric value 2.2250738585072011e-308). (CVE-2010-4645)
|
다음과 같은 두 조건을 함께 갖추고 있다면 문제가 발생한다.
- x87 FPU 레지스터를 사용하는 시스템
- 시스템이 32비트인지 64비트인지 상관없이 x86 32비트 php 프로세스일 때
hang이 걸릴 경우 CPU core 1개를 100%잡아먹으면서 load를 높인다. 결국 이런 요청을 많이 받게 되면 시스템은 정상적 처리를 못할 것이다.
간단한 예를 들어보자. 웹에서 URL을 통해 page= 나 숫자형을 넘겨받는 경우가 많다. 아래는 간단한 test.html이다.
| 코드: |
<?
$p=$_GET[page] + 1;
?>
|
위의 소스는 입력값에 대한 적합성 판단을 하지 않는다. <도메인>/test.html?page=2.2250738585072011e-308 를 호출했을 때
만약 해당 hang버그가 있는 경우라면 CPU load가 php의 지정한 time동안 올라갈 것이다.
관리하는 시스템의 php가 정상동작하는지, hang이 걸리는지 php 테스트 소스를 받아서 확인해보기 바란다.
http://www.php.net/distributions/test_bug53632.txt
[ 정상 ]
| 인용: |
Testing float behaviour. If this script hangs or terminates with an error message due to maximum execution time limit being reached, you should update your PHP installation asap!
For more information refer to <http://bugs.php.net/53632>.
Your system seems to be safe.
|
[ hang 발생. 업그레이드 필요 ]
| 인용: |
Testing float behaviour. If this script hangs or terminates with an error message due to maximum execution time limit being reached, you should update your PHP installation asap!
For more information refer to <http://bugs.php.net/53632>.
Fatal error: Maximum execution time of 1 second exceeded in /home/cnx/test.php on line 35
|
※ php 5.2.x는 더이상 지원하지 않는다고 발표를 했으나, 잦은 중요 버그로 php 5.2.16과 5.2.17이 연이어 급하게 발표가 되었다. |
|
| 위로 |
|
 |
|
|
새로운 주제를 올릴 수 있습니다 답글을 올릴 수 있습니다 주제를 수정할 수 없습니다 올린 글을 삭제할 수 없습니다 투표를 할 수 없습니다
|
Powered by phpBB © 2001, 2005 phpBB Group
|