From:             bugs dot php dot net at chsc dot dk
Operating system: Linux
PHP version:      5.0.3
PHP Bug Type:     MySQL related
Bug description:  Segmentation fault in mysql_query()

Description:
------------
I have a rather complex script that dumps core every time mysql_query() is
called for the 7th time (through PEAR's DB_mysql).

The script uses Smarty, PEAR_DB and a bunch of other classes. I have not
been able to make a simple testcase. Doing the seven SQL queries alone
without Smarty and all the other code does not trigger this bug. I hope
that a stack trace will point in the right direction though.

The problem occurs with two different MySQL versions:
mysql  Ver 12.22 Distrib 4.0.20, for pc-linux (i686)
mysql  Ver 14.7 Distrib 4.1.8, for pc-linux (i686)

The problem can be reproduced on two different machines.

I am using PHP 5.0.3. The problem wasn't there with PHP 5.0.2.

PHP was configured like this:
'./configure' '--with-mysql=/usr/local/mysql' '--with-apache=../apache'
'--enable-track-vars' '--with-gettext' '--with-dom' '--with-mcrypt'
'--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir'
'--with-freetype-dir' '--with-pear' '--enable-mbstring' '--with-iconv'
'--disable-debug' '--enable-soap'


This is a stacktrace of the failure:

# gdb /usr/local/apache/bin/httpd
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-linux"...(no debugging symbols found)...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
(no debugging symbols found)...[New Thread 1024 (LWP 31535)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 31535)]
0x403d61b7 in memcpy () from /lib/libc.so.6
(gdb) bt
#0  0x403d61b7 in memcpy () from /lib/libc.so.6
#1  0x0829a104 in cli_read_rows ()
#2  0x0829b942 in mysql_close ()
#3  0x0829ba50 in mysql_real_query ()
#4  0x0817446e in zif_mysql_client_encoding ()
#5  0x0817460c in zif_mysql_client_encoding ()
#6  0x08174630 in zif_mysql_query ()
#7  0x08113a5a in zend_do_fcall_common_helper ()
#8  0x08114091 in zend_do_fcall_handler ()
#9  0x080fc375 in execute ()
#10 0x08113b42 in zend_do_fcall_common_helper ()
#11 0x08113e99 in zend_do_fcall_by_name_handler ()
#12 0x080fc375 in execute ()
#13 0x08113b42 in zend_do_fcall_common_helper ()
#14 0x08113e99 in zend_do_fcall_by_name_handler ()
#15 0x080fc375 in execute ()
#16 0x08113b42 in zend_do_fcall_common_helper ()
#17 0x08113e99 in zend_do_fcall_by_name_handler ()
#18 0x080fc375 in execute ()
#19 0x08113b42 in zend_do_fcall_common_helper ()
#20 0x08113e99 in zend_do_fcall_by_name_handler ()
#21 0x080fc375 in execute ()
#22 0x08113b42 in zend_do_fcall_common_helper ()
---Type <return> to continue, or q <return> to quit---
#23 0x08113e99 in zend_do_fcall_by_name_handler ()
#24 0x080fc375 in execute ()
#25 0x08113b42 in zend_do_fcall_common_helper ()
#26 0x08113e99 in zend_do_fcall_by_name_handler ()
#27 0x080fc375 in execute ()
#28 0x08113b42 in zend_do_fcall_common_helper ()
#29 0x08113e99 in zend_do_fcall_by_name_handler ()
#30 0x080fc375 in execute ()
#31 0x08113b42 in zend_do_fcall_common_helper ()
#32 0x08113e99 in zend_do_fcall_by_name_handler ()
#33 0x080fc375 in execute ()
#34 0x08113b42 in zend_do_fcall_common_helper ()
#35 0x08113e99 in zend_do_fcall_by_name_handler ()
#36 0x080fc375 in execute ()
#37 0x08118cd6 in zend_include_or_eval_handler ()
#38 0x080fc375 in execute ()
#39 0x08113b42 in zend_do_fcall_common_helper ()
#40 0x08113e99 in zend_do_fcall_by_name_handler ()
#41 0x080fc375 in execute ()
#42 0x08118cd6 in zend_include_or_eval_handler ()
#43 0x080fc375 in execute ()
#44 0x08113b42 in zend_do_fcall_common_helper ()
#45 0x08113e99 in zend_do_fcall_by_name_handler ()
---Type <return> to continue, or q <return> to quit---
#46 0x080fc375 in execute ()
#47 0x08113b42 in zend_do_fcall_common_helper ()
#48 0x08113e99 in zend_do_fcall_by_name_handler ()
#49 0x080fc375 in execute ()
#50 0x08113b42 in zend_do_fcall_common_helper ()
#51 0x08113e99 in zend_do_fcall_by_name_handler ()
#52 0x080fc375 in execute ()
#53 0x08113b42 in zend_do_fcall_common_helper ()
#54 0x08113e99 in zend_do_fcall_by_name_handler ()
#55 0x080fc375 in execute ()
#56 0x080e1a68 in zend_execute_scripts ()
#57 0x080b98da in php_execute_script ()
#58 0x0811b712 in apache_php_module_main ()
#59 0x080b22f2 in ssl_expr_yyinput ()
#60 0x080b2341 in ssl_expr_yyinput ()
#61 0x0825b364 in ap_invoke_handler ()
#62 0x0826b74c in ap_some_auth_required ()
#63 0x0826ba50 in ap_internal_redirect ()
#64 0x08096c6c in ap_get_server_built ()
#65 0x0825b364 in ap_invoke_handler ()
#66 0x0826b74c in ap_some_auth_required ()
#67 0x0826b7a8 in ap_process_request ()
#68 0x08264d57 in ap_child_terminate ()
---Type <return> to continue, or q <return> to quit---
#69 0x08264ef4 in ap_child_terminate ()
#70 0x08265019 in ap_child_terminate ()
#71 0x0826556d in ap_child_terminate ()
#72 0x08265c7d in main ()
#73 0x4037a14f in __libc_start_main () from /lib/libc.so.6
(gdb)



-- 
Edit bug report at http://bugs.php.net/?id=31349&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31349&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31349&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31349&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31349&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31349&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31349&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31349&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31349&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31349&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31349&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31349&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31349&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31349&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31349&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31349&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31349&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31349&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31349&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31349&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31349&r=mysqlcfg

Reply via email to