PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/opcache/tests/revalidate_path_01.phpt ('revalidate_path 01: OPCache must cache only resolved real paths when revalidate_path is set')

Script

1: <?php
2: $dir 
dirname(__FILE__);
3:
$dir1 "$dir/test1";
4:
$dir2 "$dir/test2";
5:
$link "$dir/test";
6:
$file1 "$dir1/index.php";
7:
$file2 "$dir2/index.php";
8:
$main "$dir/main.php";
9: @
mkdir($dir1);
10: @
mkdir($dir2);
11: @
file_put_contents($main,  '<?php include(\'' $link .'/index.php\');');
12: @
file_put_contents($file1"TEST 1\n");
13: @
file_put_contents($file2"TEST 2\n");
14: while (
filemtime($file1) != filemtime($file2)) {
15:     
touch($file1);
16:     
touch($file2);
17: }
18: if (
substr(PHP_OS03) == 'WIN') {
19:     @
rmdir($link);
20:     
$ln str_replace('/''\\'$link);
21:     
$d1 realpath($dir1);
22:     `
mklink /j $ln $d1`;
23: } else {
24:     @
unlink($link);
25:     @
symlink($dir1$link);
26: }
27:
28: include 
"php_cli_server.inc";
29:
//php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.revalidate_path=1');
30:
php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.revalidate_path=1 -d opcache.file_update_protection=0 -d realpath_cache_size=0');
31: echo 
file_get_contents('http://' PHP_CLI_SERVER_ADDRESS '/main.php');
32: echo 
file_get_contents('http://' PHP_CLI_SERVER_ADDRESS '/main.php');
33: if (
substr(PHP_OS03) == 'WIN') {
34:     @
rmdir($link);
35:     
$ln str_replace('/''\\'$link);
36:     
$d2 realpath($dir2);
37:     `
mklink /j $ln $d2`;
38: } else {
39:     @
unlink($link);
40:     @
symlink($dir2$link);
41: }
42: echo 
file_get_contents('http://' PHP_CLI_SERVER_ADDRESS '/main.php');
43: echo 
file_get_contents('http://' PHP_CLI_SERVER_ADDRESS '/main.php');
44:
?>
45:

Report

==28010== Jump to the invalid address stated on the next line
==28010==    at 0x4FE: ???
==28010==    by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==28010==    by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==28010==    by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==28010==    by 0x400C701: openaux (in /lib64/ld-2.12.so)
==28010==    by 0x400E5E5: _dl_catch_error (in /lib64/ld-2.12.so)
==28010==    by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==28010==    by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==28010==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==28010==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==28010==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==28010==    by 0xE: ???
==28010==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==28010== 
==28010== 
==28010== Process terminating with default action of signal 11 (SIGSEGV)
==28010==  Bad permissions for mapped region at address 0x4FE
==28010==    at 0x4FE: ???
==28010==    by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==28010==    by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==28010==    by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==28010==    by 0x400C701: openaux (in /lib64/ld-2.12.so)
==28010==    by 0x400E5E5: _dl_catch_error (in /lib64/ld-2.12.so)
==28010==    by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==28010==    by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==28010==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==28010==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==28010==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==28010==    by 0xE: ???

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (14 days ago)

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