From: [EMAIL PROTECTED] Operating system: sparc solaris 2.8 and 2.6 PHP version: 4.2.3 PHP Bug Type: MSSQL related Bug description: odbc_do() or odbc_exec() Always produces a segmentation fault core dump
The odbc driver from openlink software for ms sql 2000 is used. Note that thru the openlink adminstator all works fine si this lead me to the thought that this must be a php problem PHP was compiled with the option --with-openlink (--with-iodbc produces the same) Symptoms : 1) odbc_connect() suceeds and returns "RESOURCE ID #1" 2) the odbc_do() or odbc_exec() always produce segmentation fault core dumped. 3) The error is the same if I run from the comand line "php ptest3.php" I guess i can also run from the command line ouside any web server This is the script (ptest3.php) that produces the error *********************script start ******************************** <? // putenv("LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib"); // putenv("ODBCINSTINI=/usr/local/bin/odbcinst.ini"); // this location will be determined by your driver install. // putenv("ODBCINI=/usr/local/bin/odbc.ini"); // odbc.ini contains your DSN,location determined by your driver install $dsn="eettn"; // this is a valid DSN. Can be tested in odbctest $user="sa"; $password="anmaelky"; $sql="SELECT * FROM tab01 where col01=1"; echo ("$LD_LIBRARY_PATH") ; echo("aaa<br>") ; echo("$user") ; echo("<br>") ; $conn_id=odbc_connect($dsn,"sa","anmaelky") ; echo("CONNECTION ID = |") ; echo($conn_id) ; echo("|\n\n") ; flush() ; // exit() ; if ($conn_id) { echo "connected to DSN: eettn\n\n"; $result=odbc_do($conn_id, $sql) ; echo("result") ; echo("$result") ; if($result) { echo "executing '$sql'"; echo "Results: "; odbc_result_all($result); echo "freeing result"; odbc_free_result($result); }else{ echo "can not execute '$sql' "; } echo "closing connection $conn_id"; odbc_close($conn_id); }else{ echo "can not connect to DSN: eettn "; } ?> *********************************** script end ********************************** gdb reports Program received signal SIGSEGV, Segmentation fault. 0xef3f4474 in SQLExtendedFetch () Here is the backtrace of gdb #0 0xef3f4474 in SQLExtendedFetch () #1 0xef3f53d0 in SQLExtendedFetch () #2 0xef3cbf38 in SQLExtendedFetch () #3 0xef3c72e0 in SQLExtendedFetch () #4 0xef3c5740 in SQLExtendedFetch () #5 0xef3b35d0 in SQLNumResultCols () #6 0xef3aca14 in SQLError () #7 0xef398060 in SQLDriverConnect () #8 0xef3acae0 in SQLExecDirect () #9 0xef73ecac in SQLExecDirect () #10 0x44050 in zif_odbc_exec (ht=1543480, return_value=0x171cf0, this_ptr=0x0, return_value_used=1) at php_odbc.c:1226 #11 0xe65dc in execute () #12 0xc6fbc in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:812 #13 0x2a374 in php_execute_script (primary_file=0xeffffc48) at main.c:1383 #14 0x276f0 in main (argc=2, argv=0xeffffcd4) at cgi_main.c:778 Best Regards Christos Michail -- Edit bug report at http://bugs.php.net/?id=20203&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=20203&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=20203&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=20203&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=20203&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=20203&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=20203&r=support Expected behavior: http://bugs.php.net/fix.php?id=20203&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=20203&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=20203&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=20203&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20203&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=20203&r=dst IIS Stability: http://bugs.php.net/fix.php?id=20203&r=isapi