|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26852 Segfault on mysql_pconnect
Submitted: 2004-01-09 05:53 UTC Modified: 2004-01-16 06:12 UTC
From: jm dot barbier at solidev dot org Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5CVS-2004-01-09 (dev) OS: Linux (Debian unstable)
Private report: No CVE-ID:
 [2004-01-09 05:53 UTC] jm dot barbier at solidev dot org
<?php mysql_pconnect("localhost:/tmp/mysql.sock","xxx","xxx"); ?> gives segfault; the same with mysql_connect = perfect...

php5CVS-2004-01-09 running with apache2.0.48, mysql4.11 

'./configure' '--prefix=/usr/local/testing/php5' '--exec-prefix=/usr/local/testing/php5' '--with-apxs2=/usr/local/testing/apache2/bin/apxs' '--with-libxml-dir=/usr/local/testing/lib/' '--with-openssl' '--with-mysql=/usr/local/testing/mysql' '--with-mysqli=/usr/local/testing/mysql/bin/mysql_config' '--with-pear' '--enable-debug'

Also tried with --with-sqlite, and without --enable-debug but no difference...

All of this worked well with php5-b2 .

thank you...

Reproduce code:
bogus.php :
<?php mysql_pconnect("localhost:/tmp/mysql.sock","xxx","xxx"); ?>

>> php bogus.php

Expected result:

Actual result:
>gdb php
(gdb) run bogus.php
Starting program: /usr/bin/php bogus.php
[New Thread 16384 (LWP 23825)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 23825)]
0x081f2577 in zend_hash_apply (ht=0x83fd2d8, 
    apply_func=0x80cd840 <php_sqlite_callback_invalidator>, tsrm_ls=0x8342fd8)
    at /usr/local/src/php-src/Zend/zend_hash.c:658
658                     if (apply_func(p->pData TSRMLS_CC)) {
(gdb) bt
#0  0x081f2577 in zend_hash_apply (ht=0x83fd2d8, 
    apply_func=0x80cd840 <php_sqlite_callback_invalidator>, tsrm_ls=0x8342fd8)
    at /usr/local/src/php-src/Zend/zend_hash.c:658
#1  0x080cdc0b in php_sqlite_forget_persistent_id_numbers (rsrc=0x83fd108, 
    tsrm_ls=0x8342fd8) at /usr/local/src/php-src/ext/sqlite/sqlite.c:374
#2  0x081f2580 in zend_hash_apply (ht=0x8346cd4, 
    apply_func=0x80cdbd0 <php_sqlite_forget_persistent_id_numbers>, 
    tsrm_ls=0x8342fd8) at /usr/local/src/php-src/Zend/zend_hash.c:658
#3  0x080cdca0 in zm_deactivate_sqlite (type=1, module_number=4, tsrm_ls=0x28d)
    at /usr/local/src/php-src/ext/sqlite/sqlite.c:390
#4  0x081eea00 in module_registry_cleanup (module=0x28d, tsrm_ls=0x8342fd8)
    at /usr/local/src/php-src/Zend/zend_API.c:1411
#5  0x081f2580 in zend_hash_apply (ht=0x8342040, 
    apply_func=0x81ee9c0 <module_registry_cleanup>, tsrm_ls=0x8342fd8)
    at /usr/local/src/php-src/Zend/zend_hash.c:658
#6  0x081e9bbf in zend_deactivate_modules (tsrm_ls=0x8342fd8)
    at /usr/local/src/php-src/Zend/zend.c:797
#7  0x081a28dd in php_request_shutdown (dummy=0x0)
    at /usr/local/src/php-src/main/main.c:1228
#8  0x0821de65 in main (argc=2, argv=0xbffffb34)
    at /usr/local/src/php-src/sapi/cli/php_cli.c:1028


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-11 10:32 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Same as bug #26796 is about.

 [2004-01-16 06:12 UTC]
Just FYI: this is now fixed in CVS.

 [2004-08-05 02:06 UTC] yrob at mail dot crpower dot com
I'm currently having this problem after a seemingly successful compilation and installation of Apache2, MySQL 5.0.1, and PHP 5.
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 04:01:31 2015 UTC