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/php_cli_server_013.phpt ('No router, no script')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(NULLNULL);
4:
5: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
6:
$port intval($port)?:80;
7:
$output '';
8:
9:
$fp fsockopen($host$port$errno$errstr0.5);
10: if (!
$fp) {
11:   die(
"connect failed");
12: }
13:
14:
15: if(
fwrite($fp, <<<HEADER
16:
POST / HTTP/1.1
17: Host: 
{$host}
18: Content-Type: application/x-www-form-urlencoded
19: Content-Length: 3
20:
21: a=b
22:
HEADER
23: )) {
24:     while (!
feof($fp)) {
25:         
$output .= fgets($fp);
26:     }
27: }
28:
29: echo 
preg_replace("/<style>(.*?)<\/style>/s""<style>AAA</style>"$output), "\n";
30:
fclose($fp);
31:
32:
33:
$output '';
34:
$fp fsockopen($host$port$errno$errstr0.5);
35: if (!
$fp) {
36:   die(
"connect failed");
37: }
38:
39: if(
fwrite($fp, <<<HEADER
40:
GET /main/style.css HTTP/1.1
41: Host: 
{$host}
42:
43:
44:
HEADER
45: )) {
46:     while (!
feof($fp)) {
47:         
$output .= fgets($fp);
48:     }
49: }
50:
51: echo 
preg_replace("/<style>(.*?)<\/style>/s""<style>AAA</style>"$output), "\n";
52:
fclose($fp);
53:
54:
$output '';
55:
$fp fsockopen($host$port$errno$errstr0.5);
56: if (!
$fp) {
57:   die(
"connect failed");
58: }
59:
60: if(
fwrite($fp, <<<HEADER
61:
HEAD /main/foo/bar HTTP/1.1
62: Host: 
{$host}
63:
64:
65:
HEADER
66: )) {
67:     while (!
feof($fp)) {
68:         
$output .= fgets($fp);
69:     }
70: }
71:
72: echo 
preg_replace("/<style>(.*?)<\/style>/s""<style>AAA</style>"$output), "\n";
73:
fclose($fp);
74:
?>
75:

Report

==17998== Jump to the invalid address stated on the next line
==17998==    at 0x4FE: ???
==17998==    by 0x1EE955F: ??? (in /var/php_gcov/PHP_HEAD/sapi/cli/php)
==17998==    by 0x1FFEFFEEFF: ???
==17998==    by 0xC5B499F: ??? (in /usr/lib64/libnetsnmp.so.20.0.0)
==17998==    by 0x1FFEFFEEFF: ???
==17998==    by 0x50: ???
==17998==    by 0x4045A87: ???
==17998==    by 0x23809187: ???
==17998==    by 0x4009FE1: do_lookup_x (in /lib64/ld-2.12.so)
==17998==    by 0x400A269: _dl_lookup_symbol_x (in /lib64/ld-2.12.so)
==17998==    by 0x400BAB3: _dl_relocate_object (in /lib64/ld-2.12.so)
==17998==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)
==17998==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==17998== 
==17998== 
==17998== Process terminating with default action of signal 11 (SIGSEGV)
==17998==  Bad permissions for mapped region at address 0x4FE
==17998==    at 0x4FE: ???
==17998==    by 0x1EE955F: ??? (in /var/php_gcov/PHP_HEAD/sapi/cli/php)
==17998==    by 0x1FFEFFEEFF: ???
==17998==    by 0xC5B499F: ??? (in /usr/lib64/libnetsnmp.so.20.0.0)
==17998==    by 0x1FFEFFEEFF: ???
==17998==    by 0x50: ???
==17998==    by 0x4045A87: ???
==17998==    by 0x23809187: ???
==17998==    by 0x4009FE1: do_lookup_x (in /lib64/ld-2.12.so)
==17998==    by 0x400A269: _dl_lookup_symbol_x (in /lib64/ld-2.12.so)
==17998==    by 0x400BAB3: _dl_relocate_object (in /lib64/ld-2.12.so)
==17998==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)

 

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

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