From: rberquist at sbdrepro dot com
Operating system: Highly customized RH
PHP version: 5CVS-2005-11-07 (snap)
PHP Bug Type: ODBC related
Bug description: odbc_connect segmentation fault
Description:
------------
As reported in Bug 34716, but I have a backtrace for you.
Using
Apache/2.0.46
PHP/5.1.0RC5-dev (snapshot php5-200511071930)
unixODBC-2.2.11
php compiled with
./configure --with-apxs2=/usr/sbin/apxs --with-mysql=shared
--with-unixODBC=shared --enable-debug
When accessing the script via brower or command line, results in a
segfault.
`isql Customer -v` results as expected and able to execute queries.
Reproduce code:
---------------
<?php
//database connection
$conn=odbc_connect('CUSTOMER','tsi','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
//output
echo "Test";
?>
Expected result:
----------------
I expect it to simply connect, print Test, then disconnect.
Actual result:
--------------
Segmentation fault with no output.
(gdb) bt
#0 0xb6eaa370 in ?? ()
#1 0xb6eea7b1 in ISAMOpen () from /usr/local/lib/libtfodbccl.so
#2 0xb6eddace in SQLConnect () from /usr/local/lib/libtfodbccl.so
#3 0xb6f3c26e in SQLConnect (connection_handle=0x8430540,
server_name=0x842647c "CUSTOMER", name_length1=-3,
user_name=0x84264fc "tsi", name_length2=-3, authentication=0x8426574
"",
name_length3=-3) at SQLConnect.c:3819
#4 0xb6f8f7dc in odbc_sqlconnect (conn=0xbfffacb0, db=0x842647c
"CUSTOMER",
uid=0x84264fc "tsi", pwd=0x8426574 "", cur_opt=2, persistent=0)
at /home/rberquist/php5-200511071930/ext/odbc/php_odbc.c:2174
#5 0xb6f900c4 in odbc_do_connect (ht=3, return_value=0x8434a94,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
persistent=0)
at /home/rberquist/php5-200511071930/ext/odbc/php_odbc.c:2373
#6 0xb6f8f4d7 in zif_odbc_connect (ht=3, return_value=0x8434a94,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
at /home/rberquist/php5-200511071930/ext/odbc/php_odbc.c:2060
#7 0x0826b846 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffae10)
at zend_vm_execute.h:188
#8 0x0826e50f in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffae10)
at zend_vm_execute.h:1578
#9 0x0826b4f6 in execute (op_array=0x8430444) at zend_vm_execute.h:88
#10 0x08243a0c in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /home/rberquist/php5-200511071930/Zend/zend.c:1087
#11 0x082025b2 in php_execute_script (primary_file=0xbfffd230)
at /home/rberquist/php5-200511071930/main/main.c:1677
#12 0x082b17c6 in main (argc=2, argv=0xbfffd314)
at /home/rberquist/php5-200511071930/sapi/cli/php_cli.c:1041
(gdb) frame 9
#9 0x0826b4f6 in execute (op_array=0x8430444) at zend_vm_execute.h:88
88 if (EX(opline)->handler(&execute_data TSRMLS_CC) >
0) {
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
$1 = 0xb6f957e0 "odbc_connect"
(gdb) print (char *)executor_globals.active_op_array->function_name
$2 = 0x0
(gdb) print (char *)executor_globals.active_op_array->filename
$3 = 0x843459c "/opt/web/test2.php"
--
Edit bug report at http://bugs.php.net/?id=35144&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35144&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35144&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35144&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35144&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35144&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35144&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35144&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35144&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35144&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35144&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35144&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35144&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35144&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35144&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35144&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35144&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35144&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35144&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35144&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35144&r=mysqlcfg