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(NULL, NULL); 4: 5: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); 6: $port = intval($port)?:80; 7: $output = ''; 8: 9: $fp = fsockopen($host, $port, $errno, $errstr, 0.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, $errstr, 0.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, $errstr, 0.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
==1181== Jump to the invalid address stated on the next line
==1181== at 0x4FE: ???
==1181== by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==1181== by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==1181== by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==1181== by 0x400C701: openaux (in /lib64/ld-2.12.so)
==1181== by 0x400E5E5: _dl_catch_error (in /lib64/ld-2.12.so)
==1181== by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==1181== by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==1181== by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==1181== by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==1181== by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==1181== by 0x5: ???
==1181== Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==1181==
==1181==
==1181== Process terminating with default action of signal 11 (SIGSEGV)
==1181== Bad permissions for mapped region at address 0x4FE
==1181== at 0x4FE: ???
==1181== by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==1181== by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==1181== by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==1181== by 0x400C701: openaux (in /lib64/ld-2.12.so)
==1181== by 0x400E5E5: _dl_catch_error (in /lib64/ld-2.12.so)
==1181== by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==1181== by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==1181== by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==1181== by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==1181== by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==1181== by 0x5: ???
Generated at Thu, 19 Apr 2018 02:25:01 +0000 (4 days ago)
|