Skip to Content.
Sympa Menu

freetds - Re: [freetds] MS-SQL ntext fields?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Rich Young" <rich AT experienceplus.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] MS-SQL ntext fields?
  • Date: Tue, 9 Jan 2007 16:53:48 -0700

I finally had a chance to run through these instructions on using gdb.
I have more than one script failing, so I'm pasting in backtrace info
for two examples. After running the backtrace, I followed the
instructions at http://bugs.php.net/bugs-generating-backtrace.php to
determine which function was responsible for the last execute() call.

#############################################
#Here are the results of the first backtrace:
#############################################

(gdb) r test.php
<a bunch of HTML code comes out here, and then...>
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182894185888 (LWP 21325)]
0x0000003f6fd71f07 in memcpy () from /lib64/tls/libc.so.6
(gdb) bt
#0 0x0000003f6fd71f07 in memcpy () from /lib64/tls/libc.so.6
#1 0x00000000004f8030 in _estrndup ()
#2 0x0000002a98a82b2b in zif_odbc_result () from
/usr/lib64/php4/odbc.so
#3 0x0000000000519ed8 in execute ()
#4 0x00000000005082ad in zend_execute_scripts ()
#5 0x00000000004dcc0a in php_execute_script ()
#6 0x000000000052198a in main ()
(gdb) frame 3
#3 0x0000000000519ed8 in execute ()
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
Attempt to extract a component of a value that is not a structure.
(gdb)

############################################
#And here are the results of the second backtrace:
############################################

(gdb) r itin.php
<a bunch of HTML code comes out here, and then...>
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182894185888 (LWP 21364)]
0x0000003f6fd71f07 in memcpy () from /lib64/tls/libc.so.6
(gdb) bt
#0 0x0000003f6fd71f07 in memcpy () from /lib64/tls/libc.so.6
#1 0x00000000004f8030 in _estrndup ()
#2 0x0000002a98a82b2b in zif_odbc_result () from
/usr/lib64/php4/odbc.so
#3 0x0000000000519ed8 in execute ()
#4 0x00000000005082ad in zend_execute_scripts ()
#5 0x00000000004dcc0a in php_execute_script ()
#6 0x000000000052198a in main ()
(gdb) frame 3
#3 0x0000000000519ed8 in execute ()
(gdb) print (char
*)(executor_globals.function_state_ptr->function)->common.function_name
Attempt to extract a component of a value that is not a structure.
(gdb)

Apparently, it's the same problem affecting both scripts.
Unfortunately, I'm enough of a newbie here that I still don't understand
whether this is a PHP or FreeTDS bug. Any insight?

--Rich Young, IT Dept.
ExperiencePlus! Specialty Tours, Inc.
rich AT ExperiencePlus.com
1-800-685-4565


> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
> ZIGLIO, Frediano, VF-IT
> Sent: Thursday, January 04, 2007 3:45 AM
> To: FreeTDS Development Group
> Subject: Re: [freetds] MS-SQL ntext fields?
>
> >
> > Freddy & James-
> > Thanks for the tip on specifying the TDS Version in tsql - it
> > was running version 4.2, and specifying 8.0 enabled the
> > problem queries
> > to run fine. isql runs the same queries without trouble (and always
> > has), but PHP is still crashing.
> >
> > I'm beginning to think this is a PHP bug rather than a freeTDS
> > bug.... Do you agree?
> >
>
> Difficult to say. Perhaps our library is returning some invalid data
> that cause PHP to core so perhaps error occur in PHP but
> problem is our
> driver...
> Which client charset are you using?
>
> > I'm reading up on how to get a gdb backtrace from the PHP crash,
> > but I suspect it might be more fruitful to browse PHP bug
> discussions.
> > Chances are it's not a new bug, as I'm using CentOS and its
> relatively
> > conservative package choices.
> >
>
> Get "php script.php" running (and coring too) now you can
>
> $ gdb $(which php) core*
>
> and at gdb prompt
>
> $ bt
>
> (to get back trace) or
>
> $ gdb php
>
> and at gdb prompt
>
> $ r script.php
>
> ... wait core ...
>
> $ bt
>
> > BTW, I fed you a snippet from the wrong freetds.conf - I had
> > omitted the tds version = line in a different one. After
> making that
> > correction, the query runs fine in tsql without explicitly
> setting the
> > TDS version. (Sadly, adding the correct tds version
> > instruction to the
> > conf file that actually matters didn't clear up my PHP crashing
> > trouble.)
> >
>
> freddy77
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




Archive powered by MHonArc 2.6.24.

Top of Page