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/bug70470.phpt ('Bug #70470 (Built-in server truncates headers spanning over TCP packets)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start("var_dump(getAllheaders());");
4:
5:
$fp fsockopen(PHP_CLI_SERVER_HOSTNAMEPHP_CLI_SERVER_PORT$errno$errmsg0.5);
6:
7: if (!
$fp) {
8:     die(
"connect failed: " $errmsg);
9: }
10:
11:
fwrite($fp"GET / HTTP/1.1\r\n");
12:
fwrite($fp"Host: " PHP_CLI_SERVER_HOSTNAME "\r\n");
13:
fwrite($fp"Content");
14:
fflush($fp);
15:
usleep(200000);
16:
fwrite($fp"-Type: text/html; charset=UTF-8\r\n");
17:
fwrite($fp"Connection: clo");
18:
fflush($fp);
19:
usleep(200000);
20:
fwrite($fp"se\r\n\r\n");
21: while (!
feof($fp)) {
22:     echo 
fgets($fp);
23: }
24:
fclose($fp);
25:
?>
26:

Report

==17356== Jump to the invalid address stated on the next line
==17356==    at 0x4FE: ???
==17356==    by 0x1F00000000: ???
==17356==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)
==17356==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==17356==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==17356==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==17356==    by 0x6: ???
==17356==    by 0x1FFF00076E: ???
==17356==    by 0x1FFF000792: ???
==17356==    by 0x1FFF000795: ???
==17356==    by 0x1FFF0007BB: ???
==17356==    by 0x1FFF0007BE: ???
==17356==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==17356== 
==17356== 
==17356== Process terminating with default action of signal 11 (SIGSEGV)
==17356==  Bad permissions for mapped region at address 0x4FE
==17356==    at 0x4FE: ???
==17356==    by 0x1F00000000: ???
==17356==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)
==17356==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==17356==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==17356==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==17356==    by 0x6: ???
==17356==    by 0x1FFF00076E: ???
==17356==    by 0x1FFF000792: ???
==17356==    by 0x1FFF000795: ???
==17356==    by 0x1FFF0007BB: ???
==17356==    by 0x1FFF0007BE: ???

 

Generated at Sun, 24 Sep 2017 15:32:56 +0000 (39 hours ago)

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