#39802 [NEW]: PHP segfaults with odbc_connect()
| From: | webmaster at guestwho dot com | Date: | Mon, 11 Dec 2006 22:26:06 +0000 |
| Subject: | #39802 [NEW]: PHP segfaults with odbc_connect() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-106216@lists.php.net to get a copy of this message | ||
From: webmaster at guestwho dot com
Operating system: FreeBSD 6.1-RELEASE
PHP version: 5.2.0
PHP Bug Type: ODBC related
Bug description: PHP segfaults with odbc_connect()
Description:
------------
I have been trying to connect a microsoft access database using PHP,
mdbtools and unixODBC, but any attempt at calling odbc_connect() results
in an immediate segfault.
This behaviour occurs in both the shared apache module and the standalone
cgi version. Only the latter dumps core though.
PHP is configured as follows:
./configure --with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql \
--with-zlib --with-pdo-mysql=/usr/local/mysql
--enable-mbstring \
--with-curl=/usr/local --enable-debug
--with-openssl=/usr/local/ssl \
--with-gd --with-custom-odbc=/usr/local
Here are the unixODBC configs:
odbcinst.ini
-------------
[MDBToolsODBC]
Description = MDB Tools ODBC drivers
Driver = /usr/local/lib/libmdbodbc.0
Setup =
FileUsage = 1
CPTimeout =
CPReuse =
DisableGetFunctions = 0
UsageCount = 1
--------------
odbc.ini
--------------
[Water]
Description = Water Module
Driver = MDBToolsODBC
Trace = Yes
TraceFile = /var/log/sql.log
Database = /home/skeleton-man/public_html/water/water.mdb
Servername = localhost
UserName =
Password =
---------------
Reproduce code:
---------------
<?
$myDB = odbc_connect('Water','','');
$query = "SELECT RLCode FROM Account";
$result = odbc_exec($myDB, $query);
while (odbc_fetch_row($result)){
print odbc_result($result,'RLCode')."<br>";
}
?>
Expected result:
----------------
It should print a list of account numbers from the RLCode column in the
database.
Actual result:
--------------
PHP segfaults immediately with no output.
Backtrace:
#0 0x082ef680 in zend_hash_find (ht=0x8829668,
arKey=0x884137c "unixODBC_Water___2", nKeyLength=19, pData=0x10000)
at /usr/local/src/php-5.2.0/Zend/zend_hash.c:849
#1 0x081a26ac in odbc_do_connect (ht=3, return_value=0x8841364,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
persistent=0)
at /usr/local/src/php-5.2.0/ext/odbc/php_odbc.c:2341
#2 0x081a1c13 in zif_odbc_connect (ht=3, return_value=0x8841364,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
at /usr/local/src/php-5.2.0/ext/odbc/php_odbc.c:2053
#3 0x083008a6 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfd510)
at zend_vm_execute.h:200
#4 0x0830002d in execute (op_array=0x8840a84) at zend_vm_execute.h:92
#5 0x082e87c3 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/local/src/php-5.2.0/Zend/zend.c:1097
#6 0x082b1ee5 in php_execute_script (primary_file=0xbfbfec00)
at /usr/local/src/php-5.2.0/main/main.c:1758
#7 0x083615ba in main (argc=2, argv=0xbfbfeca8)
at /usr/local/src/php-5.2.0/sapi/cgi/cgi_main.c:1625
--
Edit bug report at http://bugs.php.net/?id=39802&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39802&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39802&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39802&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39802&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39802&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39802&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39802&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39802&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39802&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39802&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39802&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39802&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39802&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39802&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39802&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39802&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39802&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39802&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39802&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39802&r=mysqlcfg