PHP  
 PHP_7_1
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

==6114== Jump to the invalid address stated on the next line
==6114==    at 0x4FE: ???
==6114==    by 0x1BFE41F: ??? (in /var/php_gcov/PHP_7_1/sapi/cli/php)
==6114==    by 0x1FFEFFEF1F: ???
==6114==    by 0x9D85D0B: ??? (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==6114==    by 0x1FFEFFEF1F: ???
==6114==    by 0x51: ???
==6114==    by 0x4045F97: ???
==6114==    by 0xDC2C7D87: ???
==6114==    by 0x4009EA4: do_lookup_x (in /lib64/ld-2.12.so)
==6114==    by 0x400A269: _dl_lookup_symbol_x (in /lib64/ld-2.12.so)
==6114==    by 0x400BAB3: _dl_relocate_object (in /lib64/ld-2.12.so)
==6114==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)
==6114==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==6114== 
==6114== 
==6114== Process terminating with default action of signal 11 (SIGSEGV)
==6114==  Bad permissions for mapped region at address 0x4FE
==6114==    at 0x4FE: ???
==6114==    by 0x1BFE41F: ??? (in /var/php_gcov/PHP_7_1/sapi/cli/php)
==6114==    by 0x1FFEFFEF1F: ???
==6114==    by 0x9D85D0B: ??? (in /u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1)
==6114==    by 0x1FFEFFEF1F: ???
==6114==    by 0x51: ???
==6114==    by 0x4045F97: ???
==6114==    by 0xDC2C7D87: ???
==6114==    by 0x4009EA4: do_lookup_x (in /lib64/ld-2.12.so)
==6114==    by 0x400A269: _dl_lookup_symbol_x (in /lib64/ld-2.12.so)
==6114==    by 0x400BAB3: _dl_relocate_object (in /lib64/ld-2.12.so)
==6114==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)

 

Generated at Fri, 01 Dec 2017 18:56:15 +0000 (9 days ago)

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