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

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

 

Generated at Tue, 19 Aug 2014 16:41:26 +0000 (4 days ago)

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