[freetds] PHP5 MSSQL 2000 NULL fields segmentation fault

Kutas, Manfred Manfred.Kutas at discount24.de
Thu Apr 27 08:35:09 EDT 2006


Hi,

I am experiencing some problems with FreeTDS/PHP/MSSQL. I am not sure if it's PHP's or FreeTDS' malfunction, so i am posting it here too.
I can connect to MSSQL Server and execute queries, but everytime there is a NULL value in the result row, PHP crashes, causing "[notice] child pid xxxxx exit signal Segmentation fault (11)" entry in the error log of apache (the browser page is empty). If I modify my query statement so, that there aren't any NULL values in the result row, I receive proper page in my browser. I can't alter tables on the MSSQL Server, so it has to be done somehow.

System:
x86_64 suse linux 10.0

apache 2.0.54-10
php 5.0.4-9
unixODBC 2.2.11-2

(all installed over yast, so I can't tell ./configure options)

freetds-0.6.3 with:
./configure --prefix=/usr/local  --with-tdsver=8.0 --with-unixodbc=/usr/lib64 --enable-msdblib

The segmentation fault ist also reproducable over cli. Here is backtrace:

[Switching to Thread 46912514354048 (LWP 21343)]
0x00002aaaab940413 in memcpy () from /lib64/tls/libc.so.6
(gdb) bt
#0  0x00002aaaab940413 in memcpy () from /lib64/tls/libc.so.6
#1  0x00000000ffffffff in ?? ()
#2  0x00000000008d8018 in ?? ()
#3  0x0000000000000070 in ?? ()
#4  0x0000000000000002 in ?? ()
#5  0x0000000000000002 in ?? ()
#6  0x000000000095d188 in ?? ()
#7  0x00000000004de354 in _estrndup (s=0x0, length=<value optimized out>) at string3.h:52
#8  0x00002aaab208bc1e in php_odbc_fetch_hash (ht=<value optimized out>, return_value=0x8d7778,
    this_ptr=<value optimized out>, return_value_used=<value optimized out>, result_type=896)
    at /usr/src/debug/php-5.0.4/ext/odbc/php_odbc.c:1460
#9  0x00000000005166d8 in zend_do_fcall_common_helper (execute_data=0x7fffff8e9050, opline=0x8daca0, op_array=0x8d2f38)
    at /usr/src/debug/php-5.0.4/Zend/zend_execute.c:2727
#10 0x000000000052574d in zend_do_fcall_handler (execute_data=0x7fffff8e9050, opline=0x8daca0, op_array=0x8d2f38)
    at /usr/src/debug/php-5.0.4/Zend/zend_execute.c:2859
#11 0x0000000000513e74 in execute (op_array=0x8d2f38) at /usr/src/debug/php-5.0.4/Zend/zend_execute.c:1406
#12 0x00000000004f31c9 in zend_execute_scripts (type=8, retval=<value optimized out>, file_count=3)
    at /usr/src/debug/php-5.0.4/Zend/zend.c:1069
#13 0x00000000004bbb94 in php_execute_script (primary_file=0x7fffff8eb680) at /usr/src/debug/php-5.0.4/main/main.c:1632
#14 0x000000000052c00b in main (argc=2, argv=0x7fffff8eb808) at /usr/src/debug/php-5.0.4/sapi/cgi/cgi_main.c:1577

Thanks in advance, Manfred


More information about the FreeTDS mailing list