~ubuntu-branches/ubuntu/natty/php5/natty

« back to all changes in this revision

Viewing changes to debian/patches/fix_crash_in_GC.patch

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-01-07 22:44:56 UTC
  • mfrom: (0.3.17 sid)
  • Revision ID: package-import@ubuntu.com-20110107224456-rfnz8n46skjgr7nm
Tags: 5.3.3-7ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions 
      already in universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, sybase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
    * stop mysql instance on clean just in case we failed in tests
  - Dropped debian/patches/fix-upstream-bug53632.patch, used debian's instead.
  - Dropped debian/patches/mssql-fix-segfault.patch, use debian's instead.
  - debian/patches/configure-as-needed.patch. Work around suspicious
    configure macros to fix a build failure with --as-needed
  - debian/patches/php52389-pgsql-segfault.patch: removing, causes error
    handling to fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/Zend/zend_execute.c
 
2
+++ b/Zend/zend_execute.c
 
3
@@ -714,8 +714,8 @@ static inline zval* zend_assign_to_varia
 
4
                                        ALLOC_ZVAL(variable_ptr);
 
5
                                        *variable_ptr_ptr = variable_ptr;
 
6
                                        *variable_ptr = *value;
 
7
-                                       zval_copy_ctor(variable_ptr);
 
8
                                        Z_SET_REFCOUNT_P(variable_ptr, 1);
 
9
+                                       zval_copy_ctor(variable_ptr);
 
10
                                } else {
 
11
                                        *variable_ptr_ptr = value;
 
12
                                        Z_ADDREF_P(value);
 
13
--- /dev/null
 
14
+++ b/Zend/tests/gc_032.phpt
 
15
@@ -0,0 +1,40 @@
 
16
+--TEST--
 
17
+GC 032: Crash in GC because of invalid reference counting
 
18
+--FILE--
 
19
+<?php
 
20
+$a = array();
 
21
+$b =& $a;
 
22
+$a[0] = $a;
 
23
+debug_zval_dump($a);
 
24
+$a = array(array());
 
25
+$b =& $a;
 
26
+$a[0][0] = $a;
 
27
+debug_zval_dump($a);
 
28
+?>
 
29
+--EXPECT--
 
30
+array(1) refcount(1){
 
31
+  [0]=>
 
32
+  array(1) refcount(3){
 
33
+    [0]=>
 
34
+    array(1) refcount(3){
 
35
+      [0]=>
 
36
+      *RECURSION*
 
37
+    }
 
38
+  }
 
39
+}
 
40
+array(1) refcount(1){
 
41
+  [0]=>
 
42
+  array(1) refcount(3){
 
43
+    [0]=>
 
44
+    array(1) refcount(1){
 
45
+      [0]=>
 
46
+      array(1) refcount(3){
 
47
+        [0]=>
 
48
+        array(1) refcount(1){
 
49
+          [0]=>
 
50
+          *RECURSION*
 
51
+        }
 
52
+      }
 
53
+    }
 
54
+  }
 
55
+}