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

Valgrind Report for Zend/tests/bug65784.phpt ('Fixed Bug #65784 (Segfault with finally)')

Script

1: <?php
2:
function foo1() {
3:     try {
4:         throw new 
Exception("not catch");
5:         return 
true;
6:     } 
finally {
7:         try {
8:             throw new 
Exception("catched");
9:         } catch (
Exception $e) {
10:         }
11:     }
12: }
13: try {
14:     
$foo foo1();
15:     
var_dump($foo);
16: } catch (
Exception $e) {
17:     do {
18:         
var_dump($e->getMessage());
19:     } while (
$e $e->getPrevious());
20: }
21:
22: function 
foo2() {
23:     try  {
24:         try {
25:             throw new 
Exception("catched");
26:             return 
true;
27:         } 
finally {
28:             try {
29:                 throw new 
Exception("catched");
30:             } catch (
Exception $e) {
31:             }
32:         }
33:     } catch (
Exception $e) {
34:     }
35: }
36:
37:
$foo foo2();
38:
var_dump($foo);
39:
40: function 
foo3() {
41:     try {
42:         throw new 
Exception("not catched");
43:         return 
true;
44:     } 
finally {
45:         try {
46:             throw new 
NotExists();
47:         } catch (
Exception $e) {
48:         }
49:     }
50: }
51:
52:
$bar foo3();
53:

Report

==4581== Invalid read of size 4
==4581==    at 0x10123B9: ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (zend.h:409)
==4581==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4581==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4581==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4581==    by 0xD733D4: php_execute_script (main.c:2506)
==4581==    by 0x1034A41: do_cli (php_cli.c:994)
==4581==    by 0x10361EE: main (php_cli.c:1378)
==4581==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==4581== 
==4581== 
==4581== Process terminating with default action of signal 11 (SIGSEGV)
==4581==  Access not within mapped region at address 0x10
==4581==    at 0x10123B9: ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (zend.h:409)
==4581==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4581==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4581==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4581==    by 0xD733D4: php_execute_script (main.c:2506)
==4581==    by 0x1034A41: do_cli (php_cli.c:994)
==4581==    by 0x10361EE: main (php_cli.c:1378)
==4581==  If you believe this happened as a result of a stack
==4581==  overflow in your program's main thread (unlikely but
==4581==  possible), you can try to increase the size of the
==4581==  main thread stack using the --main-stacksize= flag.
==4581==  The main thread stack size used in this run was 33554432.

 

Generated at Thu, 18 Dec 2014 07:17:56 +0000 (2 days ago)

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