#39134 [Opn->Fbk]: PHP + FreeTDS 0.64 crashes when TEXT field with empty string encountered
| From: | tony2001@php.net | Date: | Thu, 12 Oct 2006 09:58:03 +0000 |
| Subject: | #39134 [Opn->Fbk]: PHP + FreeTDS 0.64 crashes when TEXT field with empty string encountered | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103466@lists.php.net to get a copy of this message | ||
ID: 39134
Updated by: tony2001@php.net
Reported By: jr-phpbugs at cedric dot unob dot cz
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: linux (irrelevant)
PHP Version: 4.4.4
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-10-12 09:32:09] jr-phpbugs at cedric dot unob dot cz
Since I omitted double-quotes at the end of the query, here's the
corrected one:
$query="SELECT test_text FROM test WHERE test_id=2";
------------------------------------------------------------------------
[2006-10-12 08:45:07] jr-phpbugs at cedric dot unob dot cz
Description:
------------
PHP, compiled with --with-sybase-ct=/usr/localFreeTDS crashes with
segmentation fault on SELECT from column of type TEXT with empty string
value.
Observed on PHP compiled with
--with-sybase-ct=/path/to/freetds-0.64/prefix , against MSSQL server
2000
Affects FreeTDS 0.64 and 0.64.1 (with 'post64.patch.gz' applied). Has
not been observed with FreeTDS 0.63.
FreeTDS 0.64 alone (without PHP) is not affected.
Possible bug in ext/sybase_ct/php_sybase_ct.c
Reproduce code:
---------------
in MSSQL Enterprise manager:
CREATE TABLE [dbo].[TEST] (
[TEST_ID] [int] IDENTITY (1, 1) NOT NULL ,
[TEST_VALUE] [int] NOT NULL ,
[TEST_TEXT] [text] NULL
)
insert into TEST (TEST_VALUE) values ('5');
insert into TEST (TEST_VALUE,TEST_TEXT) values ('6','');
in PHP script:
...
$query="SELECT test_text FROM test WHERE test_id=2;
$res=mssql_query($query,$db);
Expected result:
----------------
Empty string.
Actual result:
--------------
PHP crashes with segmentation fault.
CLI version:
- crash with "segmentation fault" message
libphp4.so version:
- affected thread produces a line "[notice] child pid XXXXX exit signal
Segmentation fault (11)" in Apache's error log.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39134&edit=1