Skip to Content.
Sympa Menu

freetds - Re: [freetds] Segmentation fault retrieving non-NULL datetime fields

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Segmentation fault retrieving non-NULL datetime fields
  • Date: Sat, 05 Nov 2005 17:14:29 +0100

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






Archive powered by MHonArc 2.6.24.

Top of Page