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/bug66338.phpt ('Bug #66338 (Optimization binding of class constants is not safely opcacheable)')

Script

1: <?php
2: $root  
str_replace('.php'""__FILE__);
3:
$base  basename$root );
4:
5:
file_put_contents"$root-Officials.inc"'<?php 
6:     class Officials { static function getLeader() { return LocalTerms::GOV_LEADER; } }
7:     ' 
);
8:
9:
file_put_contents"$root-clientUS.php"'<?php 
10:     class LocalTerms { const GOV_LEADER = "Barack Hussein Obama II"; }
11:     require \''
.$root.'-Officials.inc\';
12:     printf( "The President of the USA is %s\n", Officials::getLeader() );
13:     ' 
);
14:
15:
file_put_contents"$root-clientUK.php"'<?php 
16:     class LocalTerms { const GOV_LEADER = "David William Donald Cameron"; }
17:     require \''
.$root.'-Officials.inc\';
18:     printf( "The Prime Minister of the UK is %s\n", Officials::getLeader() );
19:     ' 
);
20:
21: include 
"php_cli_server.inc";
22:
$uri sprintf("http://%s/%s"PHP_CLI_SERVER_ADDRESSbasename(__FILE__));
23:
$opt = -1;   # This test works if $opt = 0
24:
php_cli_server_start("-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.optimization_level=$opt -d opcache.file_update_protection=0" );
25:
26: echo 
file_get_contents("http://" PHP_CLI_SERVER_ADDRESS "/$base-clientUS.php" );
27: echo 
file_get_contents("http://" PHP_CLI_SERVER_ADDRESS "/$base-clientUK.php" );
28:
29:
unlink("$root-Officials.inc");
30:
unlink("$root-clientUS.php");
31:
unlink("$root-clientUK.php");
32:
?>
33:

Report

==27649== Jump to the invalid address stated on the next line
==27649==    at 0x4FE: ???
==27649==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==27649== 
==27649== 
==27649== Process terminating with default action of signal 11 (SIGSEGV)
==27649==  Bad permissions for mapped region at address 0x4FE
==27649==    at 0x4FE: ???

 

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

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