php-cli segmentation fault with mysql extension

Bug #343870 reported by Daniel Norton
208
This bug affects 26 people
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
mysql-dfsg-5.0 (Ubuntu)
Confirmed
Medium
Unassigned
Intrepid
Won't Fix
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
Karmic
Invalid
Medium
Unassigned
mysql-dfsg-5.1 (Ubuntu)
Fix Released
Medium
Unassigned
Intrepid
Won't Fix
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
Karmic
Won't Fix
Medium
Unassigned
php5 (Debian)
Fix Released
Unknown
php5 (Ubuntu)
Invalid
Medium
Unassigned
Intrepid
Invalid
Undecided
Unassigned
Jaunty
Invalid
Undecided
Unassigned
Karmic
Invalid
Medium
Unassigned

Bug Description

Binary package hint: php5-cli

$ php -v
PHP 5.2.6-2ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:38:24)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Segmentation fault

The problem is intermittent, occurring about 9 out of 10 times.

Ubuntu version: 8.10

Package: php5-cli
Version: 5.2.6-2ubuntu4.1

Package: php5-mysql
Version: 5.2.6-2ubuntu4.1

The problem goes away if I remove both mysql.ini and mysqli.ini from /etc/php5/cli/conf.d

=== Stable Release Update Information ===

IMPACT

This bug will affect any users of php that have installed the php5-mysql module, and so the impact is fairly high. Meanwhile, the patch is fairly small, and is already released in later upstream versions.
.
DEV RELEASE STATUS

This was fixed upstream in mysql v5.1.40, which is well below the Maverick version, 5.1.49. Lucid also has 5.1.41, and so is not affected.

TEST CASE

while true; do php -r ""; done

Will eventually produce a segmentation fault.

REGRESSION POTENTIAL

The change is very tiny and seeing as the patch has been in use in subsequent releases of Ubuntu, regression seems unlikely.

Related branches

Changed in php5:
status: Unknown → Incomplete
Revision history for this message
Andrew Mitchell (ajmitch) wrote :

This happens on Debian as well due to a race condition in libmysqlclient15off:
http://bugs.mysql.com/bug.php?id=42850

Changed in php5 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Mathias Gug (mathiaz)
Changed in mysql-dfsg-5.0:
importance: Undecided → Low
status: New → Triaged
importance: Low → Medium
Revision history for this message
Frank Schubert (f-schubert) wrote :

As the last libmysqlclient15off update (5.1.30really5.0.75-0ubuntu10.2) still seem to contains this bug, I'll try to explain (repeat) the description of how to test for the bug as in:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524366

In short: Compare the output of

while [ 1 ]; do echo '<?php echo "toto tata \n";' | php; done

with

while [ 1 ]; do echo '<?php echo "toto tata \n";' | php -n; done

"-n" disables loading of php modules.

I have downgraded to the version in
deb http://people.debian.org/~seanius/mysql/513204/amd64 ./
and the problem went away.

Let me know if I can help in any way to resolve this.

Thanks for your work!

Revision history for this message
Mark Rose (markrose) wrote :

This one is realllly irritating. I hope it's fixed in the next Ubuntu update.

I've wasted countless hours trying trace down random seg faults due to this.

Revision history for this message
Håvard Pedersen (haavard-pedersen) wrote :

Sorry for +1'ing, but isn't this a pretty serious bug to keep unpatched for 6 months?

Revision history for this message
Georgi Kodinov (kgeorge-mysql) wrote :

Please use the MySQL bug database (http://bugs.mysql.com) to report bugs.

Revision history for this message
Håvard Pedersen (haavard-pedersen) wrote :

Since Andrew posted a link to the bug report for MySQL, I doubt re-reporting the bug to them is productive.

And since it is fixed in Debian, the problem is clearly isolated and fixed somewhere.

Revision history for this message
Chuck Short (zulcss) wrote :

Are people having problems with this bug in jaunty as well? Or is it just intrepid?

Thanks
chuck

Revision history for this message
Mark Rose (markrose) wrote :

I am experiencing this in Jaunty.

I'm temporarily getting around it using 'taskset -c 0 php ...'

Revision history for this message
kolen (incredible-angst) wrote :

I am not experiencing this in Jaunty.

Revision history for this message
DarkNova (c-launch) wrote :

I am experiencing this bug in Jaunty.

I would like to try installing the Debian upstream replacement for libmysqlclient15off as referenced in the bug:

http://ftp.fr.debian.org/debian/pool/main/m/mysql-dfsg-5.0/libmysqlclient15off_5.0.51a-24+lenny2+spu1_amd64.deb

I tried installing this with dpkg, but later Ubuntu's package manager upgraded some packages and subsequently went on to delete mysql, apache, and a bunch of packages that depend on mysql from my computer! Apparently since the version number for the newly install libmysqlclient15off was 5.0.51a-24+lenny2+spu1 and the "current" Ubuntu version is 5.1.30really5.0.75-0ubuntu10.2 it thought it needed to remove the one I installed and upgrade it. I'm not sure why it also deleted all these other packages without telling me first.

Does anyone know how to properly install this version of libmysqlclient15off so I can test to see if it fixes the bug without messing up Ubuntu? Thanks.

Revision history for this message
Mikko Rantalainen (mira) wrote :

To reproduce in Jaunty (may require at least two physical CPU cores because this is a race condition) simply run the following bash command:

$ while true; do php -r ""; done

(hit CTRL+C after seeing at least one "Segmentation fault")

The above code repeatedly starts php interpreter and runs no code before exit. At it still causes random segfaults.

To reproduce, you must have package "php5-mysql" or equivalent installed (try "php -m | grep mysql" to see if you have mysql support in php).

I believe that this may cause minor performance hit with the non-CLI php variant also but because the segmentation fault occurs in (transparent) paraller process, the problem is not visible through apache.

Revision history for this message
kolen (incredible-angst) wrote :

> $ while true; do php -r ""; done
Yes, reproduced in Jaunty on two CPU cores.

Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

I was wondering if someone can test this on Karmic as well.

Thanks
chuck

Chuck Short (zulcss)
Changed in php5 (Ubuntu Karmic):
status: Confirmed → Fix Released
Revision history for this message
Mark Rose (markrose) wrote : Re: [Bug 343870] Re: php-cli segmentation fault with mysql extension

Thanks!!

Cheers,
Mark

On Tuesday 06 October 2009 9:11:20 am Chuck Short wrote:
> ** Changed in: php5 (Ubuntu Karmic)
> Status: Confirmed => Fix Released

Revision history for this message
Chuck Short (zulcss) wrote :

Confirmed on a jaunty install.

Changed in mysql-dfsg-5.0 (Ubuntu Karmic):
status: Triaged → Fix Released
Revision history for this message
Steffen Rusitschka (rusi) wrote :

I'm still experiencing this bug on Jaunty AND Karmic (64-bit).

Revision history for this message
Russ Brown (pickscrape) wrote :

Sent here from bug 392521.

I just tried this on a completely up to date karmic machine:

$ while true; do php -r ""; done
Segmentation fault (core dumped)

Segfaults continue to appear every few seconds.

$ php -v
PHP 5.2.10-2ubuntu5 with Suhosin-Patch 0.9.7 (cli) (built: Oct 13 2009 18:33:05)

$ mysql --version
mysql Ver 14.12 Distrib 5.0.83, for debian-linux-gnu (x86_64) using readline 5.2

Revision history for this message
Mikko Rantalainen (mira) wrote :

Reproduced with 64 bit Karmic. See bug 459048 for stack trace.

Revision history for this message
L Duperval (lduperval) wrote :

Just updated to Karmic (final) this morning and I am seeing the same thing.

Is there a way to test php-mysql to determine where the problem lies?

I am using php5 5.2.10, php5-mysql 5.2.10.

I had libmysqlclientoff 5.1.30 but removed it and now only have libmysqlclient16 5.1.37.

I tried accessing tbug 459048 but permission was denied.

L

Revision history for this message
L Duperval (lduperval) wrote :

I am on 64 bit Karmic also.

Revision history for this message
Morten Bressendorff Schmidt (morten-tuxtail) wrote :

I too still get these "random" segfaults. I'm on Karmic.

$ dpkg -l php5-{mysql,cli}|grep ii|awk {' print $2 " " $3 '}
php5-cli 5.2.10.dfsg.1-2ubuntu6.3
php5-mysql 5.2.10.dfsg.1-2ubuntu6.3

Revision history for this message
Ondřej Surý (ondrej) wrote :

It has not been fixed in Karmic.
Check source codes of mysql-dfsg-5.1-5.1.37 and compare with: http://lists.mysql.com/commits/84864

Changed in mysql-dfsg-5.0 (Ubuntu Karmic):
status: Fix Released → Confirmed
Changed in php5 (Ubuntu Karmic):
status: Fix Released → Confirmed
Changed in php5 (Ubuntu):
status: Fix Released → Confirmed
affects: mysql-dfsg-5.0 (Ubuntu) → mysql-dfsg-5.1 (Ubuntu)
Changed in mysql-dfsg-5.1 (Ubuntu):
status: Fix Released → Confirmed
Ondřej Surý (ondrej)
Changed in mysql-dfsg-5.0 (Ubuntu Karmic):
status: New → Confirmed
Revision history for this message
Ondřej Surý (ondrej) wrote :

Please add attached dpatch to karmic mysql-dfsg-5.0 and mysql-dfsg-5.1, jaunty and intrepid mysql-dfsg-5.0.

Looks like hardy is also affected.

Thierry Carrez (ttx)
Changed in php5 (Ubuntu):
status: Confirmed → Invalid
Changed in php5 (Ubuntu Intrepid):
status: New → Invalid
Changed in php5 (Ubuntu Jaunty):
status: New → Invalid
Changed in php5 (Ubuntu Karmic):
status: Confirmed → Invalid
Changed in mysql-dfsg-5.0 (Ubuntu Karmic):
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in mysql-dfsg-5.0 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Ondřej Surý (ondrej) wrote :

Thierry,

could you please leave it in php5 as Confirmed (better would be 'Also Affected' or 'Blocked-By', but launchpad doesn't have these), so it does show up in bug listing? If we hide this bug from users we will get tons of duplicates.

Thanks,
Ondrej

Changed in php5 (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

This is fixed for lucid. The patch described in the mysql bug is there.

regards
chuck

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Hendy Irawan (ceefour) wrote :

Still happens on Karmic :

ceefour@caliva:~$ php -v
PHP 5.2.10-2ubuntu6.4 with Suhosin-Patch 0.9.7 (cli) (built: Jan 6 2010 22:41:56)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans
Segmentation fault

ceefour@caliva:~$ while true; do php -r ""; done
Segmentation fault
^C
Segmentation fault

Segmentation fault
^C^C

No need to run any scripts, simple php -v also segfaults sometimes :

ceefour@caliva:~$ while true; do php -v > /dev/null ; done
Segmentation fault
Segmentation fault
^C

ceefour@caliva:~$ uname -a
Linux caliva 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 i686 GNU/Linux

ceefour@caliva:~$ aptitude show php5-mysql php5-cli
Package: php5-mysql
State: installed
Automatically installed: no
Version: 5.2.10.dfsg.1-2ubuntu6.4
Priority: optional
Section: php
Maintainer: Ubuntu Core Developers <email address hidden>
Uncompressed Size: 246k
Depends: libmysqlclient16 (>= 5.1.21-1), libc6 (>= 2.4), php5 |
         phpapi-20060613+lfs, php5-common (= 5.2.10.dfsg.1-2ubuntu6.4)
Conflicts: php5-mysqli
Replaces: php5-mysqli

Package: php5-cli
State: installed
Automatically installed: no
Version: 5.2.10.dfsg.1-2ubuntu6.4
Priority: optional
Section: php
Maintainer: Ubuntu Core Developers <email address hidden>
Uncompressed Size: 5,394k
Depends: libbz2-1.0, libc6 (>= 2.7), libcomerr2 (>= 1.01), libdb4.7, libedit2
         (>= 2.5.cvs.20010821-1), libgssapi-krb5-2 (>= 1.6.dfsg.2), libk5crypto3
         (>= 1.6.dfsg.2), libkrb5-3 (>= 1.6.dfsg.2), libncurses5 (>=
         5.6+20071006-3), libpcre3 (>= 7.7), libssl0.9.8 (>= 0.9.8f-5), libxml2
         (>= 2.7.4), zlib1g (>= 1:1.1.4), mime-support, php5-common (=
         5.2.10.dfsg.1-2ubuntu6.4), libmagic1, ucf, tzdata
Suggests: php-pear
Provides: phpapi-20060613+lfs

tags: added: patch
tags: added: patch-accepted-upstream
removed: patch
tags: added: patch
Revision history for this message
Chuck Short (zulcss) wrote :

For those who are having this problem can they retest against lucid?

Thanks
chuck

Chuck Short (zulcss)
Changed in mysql-dfsg-5.0 (Ubuntu Intrepid):
status: New → Won't Fix
Changed in mysql-dfsg-5.1 (Ubuntu Intrepid):
status: New → Won't Fix
Revision history for this message
Mikko Rantalainen (mira) wrote :

Checked against lucid inside VirtualBox OSE and could not reproduce the problem anymore. I'm able to reproduce against karmic even inside VirtualBox (and on real hardware, too).

Revision history for this message
Adrian Almenar (aalmenar) wrote :

This still happens to me on Lucid 64 Bits. Will try with lucid 32 bits and let you know

Revision history for this message
Adrian Almenar (aalmenar) wrote :

OK, tested on Lucid 32 bits, it still happens, segfaults while executing a database query...

Revision history for this message
Adrian Almenar (aalmenar) wrote :
Download full text (4.2 KiB)

Here is attached the gdb session:

Program received signal SIGSEGV, Segmentation fault.
0x08329955 in gc_zval_possible_root (zv=0xa56a6e4) at /build/buildd/php5-5.3.2/Zend/zend_gc.c:143
143 /build/buildd/php5-5.3.2/Zend/zend_gc.c: No such file or directory.
        in /build/buildd/php5-5.3.2/Zend/zend_gc.c
(gdb) bt
#0 0x08329955 in gc_zval_possible_root (zv=0xa56a6e4) at /build/buildd/php5-5.3.2/Zend/zend_gc.c:143
#1 0x082fd4c1 in _zval_ptr_dtor (zval_ptr=0xa53fd54) at /build/buildd/php5-5.3.2/Zend/zend_gc.h:183
#2 0x08316f94 in zend_hash_destroy (ht=0xa58a674) at /build/buildd/php5-5.3.2/Zend/zend_hash.c:726
#3 0x0832d2b3 in zend_object_std_dtor (object=0xa55c4b8) at /build/buildd/php5-5.3.2/Zend/zend_objects.c:45
#4 0x0832d2f2 in zend_objects_free_object_storage (object=0xa55c4b8) at /build/buildd/php5-5.3.2/Zend/zend_objects.c:114
#5 0x08330e1d in zend_objects_store_del_ref_by_handle_ex (handle=<error type>, handlers=0x8764700) at /build/buildd/php5-5.3.2/Zend/zend_objects_API.c:220
#6 0x08330e5f in zend_objects_store_del_ref (zobject=0xa5a50bc) at /build/buildd/php5-5.3.2/Zend/zend_objects_API.c:172
#7 0x08309cd9 in _zval_dtor_func (zvalue=0xa5a50bc) at /build/buildd/php5-5.3.2/Zend/zend_variables.c:55
#8 0x082fd48d in _zval_ptr_dtor (zval_ptr=0xa58ecd4) at /build/buildd/php5-5.3.2/Zend/zend_variables.h:35
#9 0x08316f94 in zend_hash_destroy (ht=0x8903d1c) at /build/buildd/php5-5.3.2/Zend/zend_hash.c:726
#10 0x08309c96 in _zval_dtor_func (zvalue=0xa5afb00) at /build/buildd/php5-5.3.2/Zend/zend_variables.c:46
#11 0x082fd48d in _zval_ptr_dtor (zval_ptr=0xa581904) at /build/buildd/php5-5.3.2/Zend/zend_variables.h:35
#12 0x08316f94 in zend_hash_destroy (ht=0xa57a8d4) at /build/buildd/php5-5.3.2/Zend/zend_hash.c:726
#13 0x0832d2b3 in zend_object_std_dtor (object=0xa5afb2c) at /build/buildd/php5-5.3.2/Zend/zend_objects.c:45
#14 0x0832d2f2 in zend_objects_free_object_storage (object=0xa5afb2c) at /build/buildd/php5-5.3.2/Zend/zend_objects.c:114
#15 0x08330e1d in zend_objects_store_del_ref_by_handle_ex (handle=<error type>, handlers=0x8764700) at /build/buildd/php5-5.3.2/Zend/zend_objects_API.c:220
#16 0x08330e5f in zend_objects_store_del_ref (zobject=0xa5be2a8) at /build/buildd/php5-5.3.2/Zend/zend_objects_API.c:172
#17 0x08309cd9 in _zval_dtor_func (zvalue=0xa5be2a8) at /build/buildd/php5-5.3.2/Zend/zend_variables.c:55
#18 0x082fd48d in _zval_ptr_dtor (zval_ptr=0xbfffc984) at /build/buildd/php5-5.3.2/Zend/zend_variables.h:35
#19 0x083301fb in zend_std_write_property (object=0xa5c56d8, member=0xa0299e0, value=0xa5d17d8) at /build/buildd/php5-5.3.2/Zend/zend_object_handlers.c:435
#20 0x0837a9d9 in zend_assign_to_object (result=0xa0299b4, object_ptr=0x877b788, property_name=0xa0299e0, value_op=0xa029a14, Ts=0x893febc, opcode=136)
    at /build/buildd/php5-5.3.2/Zend/zend_execute.c:589
#21 0x0837b268 in ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER (execute_data=0x893fe60) at /build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:17617
#22 0x08333d8e in execute (op_array=0x8a3fa50) at /build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104
#23 0x082ffbf1 in zend_call_function (fci=0xbfffcbe0, fci_cache=0xbfffcc04) at /build/buildd/php5-5.3.2/Zend/z...

Read more...

Revision history for this message
Kir Kolyshkin (kolyshkin) wrote :

Adrian,

What you post has nothing to do with this bugreport. The bugreport is about problem with mysql extention which made php segfault (and it could be workarounded by uninstalling/disabling mysql extension). In your case backtrace shows no evidence of mysql involved.

I suggest you file a separate bug report for your issue.

Revision history for this message
Adrian Almenar (aalmenar) wrote :

Kir, this happens when mysql is activated and at the time I issue a sql query. If i disable mysql, (fetching everything from memcache) this does not happens, only happens on php-cli not on the webservers not other place.

Revision history for this message
Adrian Almenar (aalmenar) wrote :
Download full text (4.6 KiB)

This is the backtrace that suggests me it's from mysqlclient:

Program received signal SIGSEGV, Segmentation fault.
zval_mark_grey (pz=0x13539974) at /build/buildd/php5-5.3.2/Zend/zend_gc.c:356
warning: Source file is more recent than executable.
356 p = Z_ARRVAL_P(pz)->pListHead;
(gdb) bt
#0 zval_mark_grey (pz=0x13539974) at /build/buildd/php5-5.3.2/Zend/zend_gc.c:356
#1 0x08328d08 in zval_mark_grey (pz=0x13539974) at /build/buildd/php5-5.3.2/Zend/zend_gc.c:367
#2 0x0832970d in gc_collect_cycles () at /build/buildd/php5-5.3.2/Zend/zend_gc.c:417
#3 0x08329995 in gc_zval_possible_root (zv=0x13f32a8c) at /build/buildd/php5-5.3.2/Zend/zend_gc.c:166
#4 0x082fd4c1 in _zval_ptr_dtor (zval_ptr=0xbfffd16c) at /build/buildd/php5-5.3.2/Zend/zend_gc.h:183
#5 0x0835cc09 in zend_do_fcall_common_helper_SPEC (execute_data=0x13f32a8c) at /build/buildd/php5-5.3.2/Zend/zend_execute.h:316
#6 0x08333d8e in execute (op_array=0x8909d28) at /build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104
#7 0x08309fa6 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /build/buildd/php5-5.3.2/Zend/zend.c:1266
#8 0x082ae754 in php_execute_script (primary_file=0xbffff674) at /build/buildd/php5-5.3.2/main/main.c:2288
#9 0x083a0c28 in main (argc=7, argv=0xbffff7b4) at /build/buildd/php5-5.3.2/sapi/cli/php_cli.c:1196
(gdb) p op_array
No symbol "op_array" in current context.
(gdb) frame 6
#6 0x08333d8e in execute (op_array=0x8909d28) at /build/buildd/php5-5.3.2/Zend/zend_vm_execute.h:104
warning: Source file is more recent than executable.
104 if ((ret = EX(opline)->handler(execute_data TSRMLS_CC)) > 0) {
(gdb) p ret
$2 = 324245876
(gdb) p handler
$3 = {{name = 0x83abb54 "cdb", flags = 31, open = 0x80c3150 <dba_open_cdb>, close = 0x80c30e0 <dba_close_cdb>, fetch = 0x80c2fe0 <dba_fetch_cdb>,
    update = 0x80c2f70 <dba_update_cdb>, exists = 0x80c2f10 <dba_exists_cdb>, delete = 0x80c2af0 <dba_delete_cdb>, firstkey = 0x80c2d50 <dba_firstkey_cdb>,
    nextkey = 0x80c2be0 <dba_nextkey_cdb>, optimize = 0x80c2b00 <dba_optimize_cdb>, sync = 0x80c2b10 <dba_sync_cdb>, info = 0x80c2b20 <dba_info_cdb>}, {
    name = 0x83abcc1 "cdb_make", flags = 31, open = 0x80c3150 <dba_open_cdb>, close = 0x80c30e0 <dba_close_cdb>, fetch = 0x80c2fe0 <dba_fetch_cdb>,
    update = 0x80c2f70 <dba_update_cdb>, exists = 0x80c2f10 <dba_exists_cdb>, delete = 0x80c2af0 <dba_delete_cdb>, firstkey = 0x80c2d50 <dba_firstkey_cdb>,
    nextkey = 0x80c2be0 <dba_nextkey_cdb>, optimize = 0x80c2b00 <dba_optimize_cdb>, sync = 0x80c2b10 <dba_sync_cdb>, info = 0x80c2b20 <dba_info_cdb>}, {name = 0x83abcca "db4",
    flags = 15, open = 0x80c3390 <dba_open_db4>, close = 0x80c3320 <dba_close_db4>, fetch = 0x80c3a40 <dba_fetch_db4>, update = 0x80c39a0 <dba_update_db4>,
    exists = 0x80c38f0 <dba_exists_db4>, delete = 0x80c3890 <dba_delete_db4>, firstkey = 0x80c3810 <dba_firstkey_db4>, nextkey = 0x80c3720 <dba_nextkey_db4>,
    optimize = 0x80c32b0 <dba_optimize_db4>, sync = 0x80c32c0 <dba_sync_db4>, info = 0x80c32f0 <dba_info_db4>}, {name = 0x83abb58 "inifile", flags = 95,
    open = 0x80c4470 <dba_open_inifile>, close = 0x80c4440 <dba_close_inifile>, fetch = 0x80c4180 <dba_fetch_inifile>, update = ...

Read more...

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

The patch uploaded above is pretty simple and definitely removes the offending code, in much the same way as it was fixed upstream.

I'm doing test runs/builds on karmic right now.

Changed in mysql-dfsg-5.1 (Ubuntu Karmic):
assignee: nobody → Clint Byrum (clint-fewbar)
status: Confirmed → In Progress
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

mysql-dfsg-5.0 buidls libmysqlclient15, which doesn't exist in karmic and so isn't affected by this bug.

Changed in mysql-dfsg-5.0 (Ubuntu Karmic):
status: Confirmed → Invalid
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

I've added SRU information to the bug description.

I believe this is worthy of a fix for karmic, and have proposed the merge.

NOTE that the patch added in the merge proposal above is actually quite different, and that this is the final patch that made it into the mysql source tree.

https://code.launchpad.net/~clint-fewbar/ubuntu/karmic/mysql-dfsg-5.1/mysql-sru-343870/+merge/35366

description: updated
Changed in mysql-dfsg-5.1 (Ubuntu Karmic):
assignee: Clint Byrum (clint-fewbar) → nobody
status: In Progress → Confirmed
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Marking jaunty task Won't Fix as jaunty is past EOL

Changed in mysql-dfsg-5.0 (Ubuntu Jaunty):
status: New → Won't Fix
Changed in mysql-dfsg-5.1 (Ubuntu Jaunty):
status: New → Won't Fix
Revision history for this message
Martin Pitt (pitti) wrote :

I take it this is not actually a problem in php5, as nothing here talks about PHP?

This is only marked to affect karmic at this point, so personally I don't think that there is much value fixing this in karmic now, and I'd just close it as "wont fix". However, if you really want to spend the effort on this, please upload it.

Changed in php5 (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Martin Pitt (pitti) wrote :

See previous comment.

Changed in mysql-dfsg-5.1 (Ubuntu Karmic):
status: Confirmed → Won't Fix
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

On Tue, 2011-02-01 at 12:23 +0000, Martin Pitt wrote:
> See previous comment.
>
> ** Changed in: mysql-dfsg-5.1 (Ubuntu Karmic)
> Status: Confirmed => Won't Fix
>

I think thats fair Martin. When I did the initial patch in September it
made sense.. but now 5 months later, Karmic should be going away.

Revision history for this message
Nonox (nbulian) wrote :

Hi!
I'm getting (almost any time) the "Segmentation fault" problem when the crontab execute a php script. Can anyone help me and tell me how to solve the issue?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick

$ php -v
PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:08:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

$ dpkg --get-selections | grep php
libapache2-mod-php5 install
php5-cli install
php5-common install
php5-curl install
php5-mysql install

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Nonox's message of Tue Apr 12 01:51:12 UTC 2011:
> Hi!
> I'm getting (almost any time) the "Segmentation fault" problem when the crontab execute a php script. Can anyone help me and tell me how to solve the issue?
>
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 10.10
> Release: 10.10
> Codename: maverick
>
> $ php -v
> PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:08:14)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
>
> $ dpkg --get-selections | grep php
> libapache2-mod-php5 install
> php5-cli install
> php5-common install
> php5-curl install
> php5-mysql install

The bug is in libmysqlclient. Can you show us what version of that you have installed?

dpkg -l 'libmysqlclient*'

Revision history for this message
Ambricka (petter-ambricka) wrote :

As I've had a similar problem, I'll answer... However, I don't know when I last had the problem, it might be totally useless.

ii libmysqlclient15off 5.1.30really5.0.83-0ubuntu3 MySQL database client library
ii libmysqlclient16 5.1.49-1ubuntu8.1 MySQL database client library

Now I just wonder why I have two different versions at the same time.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :
Download full text (3.3 KiB)

Excerpts from Ambricka's message of Tue Apr 12 07:28:16 UTC 2011:
> As I've had a similar problem, I'll answer... However, I don't know when
> I last had the problem, it might be totally useless.
>
>
> ii libmysqlclient15off 5.1.30really5.0.83-0ubuntu3 MySQL database client library
> ii libmysqlclient16 5.1.49-1ubuntu8.1 MySQL database client library
>
> Now I just wonder why I have two different versions at the same time.

This is normal. You may have something that still depends on
libmysqlclient15 , which was not ABI compatible with libmysqlclient16. Its
usually a transitional package and will go away when all
reverse-dependencies are gone.

php5-mysql should be using libmysqlclient16. You can tell that by running

apt-cache show php5-mysql|grep ^Depends:

>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/343870
>
> Title:
> php-cli segmentation fault with mysql extension
>
> Status in MySQL Server:
> Unknown
> Status in “mysql-dfsg-5.0” package in Ubuntu:
> Confirmed
> Status in “mysql-dfsg-5.1” package in Ubuntu:
> Fix Released
> Status in “php5” package in Ubuntu:
> Invalid
> Status in “mysql-dfsg-5.0” source package in Intrepid:
> Won't Fix
> Status in “mysql-dfsg-5.1” source package in Intrepid:
> Won't Fix
> Status in “php5” source package in Intrepid:
> Invalid
> Status in “mysql-dfsg-5.0” source package in Jaunty:
> Won't Fix
> Status in “mysql-dfsg-5.1” source package in Jaunty:
> Won't Fix
> Status in “php5” source package in Jaunty:
> Invalid
> Status in “mysql-dfsg-5.0” source package in Karmic:
> Invalid
> Status in “mysql-dfsg-5.1” source package in Karmic:
> Won't Fix
> Status in “php5” source package in Karmic:
> Invalid
> Status in “php5” package in Debian:
> Incomplete
>
> Bug description:
> Binary package hint: php5-cli
>
> $ php -v
> PHP 5.2.6-2ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 11 2009 20:38:24)
> Copyright (c) 1997-2008 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
> Segmentation fault
>
> The problem is intermittent, occurring about 9 out of 10 times.
>
> Ubuntu version: 8.10
>
> Package: php5-cli
> Version: 5.2.6-2ubuntu4.1
>
> Package: php5-mysql
> Version: 5.2.6-2ubuntu4.1
>
> The problem goes away if I remove both mysql.ini and mysqli.ini from
> /etc/php5/cli/conf.d
>
>
> === Stable Release Update Information ===
>
> IMPACT
>
> This bug will affect any users of php that have installed the php5-mysql module, and so the impact is fairly high. Meanwhile, the patch is fairly small, and is already released in later upstream versions.
> .
> DEV RELEASE STATUS
>
> This was fixed upstream in mysql v5.1.40, which is well below the
> Maverick version, 5.1.49. Lucid also has 5.1.41, and so is not
> affected.
>
> TEST CASE
>
> while true; do php -r ""; done
>
> Will eventually produce a segmentation fault.
>
> REGRESSION POTENTIAL
>
> The change is very tiny...

Read more...

Revision history for this message
Nonox (nbulian) wrote :

Hi Clint Byrum, sorry for the delay, here is the result of dpkg -l 'libmysqlclient*':

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===================================-===================================-======================================================================================
un libmysqlclient-dev <none> (no description available)
ii libmysqlclient16 5.1.49-1ubuntu8.1 MySQL database client library

I hope you can help me!

Thanks.

Revision history for this message
Nonox (nbulian) wrote :

Hi Clint Byrum, sorry for the delay, here is the result of dpkg -l 'libmysqlclient*':

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===================================-===================================-======================================================================================
un libmysqlclient-dev <none> (no description available)
ii libmysqlclient16 5.1.49-1ubuntu8.1 MySQL database client library

I hope you can help me!

Thanks.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Nonox's message of Sun Apr 17 17:02:41 UTC 2011:
> Hi Clint Byrum, sorry for the delay, here is the result of dpkg -l
> 'libmysqlclient*':
>
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name Version Description
> +++-===================================-===================================-======================================================================================
> un libmysqlclient-dev <none> (no description available)
> ii libmysqlclient16 5.1.49-1ubuntu8.1 MySQL database client library

This looks like an up to date Maverick, which should not display this
behavior. Hopefully it wasn't accidentally regressed.

Can you install gdb, mysql-dbg, and php5-dbg, and run with

gdb /usr/bin/php then at the > prompt do

run -whatever --options you_use.php

Then when it segfaults do

'bt'

and paste the backtrace?

Thanks!

Changed in php5 (Debian):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.