freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields
- From: Robert Benjamin <freetds228 AT lewenberg.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Segmentation fault retrieving non-NULL datetime fields
- Date: Sat, 05 Nov 2005 11:33:48 -0600
I installed the development version of freetds and am still getting the same error. I re-compiled PHP with --enable-debug and this is what it tells me:
[Sat Nov 5 11:26:07 2005] Script: '/www-s/testfreetds.php'
---------------------------------------
/root/tmp/php-4.4.1/ext/mssql/php_mssql.c(191) : Block 0x093CA2E0 status:
/root/tmp/php-4.4.1/Zend/zend_variables.c(44) : Actual location (location was relayed)
Beginning: OK (allocated on /root/tmp/php-4.4.1/ext/mssql/php_mssql.c:904, 19 bytes)
End: Overflown (magic=0x31383A34 instead of 0x2A8FCC84)
At least 4 bytes overflown
---------------------------------------
Frediano Ziglio wrote:
Il giorno sab, 05/11/2005 alle 10.55 -0500, James K. Lowden ha scritto:
Robert Benjamin wrote:
I am using freetds 0.63 with php 4.4.1. I have a simple script which executes the query
"SELECT [DateModified] FROM PEOPLE WHERE LastName LIKE '%Smith%'
When fetching the data with the code
while ($row = $rs->fetchRow(DB_FETCHMODE_ASSOC))
{
print "Date modified is " . $row["DateModified"] . "\n" ;
}
if the DateModified is _not_ NULL, I get a segmentation fault.
The form of the default datetime->character conversion has been carefully
set to mimic that of the vendors' libraries. I think if you get a
backtrace in gdb for your simple script, you'll find the culprit is
somewhere in the PHP code.
FreeTDS transports your datetime field in its native format, and PHP
converts it to a character string. The conversion may be implicit
(dbbind) or explicit (dbconvert); I don't know. Regardless, it's
certainly an opportunity to fail to allocate enough memory for the
conversion, which is certainly one route to a segmentation fault.
HTH.
--jkl
Try also post 0.63 patch from
http://freetds.sourceforge.net/post63.diff.gz
Fri Jul 22 13:38:26 CET 2005 Frediano Ziglio <freddy77 AT angelfire.com>
* src/tds/convert.c: fix possible core calling strftime
freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
-
[freetds] Segmentation fault retrieving non-NULL datetime fields,
Robert Benjamin, 11/05/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
James K. Lowden, 11/05/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Frediano Ziglio, 11/05/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Robert Benjamin, 11/05/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Frediano Ziglio, 11/06/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Robert Benjamin, 11/06/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
James K. Lowden, 11/06/2005
- Re: [freetds] Segmentation fault retrieving non-NULL datetime fields, Robert Benjamin, 11/06/2005
- Re: [freetds] Segmentation fault retrieving non-NULL datetime fields, James K. Lowden, 11/06/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
James K. Lowden, 11/06/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Robert Benjamin, 11/06/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Frediano Ziglio, 11/06/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Robert Benjamin, 11/05/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
Frediano Ziglio, 11/05/2005
-
Re: [freetds] Segmentation fault retrieving non-NULL datetime fields,
James K. Lowden, 11/05/2005
Archive powered by MHonArc 2.6.24.