PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for sapi/cli/tests/bug43177.phpt ('Bug #61977 Test exit code for various errors')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(<<<'SCRIPT'
4:
    ini_set('display_errors', 0);
5:     switch($_SERVER["REQUEST_URI"]) {
6:             case "/parse":
7:                     try {
8:                         eval("this is a parse error");
9:                     } catch (ParseError $e) {
10:                     }
11:                     echo "OK\n";
12:                     break;
13:             case "/fatal":
14:                     eval("foo();");
15:                     echo "OK\n";
16:                     break;
17:             case "/compile":
18:                     eval("class foo { final private final function bar() {} }");
19:                     echo "OK\n";
20:                     break;
21:             case "/fatal2":
22:                     foo();
23:                     echo "OK\n";
24:                     break;
25:             default:
26:                     return false;
27:     }
28:
SCRIPT
29: );
30:
31: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
32:
$port intval($port)?:80;
33:
34: foreach(array(
"parse""fatal""fatal2""compile") as $url) {
35:     
$fp fsockopen($host$port$errno$errstr0.5);
36:     if (!
$fp) {
37:           die(
"connect failed");
38:     }
39:
40:     if(
fwrite($fp, <<<HEADER
41:
GET /$url HTTP/1.1
42: Host: 
{$host}
43:
44:
45:
HEADER
46: )) {
47:         while (!
feof($fp)) {
48:                 echo 
fgets($fp);
49:         }
50:     }
51: }
52:
53:
?>
54:

Report

==17502== Jump to the invalid address stated on the next line
==17502==    at 0x4FE: ???
==17502==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==17502== 
==17502== 
==17502== Process terminating with default action of signal 11 (SIGSEGV)
==17502==  Bad permissions for mapped region at address 0x4FE
==17502==    at 0x4FE: ???

 

Generated at Sun, 12 Nov 2017 21:17:35 +0000 (6 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.