ID:               35009
 Updated by:       [EMAIL PROTECTED]
-Summary:          mysql_pconnect() crashes on PHP-CLI when ZTS is
                   enabled
 Reported By:      glen at delfi dot ee
-Status:           Open
+Status:           Verified
 Bug Type:         MySQL related
 Operating System: PLD Linux
 PHP Version:      5CVS-2005-10-28 (snap)
 New Comment:

Verified. Reproducing steps:

# ./configure --disable-all --with-mysql=shared --enable-maintainer-zts
--enable-debug
# make
# gdb --args sapi/cli/php -dextension_dir=.
-dextension=modules/mysql.so -r '$f = mysql_pconnect();'
(gdb) run



Previous Comments:
------------------------------------------------------------------------

[2005-11-06 12:02:00] glen at delfi dot ee

this dl() was for sake of the test. in real show the  
php.ini defines extension to load. and in fact, it crashes  
same way with using php.ini (i didn't want to overwrite 
system php.ini with this test) 
  
if it helps figuring out the leak, then replacing  
mysql_pconnect with mysql_connect call omits the crash.

------------------------------------------------------------------------

[2005-11-06 04:05:04] [EMAIL PROTECTED]

"Note: dl() is not supported in multithreaded Web servers."

So how could you load the shared extension?



------------------------------------------------------------------------

[2005-11-01 16:42:25] glen at delfi dot ee

yes. appears so: 
 
$ ./configure --disable-all --with-mysql 
--enable-maintainer-zts --enable-debug 
$ make 
$ ./sapi/cli/php  -r '$r = mysql_pconnect("heart");echo 
"$r\n";'; echo "rc=$?" 
Resource id #4 
rc=0 
$ ./sapi/cli/php -m 
[PHP Modules] 
date 
mysql 
standard 
 
[Zend Modules] 
 
code used: php5-200510281630

------------------------------------------------------------------------

[2005-11-01 11:39:45] [EMAIL PROTECTED]

What if you configure the mysql extension as static, does it work then?

------------------------------------------------------------------------

[2005-10-28 20:49:51] glen at delfi dot ee

same thing with php5-200510281630

$ ./sapi/cli/php -v
PHP 5.1.0RC5-dev (cli) (built: Oct 28 2005 21:47:13) (DEBUG)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0-dev, Copyright (c) 1998-2005 Zend Technologies

$ ./sapi/cli/php  -r 'dl("mysql.so"); mysql_pconnect();'

Warning: mysql_pconnect(): Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock' (2) in Command line code on line 1
/home/builder/rpm/BUILD/php5-200510281630/Zend/zend_hash.c(678) :
ht=0x8264d78 is already destroyed
/home/builder/rpm/BUILD/php5-200510281630/Zend/zend_hash.c(678) :
ht=0x8264d78 is already destroyed
/home/builder/rpm/BUILD/php5-200510281630/Zend/zend_hash.c(67) : Bailed
out without a bailout address!
$

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35009

-- 
Edit this bug report at http://bugs.php.net/?id=35009&edit=1

Reply via email to