Merge lp:~clint-fewbar/ubuntu/maverick/php5/maverick-beta-papercuts into lp:ubuntu/maverick/php5

Proposed by Clint Byrum
Status: Merged
Merge reported by: Thierry Carrez
Merged at revision: not available
Proposed branch: lp:~clint-fewbar/ubuntu/maverick/php5/maverick-beta-papercuts
Merge into: lp:ubuntu/maverick/php5
Diff against target: 115 lines (+88/-1)
4 files modified
debian/changelog (+8/-0)
debian/patches/php52389-pgsql-segfault.patch (+78/-0)
debian/patches/series (+1/-0)
debian/php5-module.ini (+1/-1)
To merge this branch: bzr merge lp:~clint-fewbar/ubuntu/maverick/php5/maverick-beta-papercuts
Reviewer Review Type Date Requested Status
Thierry Carrez (community) Approve
Ubuntu branches Pending
Review via email: mp+32594@code.launchpad.net

Description of the change

- ini change is quite trivial
- pgsql patch tested using phppgadmin, seems to work fine.

To post a comment you must log in.
Revision history for this message
Thierry Carrez (ttx) wrote :

Looks good, uploading in a few.

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

Beh, already merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-08-06 13:10:17 +0000
3+++ debian/changelog 2010-08-13 15:11:01 +0000
4@@ -1,3 +1,11 @@
5+php5 (5.3.3-1ubuntu4) maverick; urgency=low
6+
7+ * debian/php5-module.ini: # replaced with ; (LP: #591286)
8+ * debian/patches/php52389-pgsql-segfault.patch (LP: #607646)
9+ - Applying patch for upstream bug that causes segfaults in pgsql
10+
11+ -- Clint Byrum <clint@ubuntu.com> Fri, 13 Aug 2010 00:07:15 -0700
12+
13 php5 (5.3.3-1ubuntu3) maverick; urgency=low
14
15 * debian/patches/lp564920-fix-big-files.patch: Fix downloading of large
16
17=== added file 'debian/patches/php52389-pgsql-segfault.patch'
18--- debian/patches/php52389-pgsql-segfault.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/php52389-pgsql-segfault.patch 2010-08-13 15:11:01 +0000
20@@ -0,0 +1,78 @@
21+From: miroslav.zacek@skype.net
22+Subject: Memory (de)allocation problem for pgsql notice
23+Description:In the ext/pgsql.c pgsql_globals->notices structure is allocated as
24+ persistent but individual messages non persistent. Thus the destructor
25+ _php_pgsql_notice_ptr_dtor happens to try to free memory that was
26+ already freed by the garbage collector and the thread exits with
27+ segmentation fault.
28+ .
29+ Program received signal SIGSEGV, Segmentation fault.
30+ 0x00007ffff3cd3013 in _zend_mm_free_int (heap=0x7ffff844b5c0, p=0x7ffff9397390)
31+ at /usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2018
32+ 2018 if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
33+ (gdb) backtrace
34+ #0 0x00007ffff3cd3013 in _zend_mm_free_int (heap=0x7ffff844b5c0,
35+ p=0x7ffff9397390) at /usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2018
36+ #1 0x00007ffff3cd3de1 in _efree (ptr=0x7ffff9397390) at
37+ /usr/src/php_no_suhosin/php5-5.3.2/Zend/zend_alloc.c:2351
38+ #2 0x00007fffeb4d3419 in _php_pgsql_notice_ptr_dtor (ptr=0x7ffff9396708) at
39+ /tmp/pgsql/pgsql.c:841
40+ .
41+ While the patch has not been accepted yet in PHP upstream, the logic appears
42+ sound enough to move forward with the patch.
43+ .
44+ Note: original patch was not in unified diff format. Reformatted as such.
45+
46+Origin: upstream, http://bugs.php.net/bug.php?id=52389
47+Bug: http://bugs.php.net/bug.php?id=52389
48+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/607646
49+Reviewed-by: Clint Byrum <clint@ubuntu.com>
50+
51+=== modified file 'ext/pgsql/pgsql.c'
52+--- a/ext/pgsql/pgsql.c 2010-08-01 11:58:54 +0000
53++++ b/ext/pgsql/pgsql.c 2010-08-13 07:03:38 +0000
54+@@ -742,7 +742,11 @@
55+ if (len) {
56+ *len = i;
57+ }
58+- return estrndup(message, i);
59++
60++ //return estrndup(message, i);
61++ char *ret_msg = (char *)pemalloc((i+1)*sizeof(char), 1);
62++ memcpy(ret_msg, message, (i+1)*sizeof(char));
63++ return ret_msg;
64+ }
65+ /* }}} */
66+
67+@@ -814,7 +818,7 @@
68+
69+ TSRMLS_FETCH();
70+ if (! PGG(ignore_notices)) {
71+- notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
72++ notice = (php_pgsql_notice *)pemalloc(sizeof(php_pgsql_notice), 1);
73+ notice->message = _php_pgsql_trim_message(message, &notice->len);
74+ if (PGG(log_notices)) {
75+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
76+@@ -824,16 +828,17 @@
77+ }
78+ /* }}} */
79+
80+-#define PHP_PGSQL_NOTICE_PTR_DTOR (void (*)(void *))_php_pgsql_notice_ptr_dtor
81++#define PHP_PGSQL_NOTICE_PTR_DTOR (void (*)(void **))_php_pgsql_notice_ptr_dtor
82+
83+ /* {{{ _php_pgsql_notice_dtor
84+ */
85+ static void _php_pgsql_notice_ptr_dtor(void **ptr)
86+ {
87+ php_pgsql_notice *notice = (php_pgsql_notice *)*ptr;
88+- if (notice) {
89+- efree(notice->message);
90+- efree(notice);
91++ int ref_count = (*(zval*)*ptr).refcount__gc;
92++ if (notice && ref_count) {
93++ pefree(notice->message, 1);
94++ pefree(notice, 1);
95+ notice = NULL;
96+ }
97+ }
98+
99
100=== modified file 'debian/patches/series'
101--- debian/patches/series 2010-08-06 13:10:17 +0000
102+++ debian/patches/series 2010-08-13 15:11:01 +0000
103@@ -56,3 +56,4 @@
104 php-fpm-man-section-and-cleanup.patch
105 fpm-config.patch
106 lp564920-fix-big-files.patch
107+php52389-pgsql-segfault.patch
108
109=== modified file 'debian/php5-module.ini'
110--- debian/php5-module.ini 2010-05-25 10:17:00 +0000
111+++ debian/php5-module.ini 2010-08-13 15:11:01 +0000
112@@ -1,2 +1,2 @@
113-# configuration for php @extname@ module
114+; configuration for php @extname@ module
115 extension=@dsoname@.so

Subscribers

People subscribed via source and target branches

to all changes: