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