Bug #69184 [Com]: CLI-only MSSQL crash
Edit report at https://bugs.php.net/bug.php?id=69184&edit=1
ID: 69184
Comment by: erik5 at pair dot com
Reported by: victor_volpe at bol dot com dot br
Summary: CLI-only MSSQL crash
Status: Open
Type: Bug
Package: MSSQL related
Operating System: FreeBSD 10.1-RELEASE-p6
PHP Version: 5.6.6
Block user comment: N
Private report: N
New Comment:
I was able to resolve this by recompiling FreeTDS from source without --enable-sybase-compat.
Previous Comments:
------------------------------------------------------------------------
[2015-03-04 16:10:57] victor_volpe at bol dot com dot br
Description:
------------
Hi, I'm using FreeTDS 0.91.103_2,1 and the this script are running fine in webserver but not in
CLI. Maybe PHP are passing invalid pointers to the dbopen() function of FreeTDS. I have several
crontab jobs that requires MSSQL connection so I need this bug fixed ASAP.
Ps.: No output in the FreeTDS debug file and the tsql (FreeTDS CLI) are running fine too.
Thanks.
Test script:
---------------
<?php
if (mssql_connect("100.100.100.100", "sa", "thisissparta"))
print "Connection success\n";
else
print "Connection error\n";
?>
Actual result:
--------------
(gdb) run test.php
Starting program: /usr/bin/php test.php
[New LWP 100886]
[New Thread 808c06400 (LWP 100886/php)]
Program received signal SIGBUS, Bus error.
[Switching to Thread 808c06400 (LWP 100886/php)]
0x0000000801cc3f7a in dbopen () from /usr/local/lib/libsybdb.so.5
(gdb) bt
#0 0x0000000801cc3f7a in dbopen () from /usr/local/lib/libsybdb.so.5
#1 0x0000000801c9da97 in tdsdbopen () from /usr/local/lib/libsybdb.so.5
#2 0x000000080635a1c1 in getpwent () from /lib/libc.so.7
#3 0x00000008063591b0 in getpwent_r () from /lib/libc.so.7
#4 0x000000080636ce2f in nsdispatch () from /lib/libc.so.7
#5 0x0000000806359c1e in getpwuid_r () from /lib/libc.so.7
#6 0x0000000801cd1978 in dbopen () from /usr/local/lib/libsybdb.so.5
#7 0x0000000801cc4cfd in dbopen () from /usr/local/lib/libsybdb.so.5
#8 0x0000000801cc3f85 in dbopen () from /usr/local/lib/libsybdb.so.5
#9 0x0000000801c9da97 in tdsdbopen () from /usr/local/lib/libsybdb.so.5
#10 0x00000000006c77df in php_mssql_do_connect () at php_mssql.c:793
#11 0x00000000008ca887 in zend_do_fcall_common_helper_SPEC (execute_data=0x808c42100) at
zend_vm_execute.h:558
#12 0x0000000000889bf8 in execute_ex (execute_data=<value optimized out>) at
zend_vm_execute.h:363
#13 0x0000000000860da0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:1341
#14 0x0000000000804f8c in php_execute_script (primary_file=0x7fffffffe868) at main.c:2578
#15 0x00000000008e6ccc in do_cli (argc=<value optimized out>, argv=<value optimized
out>) at php_cli.c:994
#16 0x00000000008e59ba in main (argc=<value optimized out>, argv=<value optimized out>)
at php_cli.c:1378
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69184&edit=1
Thread (3 messages)