Skip to Content.
Sympa Menu

freetds - Freetds + PHP segfault

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Cesare D'Amico" <cesare AT ngi.it>
  • To: freetds AT franklin.metalab.unc.edu
  • Subject: Freetds + PHP segfault
  • Date: Wed, 24 Jul 2002 09:14:27 +0200


Hi, I'm an Italian sysadmin and php developer.
I'm trying to run on linux some php scripts which use ODBC to connect to a
sql server 2000. I installed unixODBC 2.1.1 and freetds 0.53, both as
debian packages, and php 4.2.2 by hand.
When there is a single query on the php page, everything is ok (connection
is established and data is returned by sql server).
When I have more than one query, apache segfaults. I've tried to put
odbc_free_result() after every query, but the behaviour doesn't change.
Here's what gdb says:

(gdb) run pw2.inc
Starting program: /usr/bin/php pw2.inc
X-Powered-By: PHP/4.2.2
[...a lot of normal output...]
query = set textsize 10000;SELECT IDCATEGORIA,DESCRIZIONECATEGORIA FROM
CATEGORIE WHERE IDSITO=1;

Program received signal SIGSEGV, Segmentation fault.
0x400b35f6 in tds_reset_msg_info () from /usr/lib/libsybdb.so.1
(gdb) bt
#0 0x400b35f6 in tds_reset_msg_info () from /usr/lib/libsybdb.so.1
#1 0x400af70d in dblib_handle_err_message () from /usr/lib/libsybdb.so.1
#2 0x400b3003 in tds_client_msg () from /usr/lib/libsybdb.so.1
#3 0x400ba316 in tds_submit_query () from /usr/lib/libsybdb.so.1
#4 0x4064f517 in SQLError () from /usr/lib/odbc/libtdsodbc.so
#5 0x4064f58e in SQLExecDirect () from /usr/lib/odbc/libtdsodbc.so
#6 0x40036d6f in SQLExecDirect () from /usr/lib/libodbc.so.1
#7 0x8086977 in zif_odbc_exec (ht=2, return_value=0x81d8694, this_ptr=0x0,
return_value_used=1) at php_odbc.c:1196
#8 0x40606e39 in zend_assign_to_variable_reference () from
/usr/local/Zend/lib/ZendOptimizer.so
#9 0x406101e4 in zend_oe () from /usr/local/Zend/lib/ZendOptimizer.so
#10 0x810bef8 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at
zend.c:810
#11 0x806a75d in php_execute_script (primary_file=0xbffffd28) at main.c:1381
#12 0x806862c in main (argc=2, argv=0xbffffda4) at cgi_main.c:778

./configure options for the packages:

** unixODBC **
--prefix=/usr --with-qt-includes=/usr/include/qt --sysconfdir=/etc
--enable-static --disable-rpath

** freetds **
--with-gnu-ld --with-tdsver=4.2 --prefix=/usr --with-unixodbc=/usr
--sysconfdir=/etc/freetds

** php **
--with-mysql=/usr --with-pgsql=/usr --with-zlib
--with-config-file-path=/usr/local/etc --with-bz2 --with-curl --enable-ftp
--with-gd=/usr --with-jpeg-dir=/usr --with-png-dir=/usr
--with-freetype=/usr --with-pdflib=/usr/local --enable-versioning
--with-xml --enable-sysvsem --enable-sysvshm --enable-inline-optimization
--with-gnu-ld --prefix=/usr --with-vpopmail --with-sybase=/usr
--with-unixODBC=/usr

Any hint would be REALLY appreciated, since I've tried to make this work
for 3 days now :), and I'm really in a hurry.

Thanks
:ce

--
-- Il notiziario dei notiziari
-- http://www.notiziarioweb.it
--
Il segreto di volare consiste nel gettarti a terra, e sbagliare.
-- Douglas Adams



  • Freetds + PHP segfault, Cesare D'Amico, 07/24/2002

Archive powered by MHonArc 2.6.24.

Top of Page