ID: 24535
User updated by: artem at osp dot ru
Reported By: artem at osp dot ru
-Status: Feedback
+Status: Open
Bug Type: MySQL related
Operating System: Linux 2.2.25
PHP Version: 4.3.2
New Comment:
[www2:/opt/www/bin]:1092# gdb /opt/www/bin/httpd
GNU gdb 5.0
Copyright 2000 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-redhat-linux"...
(gdb) run -X
Starting program: /opt/www/bin/httpd -X
Program received signal SIGSEGV, Segmentation fault.
0x822263d in my_net_read ()
(gdb) bt
#0 0x822263d in my_net_read ()
#1 0x8217a1b in net_safe_read ()
#2 0x82185c8 in read_one_row ()
#3 0x821b92b in mysql_fetch_row ()
#4 0x80f667b in php_mysql_fetch_hash (ht=1, return_value=0x840e6cc,
this_ptr=0x0, return_value_used=1, result_type=2, expected_args=1)
at /usr/local/src/php-4.3.2-ssl/ext/mysql/php_mysql.c:1886
#5 0x80f689a in zif_mysql_fetch_row (ht=1, return_value=0x840e6cc,
this_ptr=0x0, return_value_used=1)
at /usr/local/src/php-4.3.2-ssl/ext/mysql/php_mysql.c:1937
#6 0x80cbebb in execute (op_array=0x840822c)
at /usr/local/src/php-4.3.2-ssl/Zend/zend_execute.c:1606
#7 0x80bc28e in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /usr/local/src/php-4.3.2-ssl/Zend/zend.c:869
#8 0x8092554 in php_execute_script (primary_file=0xbffff3b0)
at /usr/local/src/php-4.3.2-ssl/main/main.c:1671
#9 0x80d0882 in apache_php_module_main (r=0x83f0cd4,
display_source_mode=0)
at /usr/local/src/php-4.3.2-ssl/sapi/apache/sapi_apache.c:54
#10 0x8088df0 in send_php ()
#11 0x8088e49 in send_parsed_php ()
#12 0x81d9fb7 in ap_invoke_handler ()
#13 0x81ef52b in process_request_internal ()
#14 0x81ef58c in ap_process_request ()
---Type <return> to continue, or q <return> to quit---
#15 0x81e620d in child_main ()
#16 0x81e63dc in make_child ()
#17 0x81e6550 in startup_children ()
#18 0x81e6bc8 in standalone_main ()
#19 0x81e7447 in main ()
#20 0x1eff31 in __libc_start_main (main=0x81e7084 <main>, argc=2,
ubp_av=0xbffff7f4, init=0x808515c <_init>, fini=0x828de10 <_fini>,
rtld_fini=0x11e274 <_dl_fini>, stack_end=0xbffff7ec)
at ../sysdeps/generic/libc-start.c:129
(gdb)
Previous Comments:
------------------------------------------------------------------------
[2003-07-08 07:09:34] [EMAIL PROTECTED]
Disable xdebug first and try get new backtrace.
------------------------------------------------------------------------
[2003-07-08 06:36:47] artem at osp dot ru
Description:
------------
I need two connections to mysql server for processing big result
trought mysql_unbuffered_query().
But on mysql_fetch_row() after second connect there is error.
php was configured:
./configure --with-mysql=/opt/mysql --enable-track-vars --with-gd
--with-zlib-dir=/usr/lib/ --enable-memory-limit --enable-debug
--with-apache=../apache_1.3.27-ssl
mysql version 4.0.13
mysql was configured:
./configure '--prefix=/opt/mysql-4.0.13'
'--with-mysqld-ldflags=-all-static' '--disable-shared'
'--with-charset=cp1251' '--with-innodb' '--enable-local-inf
ile'
Reproduce code:
---------------
<?php
function my_connect() {
[EMAIL PROTECTED]("localhost","<login>","<pass>",1);
if(!$s) {
echo "Troubes at connect to MySQL. ".mysql_error();
exit;
}
if(!mysql_select_db("<DB>")) {
echo "Troubes at select DB on MySQL. ".mysql_error();
exit;
}
return $s;
}
ob_implicit_flush(1);
echo "1<br>\n";
my_connect();
echo "2<br>\n";
$res=mysql_unbuffered_query("select 'All ok'");
echo "3<br>\n";
if(!$res) {
echo "Mysql say: ".mysql_error();
exit;
}
my_connect();
echo "4<br>\n";
$row=mysql_fetch_row($res);
echo "5<br>\n";
echo $row[0];
?>
Expected result:
----------------
1
2
3
4
5
All ok
Actual result:
--------------
1
2
3
4
==========================
Segmentation fault
==========================
[www2:/opt/www/bin]:1087# gdb /opt/www/bin/httpd
GNU gdb 5.0
Copyright 2000 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-redhat-linux"...
(gdb) run -X
Starting program: /opt/www/bin/httpd -X
Program received signal SIGSEGV, Segmentation fault.
0x822263d in my_net_read ()
(gdb) bt
#0 0x822263d in my_net_read ()
#1 0x8217a1b in net_safe_read ()
#2 0x82185c8 in read_one_row ()
#3 0x821b92b in mysql_fetch_row ()
#4 0x80f667b in php_mysql_fetch_hash (ht=1, return_value=0x840ba7c,
this_ptr=0x0, return_value_used=1, result_type=2, expected_args=1)
at /usr/local/src/php-4.3.2-ssl/ext/mysql/php_mysql.c:1886
#5 0x80f689a in zif_mysql_fetch_row (ht=1, return_value=0x840ba7c,
this_ptr=0x0, return_value_used=1)
at /usr/local/src/php-4.3.2-ssl/ext/mysql/php_mysql.c:1937
#6 0x80b1adf in execute_internal (execute_data_ptr=0xbfffcca0,
return_value_used=1)
at /usr/local/src/php-4.3.2-ssl/Zend/zend_execute_API.c:42
#7 0x3452e2 in xdebug_execute_internal
(current_execute_data=0xbfffcca0,
return_value_used=1) at /tmp/tmprX1YIP/xdebug-1.2.0/xdebug.c:782
#8 0x80cbed1 in execute (op_array=0x840ac5c)
at /usr/local/src/php-4.3.2-ssl/Zend/zend_execute.c:1608
#9 0x3451f6 in xdebug_execute (op_array=0x840ac5c)
at /tmp/tmprX1YIP/xdebug-1.2.0/xdebug.c:750
#10 0x80bc28e in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /usr/local/src/php-4.3.2-ssl/Zend/zend.c:869
#11 0x8092554 in php_execute_script (primary_file=0xbffff3b0)
at /usr/local/src/php-4.3.2-ssl/main/main.c:1671
---Type <return> to continue, or q <return> to quit---
#12 0x80d0882 in apache_php_module_main (r=0x83f2f7c,
display_source_mode=0)
at /usr/local/src/php-4.3.2-ssl/sapi/apache/sapi_apache.c:54
#13 0x8088df0 in send_php ()
#14 0x8088e49 in send_parsed_php ()
#15 0x81d9fb7 in ap_invoke_handler ()
#16 0x81ef52b in process_request_internal ()
#17 0x81ef58c in ap_process_request ()
#18 0x81e620d in child_main ()
#19 0x81e63dc in make_child ()
#20 0x81e6550 in startup_children ()
#21 0x81e6bc8 in standalone_main ()
#22 0x81e7447 in main ()
#23 0x1eff31 in __libc_start_main (main=0x81e7084 <main>, argc=2,
ubp_av=0xbffff7f4, init=0x808515c <_init>, fini=0x828de10 <_fini>,
rtld_fini=0x11e274 <_dl_fini>, stack_end=0xbffff7ec)
at ../sysdeps/generic/libc-start.c:129
(gdb)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24535&edit=1